summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/process.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2016-12-07 23:41:03 +0100
committerRobert Pösel <robyer@seznam.cz>2016-12-07 23:41:03 +0100
commit83f8ea45f94d1d176c0fb3ca37bbdf8358196908 (patch)
treec153b39822fd683f8708809c75b35a15e60c1ffc /protocols/FacebookRM/src/process.cpp
parentf4375028eae5442720c07f59a74f5739c9dcc865 (diff)
Facebook: Fix not loading unread messages; version bump
This also fixes not loading messages at contact window open (if enabled). And cleans up part of obsolete code.
Diffstat (limited to 'protocols/FacebookRM/src/process.cpp')
-rw-r--r--protocols/FacebookRM/src/process.cpp63
1 files changed, 2 insertions, 61 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index 52e3988bd6..cde67b04dd 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -249,41 +249,11 @@ void FacebookProto::ProcessUnreadMessage(void *pParam)
if (resp.code == HTTP_CODE_OK) {
try {
std::vector<facebook_message> messages;
- std::map<std::string, facebook_chatroom*> chatrooms;
facebook_json_parser* p = new facebook_json_parser(this);
- p->parse_thread_messages(&resp.data, &messages, &chatrooms, false);
+ p->parse_thread_messages(&resp.data, &messages, false);
delete p;
- for (std::map<std::string, facebook_chatroom*>::iterator it = chatrooms.begin(); it != chatrooms.end();) {
-
- // TODO: refactor this too!
- // TODO: have all chatrooms in facy, in memory, and then handle them as needed... somehow think about it...
- /* facebook_chatroom *room = it->second;
- MCONTACT hChatContact = NULL;
- ptrA users(GetChatUsers(room->thread_id.c_str()));
- if (users == NULL) {
- AddChat(room->thread_id.c_str(), room->chat_name.c_str());
- hChatContact = ChatIDToHContact(room->thread_id);
- // Set thread id (TID) for later
- setWString(hChatContact, FACEBOOK_KEY_TID, room->thread_id.c_str());
-
- for (std::map<std::string, std::string>::iterator jt = room->participants.begin(); jt != room->participants.end(); ) {
- AddChatContact(room->thread_id.c_str(), jt->first.c_str(), jt->second.c_str());
- ++jt;
- }
- }
-
- if (!hChatContact)
- hChatContact = ChatIDToHContact(room->thread_id);
-
- ForkThread(&FacebookProto::ReadMessageWorker, (void*)hChatContact);*/
-
- delete it->second;
- it = chatrooms.erase(it);
- }
- chatrooms.clear();
-
ReceiveMessages(messages, true);
debugLogA("*** Unread messages processed");
@@ -348,40 +318,11 @@ void FacebookProto::LoadLastMessages(void *pParam)
try {
std::vector<facebook_message> messages;
- std::map<std::string, facebook_chatroom*> chatrooms;
facebook_json_parser* p = new facebook_json_parser(this);
- p->parse_thread_messages(&resp.data, &messages, &chatrooms, false);
+ p->parse_thread_messages(&resp.data, &messages, false);
delete p;
- // TODO: do something with this, chat is loading somewhere else... (in receiveMessages method right now)
- /*for (std::map<std::string, facebook_chatroom*>::iterator it = chatrooms.begin(); it != chatrooms.end();) {
-
- facebook_chatroom *room = it->second;
- MCONTACT hChatContact = NULL;
- ptrA users(GetChatUsers(room->thread_id.c_str()));
- if (users == NULL) {
- AddChat(room->thread_id.c_str(), room->chat_name.c_str());
- hChatContact = ChatIDToHContact(room->thread_id);
- // Set thread id (TID) for later
- setWString(hChatContact, FACEBOOK_KEY_TID, room->thread_id.c_str());
-
- for (std::map<std::string, std::string>::iterator jt = room->participants.begin(); jt != room->participants.end();) {
- AddChatContact(room->thread_id.c_str(), jt->first.c_str(), jt->second.c_str());
- ++jt;
- }
- }
-
- if (!hChatContact)
- hChatContact = ChatIDToHContact(room->thread_id);
-
- ForkThread(&FacebookProto::ReadMessageWorker, (void*)hChatContact);
-
- delete it->second;
- it = chatrooms.erase(it);
- }
- chatrooms.clear();*/
-
ReceiveMessages(messages, true);
debugLogA("*** Thread messages processed");