diff options
author | Robert Pösel <robyer@seznam.cz> | 2015-04-29 19:34:50 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2015-04-29 19:34:50 +0000 |
commit | c305dc7c4cb20072a003c349b8eec9f0e835b3c9 (patch) | |
tree | 9ec2ddb108bea7b07c9ae8b1cde6dfc8d4de580a /protocols/FacebookRM/src/chat.cpp | |
parent | 36613a6ce15d9614e0883db8303dd2504c70ed4f (diff) |
Facebook: Some fixes for sending messages and fix crashes introduced in commit r13214; version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@13252 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/chat.cpp')
-rw-r--r-- | protocols/FacebookRM/src/chat.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index cae422e414..6db84be8b9 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -275,12 +275,13 @@ INT_PTR FacebookProto::OnJoinChat(WPARAM hContact, LPARAM) ptrT idT(getTStringA(hContact, "ChatRoomID")); ptrT nameT(getTStringA(hContact, "Nick")); + ptrT threadIdT(getTStringA(hContact, FACEBOOK_KEY_TID)); - if (!idT || !nameT) + if (!idT || !nameT || !threadIdT) return 0; facebook_chatroom *fbc; - std::tstring tthread_id = ptrT(getTStringA(hContact, FACEBOOK_KEY_TID)); + std::tstring tthread_id = threadIdT; std::map<std::tstring, facebook_chatroom*>::iterator it = facy.chat_rooms.find(tthread_id); if (it != facy.chat_rooms.end()) { @@ -330,9 +331,11 @@ INT_PTR FacebookProto::OnLeaveChat(WPARAM wParam, LPARAM) facy.clear_chatrooms(); } else if (!IsSpecialChatRoom(wParam)) { - std::tstring tthread_id = ptrT(getTStringA(wParam, FACEBOOK_KEY_TID)); + ptrT threadIdT(getTStringA(wParam, FACEBOOK_KEY_TID)); + if (!threadIdT) + return 0; - std::map<std::tstring, facebook_chatroom*>::iterator it = facy.chat_rooms.find(tthread_id); + std::map<std::tstring, facebook_chatroom*>::iterator it = facy.chat_rooms.find(std::tstring(threadIdT)); if (it != facy.chat_rooms.end()) { delete it->second; facy.chat_rooms.erase(it); |