diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-09-08 16:16:26 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-09-08 16:16:26 +0000 |
commit | 49e1cc1238916a52a30acb6598b4b58e671e4032 (patch) | |
tree | 4121d7a5723202c37689a45c0aa9e0d96c8f3a6d /protocols | |
parent | 1528511fe3481eacf62fa099e5f7ceda3f9f9e3f (diff) |
Facebook: Duplicit contacts fixes
- Try to fix creating duplicit contacts in first place
- Don't notify duplicit contacts as "no longer on server-list"
git-svn-id: http://svn.miranda-ng.org/main/trunk@6022 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/FacebookRM/src/process.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index bb8b95f3ea..218f95125a 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -212,17 +212,14 @@ void FacebookProto::ProcessFriendList(void* data) // Check avatar change
CheckAvatarChange(hContact, fbu->image_url);
-
- delete fbu;
- friends.erase(iter);
+
+ // Mark this contact as deleted ("processed") and delete them later (as there may be some duplicit contacts to use)
+ fbu->deleted = true;
} else {
// Contact was removed from "server-list", notify it
// Wasnt we already been notified about this contact? And was this real friend?
- if (!getDword(hContact, FACEBOOK_KEY_DELETED, 0)
- && getByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, 0) == CONTACT_FRIEND)
- {
-
+ if (!getDword(hContact, FACEBOOK_KEY_DELETED, 0) && getByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, 0) == CONTACT_FRIEND) {
setDword(hContact, FACEBOOK_KEY_DELETED, ::time(NULL));
setByte(hContact, FACEBOOK_KEY_CONTACT_TYPE, CONTACT_NONE);
@@ -245,10 +242,14 @@ void FacebookProto::ProcessFriendList(void* data) // Check remaining contacts in map and add them to contact list
for (std::map< std::string, facebook_user* >::iterator iter = friends.begin(); iter != friends.end(); ++iter) {
facebook_user *fbu = iter->second;
-
- HANDLE hContact = AddToContactList(fbu, CONTACT_FRIEND, true); // This contact is surely new ...are you sure?
+
+ if (!fbu->deleted)
+ HANDLE hContact = AddToContactList(fbu, CONTACT_FRIEND/*, true*/); // This contact is surely new ...am I sure? ...I'm not, so "true" is commented now
+
delete fbu;
}
+
+ friends.clear();
LOG("***** Friend list processed");
|