summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/contacts.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2013-09-25 22:29:00 +0000
committerRobert Pösel <robyer@seznam.cz>2013-09-25 22:29:00 +0000
commit990a136d57aa0112f69f82f62d4205b4f22cc594 (patch)
tree4c7de90904e80f7a9eef2154db0f1cdb1f653c0f /protocols/FacebookRM/src/contacts.cpp
parent341203e3dfc3b7ac0f4db5ebef80de3fb2265ddb (diff)
Facebook: fixed Poke
git-svn-id: http://svn.miranda-ng.org/main/trunk@6235 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/contacts.cpp')
-rw-r--r--protocols/FacebookRM/src/contacts.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp
index dddc83e4ff..b4b2a28603 100644
--- a/protocols/FacebookRM/src/contacts.cpp
+++ b/protocols/FacebookRM/src/contacts.cpp
@@ -299,8 +299,8 @@ void FacebookProto::SendPokeWorker(void *p)
std::string id = (*(std::string*)p);
delete p;
- std::string data = "uid=" + id;
- data += "&phstamp=0&pokeback=0&ask_for_confirm=0";
+ std::string data = "poke_target=" + id;
+ data += "&do_confirm=0&phstamp=0";
data += "&fb_dtsg=" + (facy.dtsg_.length() ? facy.dtsg_ : "0");
data += "&__user=" + facy.self_.user_id;
@@ -311,11 +311,14 @@ void FacebookProto::SendPokeWorker(void *p)
facy.validate_response(&resp);
if (resp.data.find("\"payload\":null", 0) != std::string::npos) {
+ std::string message = utils::text::source_get_value(&resp.data, 3, "__html\":\"", "\\/button>", "\"}");
- std::string message = utils::text::special_expressions_decode(
+ if (message.empty()) // message has different format, try to get whole message
+ message = utils::text::source_get_value(&resp.data, 2, "__html\":\"", "\"}");
+
+ message = utils::text::special_expressions_decode(
utils::text::remove_html(
- utils::text::slashu_to_utf8(
- utils::text::source_get_value(&resp.data, 3, "\"body\":", "__html\":\"", "\"}"))));
+ utils::text::slashu_to_utf8(message)));
ptrT tmessage( mir_utf8decodeT(message.c_str()));
NotifyEvent(m_tszUserName, tmessage, NULL, FACEBOOK_EVENT_OTHER);