From c305dc7c4cb20072a003c349b8eec9f0e835b3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Wed, 29 Apr 2015 19:34:50 +0000 Subject: 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 --- protocols/FacebookRM/src/messages.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'protocols/FacebookRM/src/messages.cpp') diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp index 0fc60765cd..401c8d1c92 100644 --- a/protocols/FacebookRM/src/messages.cpp +++ b/protocols/FacebookRM/src/messages.cpp @@ -84,11 +84,11 @@ void FacebookProto::SendChatMsgWorker(void *p) if (hContact) { ptrA tid_(getStringA(hContact, FACEBOOK_KEY_TID)); std::string tid; - if (tid_ != NULL) { + if (tid_ != NULL && mir_strcmp(tid_, "null")) { tid = tid_; } else { - std::string post_data = "threads[group_ids][0]=" + utils::url::encode(data->chat_id); + std::string post_data = "threads[thread_ids][0]=" + utils::url::encode(data->chat_id); post_data += "&fb_dtsg=" + facy.dtsg_; post_data += "&__user=" + facy.self_.user_id; post_data += "&phstamp=" + facy.phstamp(post_data); @@ -96,7 +96,8 @@ void FacebookProto::SendChatMsgWorker(void *p) http::response resp = facy.flap(REQUEST_THREAD_INFO, &post_data); tid = utils::text::source_get_value(&resp.data, 2, "\"thread_id\":\"", "\""); - setString(hContact, FACEBOOK_KEY_TID, tid.c_str()); + if (!tid.empty() && tid.compare("null")) + setString(hContact, FACEBOOK_KEY_TID, tid.c_str()); debugLogA(" Got thread info: %s = %s", data->chat_id.c_str(), tid.c_str()); } -- cgit v1.2.3