From c1d2d5892eda3070975bbb82ac4f2e35d7bc139e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Wed, 26 Nov 2014 08:44:18 +0000 Subject: Facebook: Various optimizations and cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@11083 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/process.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'protocols/FacebookRM/src/process.cpp') 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 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::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; } } } -- cgit v1.2.3