summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/contacts.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2015-02-06 10:00:00 +0000
committerRobert Pösel <robyer@seznam.cz>2015-02-06 10:00:00 +0000
commit57890ac884743d836690db5058185db1e6dea5d8 (patch)
tree937ab0cd988dddc58de40135a7c825227440e086 /protocols/FacebookRM/src/contacts.cpp
parent1d9a2d26d7b7b458d7e65a683e7ca3d7506ced8b (diff)
Facebook: Fix loading sent messages via other instances (website) to wrong contact in Miranda; Version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@12018 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/contacts.cpp')
-rw-r--r--protocols/FacebookRM/src/contacts.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp
index e36b120c4e..a1e2abcf0e 100644
--- a/protocols/FacebookRM/src/contacts.cpp
+++ b/protocols/FacebookRM/src/contacts.cpp
@@ -77,6 +77,11 @@ bool FacebookProto::IsMyContact(MCONTACT hContact, bool include_chat)
MCONTACT FacebookProto::ChatIDToHContact(const std::tstring &chat_id)
{
+ if (chat_id.empty()) {
+ debugLogA("!!! Calling ChatIDToContactID() with empty chat_id");
+ return 0;
+ }
+
// First check cache
std::map<std::tstring, MCONTACT>::iterator it = facy.chat_id_to_hcontact.find(chat_id);
if (it != facy.chat_id_to_hcontact.end()) {
@@ -104,6 +109,11 @@ MCONTACT FacebookProto::ChatIDToHContact(const std::tstring &chat_id)
MCONTACT FacebookProto::ContactIDToHContact(const std::string &user_id)
{
+ if (user_id.empty()) {
+ debugLogA("!!! Calling ContactIDToHContact() with empty user_id");
+ return 0;
+ }
+
// First check cache
std::map<std::string, MCONTACT>::iterator it = facy.user_id_to_hcontact.find(user_id);
if (it != facy.user_id_to_hcontact.end()) {
@@ -131,6 +141,11 @@ MCONTACT FacebookProto::ContactIDToHContact(const std::string &user_id)
std::string FacebookProto::ThreadIDToContactID(const std::string &thread_id)
{
+ if (thread_id.empty()) {
+ debugLogA("!!! Calling ThreadIDToContactID() with empty thread_id");
+ return "";
+ }
+
// First check cache
std::map<std::string, std::string>::iterator it = facy.thread_id_to_user_id.find(thread_id);
if (it != facy.thread_id_to_user_id.end()) {