From 9e178548c23cac22c5e39c73340508a46c4f4a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sun, 25 May 2014 17:26:45 +0000 Subject: Facebook: Possible fix to not create duplicit contacts git-svn-id: http://svn.miranda-ng.org/main/trunk@9308 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/process.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'protocols/FacebookRM') diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 7b7673d2c7..26d7829b0f 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -77,13 +77,12 @@ void FacebookProto::ProcessBuddyList(void*) if (!fbu->deleted) { - MCONTACT hContact = fbu->handle; - if (!hContact) - hContact = AddToContactList(fbu, CONTACT_FRIEND); + if (!fbu->handle) // just been added + fbu->handle = AddToContactList(fbu, CONTACT_FRIEND); - ptrT client( getTStringA(hContact, "MirVer")); + ptrT client( getTStringA(fbu->handle, "MirVer")); if (!client || _tcscmp(client, fbu->getMirVer())) - setTString(hContact, "MirVer", fbu->getMirVer()); + setTString(fbu->handle, "MirVer", fbu->getMirVer()); if (getDword(fbu->handle, "IdleTS", 0) != fbu->last_active) { if ((fbu->idle || fbu->status_id == ID_STATUS_OFFLINE) && fbu->last_active > 0) @@ -126,7 +125,7 @@ void FacebookProto::ProcessBuddyList(void*) if (getDword(fbu->handle, FACEBOOK_KEY_DELETED, 0)) { delSetting(fbu->handle, FACEBOOK_KEY_DELETED); - std::string url = FACEBOOK_URL_PROFILE + fbu->user_id; + std::string url = FACEBOOK_URL_PROFILE + fbu->user_id; ptrT szTitle( mir_utf8decodeT(fbu->real_name.c_str())); NotifyEvent(szTitle, TranslateT("Contact is back on server-list."), fbu->handle, FACEBOOK_EVENT_OTHER, &url); @@ -818,7 +817,7 @@ void FacebookProto::ProcessFeeds(void* data) // Strip "Translate" link pos2 = post_message.find("role=\"button\">"); if (pos2 != std::string::npos) { - post_message = post_message.substr(0, pos2 + 14); + post_message = post_message.substr(0, pos2 + 14); } post_message = premsg + post_message; -- cgit v1.2.3