summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/json.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-06-14 17:31:19 +0000
committerRobert Pösel <robyer@seznam.cz>2014-06-14 17:31:19 +0000
commitc3a49bd95dce1276b4b02e0c236146f2184e31cc (patch)
treee8e3a4d5e8477b60df88127e738611e9e17990a6 /protocols/FacebookRM/src/json.cpp
parent3b84c05daa208192d55d74c0f37d2bfabfa5a3b1 (diff)
Facebook, Omegle: adapt for new MS_MSG_SETSTATUSTEXT
git-svn-id: http://svn.miranda-ng.org/main/trunk@9480 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/FacebookRM/src/json.cpp')
-rw-r--r--protocols/FacebookRM/src/json.cpp33
1 files changed, 21 insertions, 12 deletions
diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp
index fa021936d2..59c44a65c8 100644
--- a/protocols/FacebookRM/src/json.cpp
+++ b/protocols/FacebookRM/src/json.cpp
@@ -448,19 +448,24 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa
ptrT readers(mir_utf8decodeT(chatroom->second.message_readers.c_str()));
- TCHAR tstr[200];
- mir_sntprintf(tstr, SIZEOF(tstr), TranslateT("Message read: %s by %s"), ttime, readers);
+ StatusTextData st = { 0 };
+ st.cbSize = sizeof(st);
+ st.hIcon = Skin_GetIconByHandle(GetIconHandle("read"));
- CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, (LPARAM)tstr);
+ mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("Message read: %s by %s"), ttime, readers);
+
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, (LPARAM)&st);
}
}
} else { // classic contact
MCONTACT hContact = proto->ContactIDToHContact(json_as_pstring(reader));
if (hContact) {
- TCHAR tstr[100];
- mir_sntprintf(tstr, SIZEOF(tstr), TranslateT("Message read: %s"), ttime);
+ StatusTextData st = { 0 };
+ st.cbSize = sizeof(st);
+ mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("Message read: %s"), ttime);
- CallService(MS_MSG_SETSTATUSTEXT, hContact, (LPARAM)tstr);
+ st.hIcon = Skin_GetIconByHandle(GetIconHandle("read"));
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st);
}
}
} else if (t == "deliver") {
@@ -607,15 +612,19 @@ int facebook_json_parser::parse_messages(void* data, std::vector< facebook_messa
MCONTACT hChatContact = proto->ChatIDToHContact(tid);
ptrT name(mir_utf8decodeT(participant->second.c_str()));
- TCHAR tstr[200];
+ if (json_as_int(st_) == 1) {
+ StatusTextData st = { 0 };
+ st.cbSize = sizeof(st);
+
+ mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("%s is typing a message..."), name);
- if (json_as_int(st_) == 1)
- mir_sntprintf(tstr, SIZEOF(tstr), TranslateT("%s is typing a message..."), name);
- else
- mir_sntprintf(tstr, SIZEOF(tstr), _T(""));
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, (LPARAM)&st);
+ }
+ else {
+ CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, NULL);
+ }
// TODO: support proper MS_PROTO_CONTACTISTYPING service for chatrooms (when it will be implemented)
- CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, (LPARAM)tstr);
}
}
} else if (t == "privacy_changed") {