diff options
Diffstat (limited to 'protocols/FacebookRM')
-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);
|