diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-05-16 14:55:16 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-05-16 14:55:16 +0000 |
commit | eec9743cc90715180fec9b184ae343dc5083e780 (patch) | |
tree | ac804835491fdd565596864347afe9255b8a97ee /protocols/FacebookRM/src/contacts.cpp | |
parent | 016efa8dd058f9af5a57a33a6541736ce710a5a7 (diff) |
Facebook:
- fixed getting login error message
- cleanup of close_chat method and related things
- added Poke support (contact menu)
- support for sending "Seen" info (add in db "MarkRead" (byte) with value "1")
- support for language specific fb errors (add in db "Locale" (string) with locale value ("en_US", "cs_CZ" etc.)
- mir_a2t_cp(..., CP_UTF8) changed to mir_utf8decodeT(...)
git-svn-id: http://svn.miranda-ng.org/main/trunk@4677 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/contacts.cpp')
-rw-r--r-- | protocols/FacebookRM/src/contacts.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index 0fd4a2b1e9..d1eaad91cd 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -321,6 +321,42 @@ void FacebookProto::CancelFriendsRequest(void *data) facy.handle_error("CancelFriendsRequest");
}
+void FacebookProto::SendPokeWorker(void *p)
+{
+ facy.handle_entry("SendPokeWorker");
+
+ if (p == NULL)
+ return;
+
+ std::string id = (*(std::string*)p);
+ delete p;
+
+ std::string data = "uid=" + id;
+ data += "&phstamp=0&pokeback=0&ask_for_confirm=0";
+ data += "&fb_dtsg=" + facy.dtsg_;
+ data += "&__user=" + facy.self_.user_id;
+
+ // Send poke
+ http::response resp = facy.flap(FACEBOOK_REQUEST_POKE, &data);
+
+ // Process result data
+ facy.validate_response(&resp);
+
+ if (resp.data.find("\"payload\":null", 0) != std::string::npos) {
+
+ std::string 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\":\"", "\"}"))));
+
+ TCHAR* tmessage = mir_utf8decodeT(message.c_str());
+ NotifyEvent(m_tszUserName, tmessage, NULL, FACEBOOK_EVENT_OTHER, NULL);
+ mir_free(tmessage);
+ }
+
+ facy.handle_success("SendPokeWorker");
+}
+
HANDLE FacebookProto::GetAwayMsg(HANDLE hContact)
{
|