summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2013-07-25 17:09:11 +0000
committerRobert Pösel <robyer@seznam.cz>2013-07-25 17:09:11 +0000
commit0c8684347dbae1a414176968edf72ad049151592 (patch)
tree5dac9f6900ab003f9ca40b9323fe61db1c08e5c7
parenta757184e5db3112d3de0b69eec7d39b937e396bc (diff)
Facebook: Some minor fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@5482 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/FacebookRM/src/connection.cpp4
-rw-r--r--protocols/FacebookRM/src/contacts.cpp4
-rw-r--r--protocols/FacebookRM/src/process.cpp16
3 files changed, 15 insertions, 9 deletions
diff --git a/protocols/FacebookRM/src/connection.cpp b/protocols/FacebookRM/src/connection.cpp
index 84e40254de..c241d79fe8 100644
--- a/protocols/FacebookRM/src/connection.cpp
+++ b/protocols/FacebookRM/src/connection.cpp
@@ -49,8 +49,6 @@ void FacebookProto::ChangeStatus(void*)
facy.buddies.clear();
facy.messages_ignore.clear();
- ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus);
-
OnLeaveChat(NULL, NULL);
SetAllContactStatuses(ID_STATUS_OFFLINE, true);
@@ -61,6 +59,8 @@ void FacebookProto::ChangeStatus(void*)
Netlib_CloseHandle(facy.hMsgCon);
facy.hMsgCon = NULL;
+ ProtoBroadcastAck(0, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus);
+
LOG("##### SignOff complete");
return;
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp
index 7c42c1a951..6f57f221aa 100644
--- a/protocols/FacebookRM/src/contacts.cpp
+++ b/protocols/FacebookRM/src/contacts.cpp
@@ -118,7 +118,7 @@ HANDLE FacebookProto::AddToContactList(facebook_user* fbu, ContactType type, boo
void FacebookProto::SetAllContactStatuses(int status, bool reset_client)
{
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- if ( isChatRoom(hContact))
+ if (isChatRoom(hContact))
continue;
if (reset_client) {
@@ -140,7 +140,7 @@ void FacebookProto::SetAllContactStatuses(int status, bool reset_client)
}*/
}
- if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != status)
+ if (getWord(hContact, "Status", 0) != status)
setWord(hContact, "Status", status);
}
}
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index 2541fe07f8..24b9c3b7d0 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -52,18 +52,17 @@ void FacebookProto::ProcessBuddyList(void* data)
char *status;
switch (fbu->status_id) {
case ID_STATUS_OFFLINE:
- status = "offline"; break;
+ status = "Offline"; break;
case ID_STATUS_ONLINE:
- status = "online"; break;
+ status = "Online"; break;
case ID_STATUS_ONTHEPHONE:
- on_mobile = true;
- status = "onthephone";
+ on_mobile = true;
+ status = "Phone";
if (!use_mobile_status)
fbu->status_id = ID_STATUS_OFFLINE;
break;
}
- LOG(" Now %s: %s", status, i->data->real_name.c_str());
if (!fbu->deleted)
{
@@ -124,6 +123,13 @@ void FacebookProto::ProcessBuddyList(void* data)
// Check avatar change
CheckAvatarChange(fbu->handle, fbu->image_url);
}
+
+ std::string name_log = fbu->real_name;
+ if (name_log.empty() && i->data->handle)
+ name_log = ptrA(getStringA(i->data->handle, FACEBOOK_KEY_NAME));
+ if (name_log.empty())
+ name_log = fbu->user_id;
+ LOG(" Now %s: %s", status, name_log.c_str());
}
LOG("***** Buddy list processed");