summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/contacts.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2012-11-09 15:37:34 +0000
committerRobert Pösel <robyer@seznam.cz>2012-11-09 15:37:34 +0000
commit0b67a54741236361d1ad1adf557e73fd80d1eea9 (patch)
treeb71ce86076216c269420a833689f53a1bdb7d858 /protocols/FacebookRM/src/contacts.cpp
parent336718667f42e964f4deeb54f60d42ff392457d4 (diff)
Facebook: Show contacts on mobile with different MirVer (support for MobileState plugin)
git-svn-id: http://svn.miranda-ng.org/main/trunk@2259 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/contacts.cpp')
-rw-r--r--protocols/FacebookRM/src/contacts.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp
index 5337ce6dbe..cabad56410 100644
--- a/protocols/FacebookRM/src/contacts.cpp
+++ b/protocols/FacebookRM/src/contacts.cpp
@@ -108,9 +108,8 @@ HANDLE FacebookProto::AddToContactList(facebook_user* fbu, BYTE type, bool dont_
DBWriteContactSettingString(hContact,m_szModuleName,FACEBOOK_KEY_ID,fbu->user_id.c_str());
std::string homepage = FACEBOOK_URL_PROFILE + fbu->user_id;
- DBWriteContactSettingString(hContact, m_szModuleName,"Homepage", homepage.c_str());
-
- DBWriteContactSettingString(hContact, m_szModuleName, "MirVer", FACEBOOK_NAME);
+ DBWriteContactSettingString(hContact, m_szModuleName,"Homepage", homepage.c_str());
+ DBWriteContactSettingString(hContact, m_szModuleName, "MirVer", fbu->status_id == ID_STATUS_ONTHEPHONE ? FACEBOOK_MOBILE : FACEBOOK_NAME);
DBDeleteContactSetting(hContact, "CList", "MyHandle");
@@ -141,7 +140,7 @@ HANDLE FacebookProto::AddToContactList(facebook_user* fbu, BYTE type, bool dont_
return 0;
}
-void FacebookProto::SetAllContactStatuses(int status)
+void FacebookProto::SetAllContactStatuses(int status, bool reset_client)
{
for (HANDLE hContact = db_find_first();
hContact;
@@ -149,11 +148,18 @@ void FacebookProto::SetAllContactStatuses(int status)
{
if (!IsMyContact(hContact))
continue;
+
+ if (reset_client) {
+ DBVARIANT dbv;
+ if (!DBGetContactSettingTString(hContact,m_szModuleName,"MirVer",&dbv)) {
+ if (_tcscmp(dbv.ptszVal, _T(FACEBOOK_NAME)))
+ DBWriteContactSettingTString(hContact,m_szModuleName,"MirVer", _T(FACEBOOK_NAME));
+ DBFreeVariant(&dbv);
+ }
+ }
- if (DBGetContactSettingWord(hContact,m_szModuleName,"Status",ID_STATUS_OFFLINE) == status)
- continue;
-
- DBWriteContactSettingWord(hContact,m_szModuleName,"Status",status);
+ if (DBGetContactSettingWord(hContact,m_szModuleName,"Status",ID_STATUS_OFFLINE) != status)
+ DBWriteContactSettingWord(hContact,m_szModuleName,"Status",status);
}
}