summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/avatars.cpp
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2014-12-14 19:07:00 +0000
committerKirill Volinsky <mataes2007@gmail.com>2014-12-14 19:07:00 +0000
commit967c43ea2061ddd25e69927780e534ac93ce576a (patch)
treef8107e199ad90316444cb06c3c9cc2c29b590ee7 /protocols/FacebookRM/src/avatars.cpp
parentf942a0a8f658c92c2597272d0af5e8d364426a3b (diff)
FacebookRM: changed warning lavel to w4
git-svn-id: http://svn.miranda-ng.org/main/trunk@11420 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/avatars.cpp')
-rw-r--r--protocols/FacebookRM/src/avatars.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp
index 0be1b41b65..43af49fa35 100644
--- a/protocols/FacebookRM/src/avatars.cpp
+++ b/protocols/FacebookRM/src/avatars.cpp
@@ -44,7 +44,7 @@ bool FacebookProto::GetDbAvatarInfo(PROTO_AVATAR_INFORMATIONT &ai, std::string *
void FacebookProto::CheckAvatarChange(MCONTACT hContact, const std::string &image_url)
{
std::tstring::size_type pos = image_url.rfind("/");
-
+
// Facebook contacts always have some avatar - keep avatar in database even if we have loaded empty one (e.g. for 'On Mobile' contacts)
if (image_url.empty() || pos == std::tstring::npos)
return;
@@ -56,11 +56,11 @@ void FacebookProto::CheckAvatarChange(MCONTACT hContact, const std::string &imag
pos = image_name.rfind("?");
if (pos != std::tstring::npos)
image_name = image_name.substr(0, pos);
-
+
// Append our parameters to allow comparing for avatar/settings change
if (getBool(FACEBOOK_KEY_BIG_AVATARS, DEFAULT_BIG_AVATARS))
image_name += "?big";
-
+
// Check for avatar change
ptrA old_name(getStringA(hContact, FACEBOOK_KEY_AVATAR));
bool update_required = (old_name == NULL || image_name.compare(old_name) != 0);
@@ -78,7 +78,8 @@ void FacebookProto::CheckAvatarChange(MCONTACT hContact, const std::string &imag
PROTO_AVATAR_INFORMATIONT ai = { sizeof(ai) };
if (GetAvatarInfo(update_required ? GAIF_FORCE : 0, (LPARAM)&ai) != GAIR_WAITFOR)
CallService(MS_AV_REPORTMYAVATARCHANGED, (WPARAM)m_szModuleName, 0);
- } else if (update_required) {
+ }
+ else if (update_required) {
db_set_b(hContact, "ContactPhoto", "NeedUpdate", 1);
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
}
@@ -95,14 +96,14 @@ void FacebookProto::UpdateAvatarWorker(void *)
for (;;)
{
std::string url;
- PROTO_AVATAR_INFORMATIONT ai = {sizeof(ai)};
+ PROTO_AVATAR_INFORMATIONT ai = { sizeof(ai) };
ai.hContact = avatar_queue[0];
if (Miranda_Terminated())
{
debugLogA("***** Terminating avatar update early: %s", url.c_str());
break;
- }
+ }
if (GetDbAvatarInfo(ai, &url))
{
@@ -177,7 +178,7 @@ INT_PTR FacebookProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
if (GetDbAvatarInfo(*AI, NULL))
{
bool fileExist = _taccess(AI->filename, 0) == 0;
-
+
bool needLoad;
if (AI->hContact)
needLoad = (wParam & GAIF_FORCE) && (!fileExist || db_get_b(AI->hContact, "ContactPhoto", "NeedUpdate", 0));
@@ -185,7 +186,7 @@ INT_PTR FacebookProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
needLoad = (wParam & GAIF_FORCE) || !fileExist;
if (needLoad)
- {
+ {
debugLogA("***** Starting avatar request thread for %s", _T2A(AI->filename));
ScopedLock s(avatar_lock_);
@@ -215,11 +216,11 @@ INT_PTR FacebookProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
TCHAR* buf = (TCHAR*)wParam;
int size = (int)lParam;
- PROTO_AVATAR_INFORMATIONT ai = {sizeof(ai)};
+ PROTO_AVATAR_INFORMATIONT ai = { sizeof(ai) };
switch (GetAvatarInfo(0, (LPARAM)&ai)) {
case GAIR_SUCCESS:
_tcsncpy(buf, ai.filename, size);
- buf[size-1] = 0;
+ buf[size - 1] = 0;
return 0;
case GAIR_WAITFOR: