diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-06-14 17:31:19 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-06-14 17:31:19 +0000 |
commit | c3a49bd95dce1276b4b02e0c236146f2184e31cc (patch) | |
tree | e8e3a4d5e8477b60df88127e738611e9e17990a6 /protocols/FacebookRM/src | |
parent | 3b84c05daa208192d55d74c0f37d2bfabfa5a3b1 (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')
-rw-r--r-- | protocols/FacebookRM/src/json.cpp | 33 | ||||
-rw-r--r-- | protocols/FacebookRM/src/resource.h | 3 | ||||
-rw-r--r-- | protocols/FacebookRM/src/theme.cpp | 1 |
3 files changed, 24 insertions, 13 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") {
diff --git a/protocols/FacebookRM/src/resource.h b/protocols/FacebookRM/src/resource.h index b85c308376..13646c3dfe 100644 --- a/protocols/FacebookRM/src/resource.h +++ b/protocols/FacebookRM/src/resource.h @@ -15,6 +15,7 @@ #define IDI_NEWSFEED 129
#define IDI_FRIENDS 130
#define IDI_CONVERSATION 131
+#define IDI_READ 132
#define IDC_UN 1001
#define IDC_PW 1002
#define IDC_NEWACCOUNTLINK 1003
@@ -57,7 +58,7 @@ //
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 132
+#define _APS_NEXT_RESOURCE_VALUE 133
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1211
#define _APS_NEXT_SYMED_VALUE 132
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index e659319911..88b9256e81 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -33,6 +33,7 @@ static IconItem icons[] = { LPGEN("Newsfeed"), "newsfeed", IDI_NEWSFEED },
{ LPGEN("Friendship details"), "friendship", IDI_FRIENDS },
{ LPGEN("Conversation"), "conversation", IDI_CONVERSATION },
+ { LPGEN("Message read"), "read", IDI_READ },
};
// TODO: uninit
|