summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/avatars.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2013-03-20 13:23:38 +0000
committerRobert Pösel <robyer@seznam.cz>2013-03-20 13:23:38 +0000
commit156911d2bc7900048e6ed7a574e5d34f1d9ed743 (patch)
tree545788023eee8c6aca706666b3cccbfc065bdbb2 /protocols/FacebookRM/src/avatars.cpp
parent67010ebc31ce45e6c42d2c31d983f3988bb320e1 (diff)
Facebook: Fixed size of avatars due to facebook change
git-svn-id: http://svn.miranda-ng.org/main/trunk@4124 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/avatars.cpp')
-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." );
}