summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/avatars.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-10 20:20:46 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-10 20:20:46 +0000
commitb7639142c91c6fa38285fdc6de661a0b36d41fbe (patch)
tree99136618352c2030d72008cb027040869d08770b /protocols/FacebookRM/src/avatars.cpp
parentbfad803f0247a7395ed67eb04c190b3dfa511b0c (diff)
protocol DB helpers for Facebook
git-svn-id: http://svn.miranda-ng.org/main/trunk@5316 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/avatars.cpp')
-rw-r--r--protocols/FacebookRM/src/avatars.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp
index 77802300f0..8f5f1d00f3 100644
--- a/protocols/FacebookRM/src/avatars.cpp
+++ b/protocols/FacebookRM/src/avatars.cpp
@@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
bool FacebookProto::GetDbAvatarInfo(PROTO_AVATAR_INFORMATIONT &ai, std::string *url)
{
DBVARIANT dbv;
- if (!db_get_s(ai.hContact, m_szModuleName, FACEBOOK_KEY_AV_URL, &dbv)) {
+ if (!getString(ai.hContact, FACEBOOK_KEY_AV_URL, &dbv)) {
std::string new_url = dbv.pszVal;
db_free(&dbv);
@@ -35,7 +35,7 @@ bool FacebookProto::GetDbAvatarInfo(PROTO_AVATAR_INFORMATIONT &ai, std::string *
if (url)
*url = new_url;
- if (!db_get_ts(ai.hContact, m_szModuleName, FACEBOOK_KEY_ID, &dbv)) {
+ if (!getTString(ai.hContact, FACEBOOK_KEY_ID, &dbv)) {
std::string ext = new_url.substr(new_url.rfind('.'));
std::tstring filename = GetAvatarFolder() + L'\\' + dbv.ptszVal + (TCHAR*)_A2T(ext.c_str());
db_free(&dbv);
@@ -57,7 +57,7 @@ void FacebookProto::CheckAvatarChange(HANDLE hContact, std::string image_url)
if (image_url.empty())
return;
- bool big_avatars = db_get_b(NULL, m_szModuleName, FACEBOOK_KEY_BIG_AVATARS, DEFAULT_BIG_AVATARS) != 0;
+ bool big_avatars = getBool(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/");
@@ -73,14 +73,14 @@ void FacebookProto::CheckAvatarChange(HANDLE hContact, std::string image_url)
DBVARIANT dbv;
bool update_required = true;
- if (!db_get_s(hContact, m_szModuleName, FACEBOOK_KEY_AV_URL, &dbv))
+ if (!getString(hContact, FACEBOOK_KEY_AV_URL, &dbv))
{
update_required = image_url != dbv.pszVal;
db_free(&dbv);
}
if (update_required || !hContact)
{
- db_set_s(hContact, m_szModuleName, FACEBOOK_KEY_AV_URL, image_url.c_str());
+ setString(hContact, FACEBOOK_KEY_AV_URL, image_url.c_str());
if (hContact)
{
db_set_b(hContact, "ContactPhoto", "NeedUpdate", 1);