diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-11-26 08:44:18 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-11-26 08:44:18 +0000 |
commit | c1d2d5892eda3070975bbb82ac4f2e35d7bc139e (patch) | |
tree | 5902759b93eed462f1b8815a19b9f9e35d674046 /protocols/FacebookRM/src/process.cpp | |
parent | f5e38aaba573fa720894433ae746b3a7a741356e (diff) |
Facebook: Various optimizations and cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@11083 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/process.cpp')
-rw-r--r-- | protocols/FacebookRM/src/process.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp index 93692db613..bfb5904701 100644 --- a/protocols/FacebookRM/src/process.cpp +++ b/protocols/FacebookRM/src/process.cpp @@ -710,7 +710,7 @@ void FacebookProto::ReceiveMessages(std::vector<facebook_message*> messages, boo facy.chat_rooms.insert(std::make_pair(tthread_id, fbc)); } - MCONTACT hChatContact; + MCONTACT hChatContact = NULL; // RM TODO: better use check if chatroom exists/is in db/is online... no? // like: if (ChatIDToHContact(tthread_id) == NULL) { ptrA users(GetChatUsers(tthread_id.c_str())); @@ -878,11 +878,12 @@ void FacebookProto::ShowNotifications() { // Show popups for unseen notifications and/or write them to chatroom for (std::map<std::string, facebook_notification*>::iterator it = facy.notifications.begin(); it != facy.notifications.end(); ++it) { - if (it->second != NULL && !it->second->seen) { - debugLogA(" Showing popup for notification: %s", it->second->text.c_str()); - ptrT szText(mir_utf8decodeT(it->second->text.c_str())); - it->second->hWndPopup = NotifyEvent(m_tszUserName, szText, ContactIDToHContact(it->second->user_id), FACEBOOK_EVENT_NOTIFICATION, &it->second->link, &it->second->id); - it->second->seen = true; + facebook_notification *notification = it->second; + if (notification != NULL && !notification->seen) { + debugLogA(" Showing popup for notification: %s", notification->text.c_str()); + ptrT szText(mir_utf8decodeT(notification->text.c_str())); + notification->hWndPopup = NotifyEvent(m_tszUserName, szText, ContactIDToHContact(notification->user_id), FACEBOOK_EVENT_NOTIFICATION, ¬ification->link, ¬ification->id); + notification->seen = true; } } } |