summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/FacebookRM/src/avatars.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp
index 00e6845fb2..bb9a883d78 100644
--- a/protocols/FacebookRM/src/avatars.cpp
+++ b/protocols/FacebookRM/src/avatars.cpp
@@ -57,9 +57,16 @@ void FacebookProto::CheckAvatarChange(HANDLE hContact, std::string image_url)
if (image_url.empty())
return;
- if (DBGetContactSettingByte(NULL, m_szModuleName, FACEBOOK_KEY_BIG_AVATARS, DEFAULT_BIG_AVATARS))
+ bool big_avatars = (bool)DBGetContactSettingByte(NULL, m_szModuleName, FACEBOOK_KEY_BIG_AVATARS, DEFAULT_BIG_AVATARS);
+
+ // We've got url to avatar of default size 32x32px, let's change it to slightly bigger (50x50px) - looks like maximum size for square format
+ std::tstring::size_type pos = image_url.rfind( "/s32x32/" );
+ if (pos != std::wstring::npos)
+ image_url = image_url.replace( pos, 8, big_avatars ? "/s200x200/" : "/s50x50/" );
+
+ if (big_avatars)
{
- std::tstring::size_type pos = image_url.rfind( "_q." );
+ pos = image_url.rfind( "_q." );
if (pos != std::wstring::npos)
image_url = image_url.replace( pos, 3, "_s." );
}