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/json.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/json.cpp')
-rw-r--r-- | protocols/FacebookRM/src/json.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 34660bc1d6..b07f6244b2 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -303,6 +303,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa const Object& messageContent = objMember["msg"];
const String& text = messageContent["text"];
+ const String& message_id = messageContent["messageId"];
//"tab_type":"friend", objMember["tab_type"]
const Number& time_sent = messageContent["time"];
@@ -317,10 +318,10 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa } else if (last_msg != text.Value()) {
last_msg = text.Value();
facebook_message* message = new facebook_message();
- message->message_text = utils::text::special_expressions_decode(
- utils::text::slashu_to_utf8(text.Value()));
+ message->message_text = utils::text::special_expressions_decode(utils::text::slashu_to_utf8(text.Value()));
message->time = utils::time::fix_timestamp(time_sent.Value());
message->user_id = was_id;
+ message->message_id = message_id;
messages->push_back(message);
} else {
@@ -359,6 +360,7 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa const String& sender_name = messageContent["sender_name"];
const String& text = messageContent["body"];
const String& tid = messageContent["tid"];
+ const String& mid = messageContent["mid"];
const Number& time_sent = messageContent["timestamp"];
char was_id[32];
@@ -384,7 +386,8 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa message->time = utils::time::fix_timestamp(time_sent.Value());
message->user_id = was_id; // TODO: Check if we have contact with this ID in friendlist and otherwise do something different?
-
+ message->message_id = mid.Value();
+
messages->push_back(message);
} else {
std::string msg = "????? Got duplicit inbox message?\n";
@@ -430,9 +433,9 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa proto->Log(" Got multichat message");
- TCHAR* szTitle = mir_a2t_cp(title.c_str(), CP_UTF8);
- TCHAR* szText = mir_a2t_cp(popup_text.c_str(), CP_UTF8);
- TCHAR* szUrl = mir_a2t_cp(url.c_str(), CP_UTF8);
+ TCHAR* szTitle = mir_utf8decodeT(title.c_str());
+ TCHAR* szText = mir_utf8decodeT(popup_text.c_str());
+ TCHAR* szUrl = mir_utf8decodeT(url.c_str());
proto->NotifyEvent(szTitle,szText,NULL,FACEBOOK_EVENT_OTHER, szUrl);
mir_free(szTitle);
mir_free(szText);
|