diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-25 18:09:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-25 18:09:42 +0000 |
commit | 99bea7a69e782c02d371f94a2988d49d0825fd7e (patch) | |
tree | 17331d8d614c1fe1751a351030a790bbfa5eae29 /protocols/FacebookRM/src/contacts.cpp | |
parent | fae17e42b5d32ff133426893ca115310d499ab64 (diff) |
FB json parsing rewritten for new headers
git-svn-id: http://svn.miranda-ng.org/main/trunk@13832 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/contacts.cpp')
-rw-r--r-- | protocols/FacebookRM/src/contacts.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index 71f9b5b36e..e94b84f6a7 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -75,7 +75,7 @@ bool FacebookProto::IsMyContact(MCONTACT hContact, bool include_chat) return false; } -MCONTACT FacebookProto::ChatIDToHContact(const std::tstring &chat_id) +MCONTACT FacebookProto::ChatIDToHContact(const std::string &chat_id) { if (chat_id.empty()) { debugLogA("!!! Calling ChatIDToContactID() with empty chat_id"); @@ -83,7 +83,7 @@ MCONTACT FacebookProto::ChatIDToHContact(const std::tstring &chat_id) } // First check cache - std::map<std::tstring, MCONTACT>::iterator it = facy.chat_id_to_hcontact.find(chat_id); + auto it = facy.chat_id_to_hcontact.find(chat_id); if (it != facy.chat_id_to_hcontact.end()) { // Check if contact is still valid if (CallService(MS_DB_CONTACT_IS, (WPARAM)it->second, 0) == 1) @@ -97,8 +97,8 @@ MCONTACT FacebookProto::ChatIDToHContact(const std::tstring &chat_id) if (!IsMyContact(hContact, true)) continue; - ptrT id(getTStringA(hContact, "ChatRoomID")); - if (id && !mir_tstrcmp(id, chat_id.c_str())) { + ptrA id(getStringA(hContact, "ChatRoomID")); + if (id && !mir_strcmp(id, chat_id.c_str())) { facy.chat_id_to_hcontact.insert(std::make_pair(chat_id, hContact)); return hContact; } @@ -269,7 +269,7 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc) data += "&fb_dtsg=" + facy.dtsg_; data += "&__a=1&__dyn=&__req=&ttstamp=" + facy.ttstamp(); - std::string thread_id = utils::url::encode(std::string(_T2A(fbc->thread_id.c_str()))); + std::string thread_id = utils::url::encode(fbc->thread_id); // request info about thread data += "&threads[thread_ids][0]=" + thread_id; @@ -319,7 +319,7 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc) // If there are no participants to create a name from, use just thread_id if (fbc->chat_name.empty()) - fbc->chat_name = fbc->thread_id; // TODO: is this needed? Isn't it showed automatically as id if there is no name? + fbc->chat_name = std::tstring(_A2T(fbc->thread_id.c_str())); // TODO: is this needed? Isn't it showed automatically as id if there is no name? } //ReceiveMessages(messages, true); // don't let it fall into infinite cycle, solve it somehow... @@ -668,9 +668,9 @@ int FacebookProto::OnContactDeleted(WPARAM wParam, LPARAM) facy.thread_id_to_user_id.erase(std::string(tid)); if (isChatRoom(hContact)) { - ptrT chat_id(getTStringA(hContact, "ChatRoomID")); + ptrA chat_id(getStringA(hContact, "ChatRoomID")); if (chat_id) - facy.chat_id_to_hcontact.erase(std::tstring(chat_id)); + facy.chat_id_to_hcontact.erase(std::string(chat_id)); } // Cancel friendship (with confirmation) |