diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-09-25 22:29:00 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-09-25 22:29:00 +0000 |
commit | 990a136d57aa0112f69f82f62d4205b4f22cc594 (patch) | |
tree | 4c7de90904e80f7a9eef2154db0f1cdb1f653c0f | |
parent | 341203e3dfc3b7ac0f4db5ebef80de3fb2265ddb (diff) |
Facebook: fixed Poke
git-svn-id: http://svn.miranda-ng.org/main/trunk@6235 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/FacebookRM/src/communication.cpp | 2 | ||||
-rw-r--r-- | protocols/FacebookRM/src/contacts.cpp | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index f7776d3c90..27ddd33c68 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -522,7 +522,7 @@ std::string facebook_client::choose_action(RequestType request_type, std::string return "/ajax/chat/privacy/visibility.php?__a=1";
case REQUEST_POKE:
- return "/ajax/poke_dialog.php?__a=1";
+ return "/pokes/dialog/?__a=1";
case REQUEST_ASYNC:
{
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);
|