summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/avatars.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-12-28 21:15:52 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-12-28 21:15:52 +0300
commitf0075f2b956969f29acd3bc9289c8a5f78faddad (patch)
tree0dbed900b3d75abc11991f1be3709994d2fdfb20 /protocols/FacebookRM/src/avatars.cpp
parent8ae09e329384682579d59fc92cd7ed5de37e1351 (diff)
code cleaning
Diffstat (limited to 'protocols/FacebookRM/src/avatars.cpp')
-rw-r--r--protocols/FacebookRM/src/avatars.cpp23
1 files changed, 8 insertions, 15 deletions
diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp
index d0a9952833..2b533181eb 100644
--- a/protocols/FacebookRM/src/avatars.cpp
+++ b/protocols/FacebookRM/src/avatars.cpp
@@ -92,20 +92,17 @@ void FacebookProto::UpdateAvatarWorker(void *)
std::string params = getBool(FACEBOOK_KEY_BIG_AVATARS, DEFAULT_BIG_AVATARS) ? "?width=200&height=200" : "?width=80&height=80";
- for (;;)
- {
+ for (;;) {
std::string url;
PROTO_AVATAR_INFORMATION ai = { 0 };
ai.hContact = avatar_queue[0];
- if (Miranda_IsTerminated())
- {
+ if (Miranda_IsTerminated()) {
debugLogA("*** Terminating avatar update early: %s", url.c_str());
break;
}
- if (GetDbAvatarInfo(ai, &url))
- {
+ if (GetDbAvatarInfo(ai, &url)) {
debugLogA("*** Updating avatar: %s", url.c_str());
bool success = facy.save_url(url + params, ai.filename, nlc);
@@ -134,8 +131,7 @@ INT_PTR FacebookProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam)
{
int res = 0;
- switch (wParam)
- {
+ switch (wParam) {
case AF_MAXSIZE:
((POINT*)lParam)->x = -1;
((POINT*)lParam)->y = -1;
@@ -162,7 +158,7 @@ INT_PTR FacebookProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam)
res = 0;
break;
- case AF_ENABLED:
+ case AF_ENABLED:
case AF_FETCHIFPROTONOTVISIBLE:
case AF_FETCHIFCONTACTOFFLINE:
res = 1;
@@ -178,8 +174,7 @@ INT_PTR FacebookProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
return GAIR_NOAVATAR;
PROTO_AVATAR_INFORMATION* pai = (PROTO_AVATAR_INFORMATION*)lParam;
- if (GetDbAvatarInfo(*pai, nullptr))
- {
+ if (GetDbAvatarInfo(*pai, nullptr)) {
bool fileExist = _waccess(pai->filename, 0) == 0;
bool needLoad;
@@ -188,13 +183,11 @@ INT_PTR FacebookProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
else
needLoad = (wParam & GAIF_FORCE) || !fileExist;
- if (needLoad)
- {
+ if (needLoad) {
debugLogA("*** Starting avatar request thread for %s", _T2A(pai->filename));
ScopedLock s(avatar_lock_);
- if (std::find(avatar_queue.begin(), avatar_queue.end(), pai->hContact) == avatar_queue.end())
- {
+ if (std::find(avatar_queue.begin(), avatar_queue.end(), pai->hContact) == avatar_queue.end()) {
bool is_empty = avatar_queue.empty();
avatar_queue.push_back(pai->hContact);
if (is_empty)