diff options
Diffstat (limited to 'protocols/FacebookRM')
-rw-r--r-- | protocols/FacebookRM/facebook_10.vcxproj | 1 | ||||
-rw-r--r-- | protocols/FacebookRM/facebook_10.vcxproj.filters | 3 | ||||
-rw-r--r-- | protocols/FacebookRM/facebook_12.vcxproj | 1 | ||||
-rw-r--r-- | protocols/FacebookRM/facebook_12.vcxproj.filters | 3 | ||||
-rw-r--r-- | protocols/FacebookRM/res/facebook.rc | 1 | ||||
-rw-r--r-- | protocols/FacebookRM/res/read.ico | bin | 0 -> 1150 bytes | |||
-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 |
9 files changed, 33 insertions, 13 deletions
diff --git a/protocols/FacebookRM/facebook_10.vcxproj b/protocols/FacebookRM/facebook_10.vcxproj index a07c0e27be..3256202fad 100644 --- a/protocols/FacebookRM/facebook_10.vcxproj +++ b/protocols/FacebookRM/facebook_10.vcxproj @@ -222,6 +222,7 @@ <Image Include="res\notification.ico" />
<Image Include="res\poke.ico" />
<Image Include="res\conversation.ico" />
+ <Image Include="res\read.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/protocols/FacebookRM/facebook_10.vcxproj.filters b/protocols/FacebookRM/facebook_10.vcxproj.filters index f0c51221bd..aceb1bb5f1 100644 --- a/protocols/FacebookRM/facebook_10.vcxproj.filters +++ b/protocols/FacebookRM/facebook_10.vcxproj.filters @@ -144,5 +144,8 @@ <Image Include="res\conversation.ico">
<Filter>Resource Files\Icons</Filter>
</Image>
+ <Image Include="res\read.ico">
+ <Filter>Resource Files\Icons</Filter>
+ </Image>
</ItemGroup>
</Project>
\ No newline at end of file diff --git a/protocols/FacebookRM/facebook_12.vcxproj b/protocols/FacebookRM/facebook_12.vcxproj index a5bfc87310..fab3f3f641 100644 --- a/protocols/FacebookRM/facebook_12.vcxproj +++ b/protocols/FacebookRM/facebook_12.vcxproj @@ -225,6 +225,7 @@ <Image Include="res\notification.ico" />
<Image Include="res\poke.ico" />
<Image Include="res\conversation.ico" />
+ <Image Include="res\read.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/protocols/FacebookRM/facebook_12.vcxproj.filters b/protocols/FacebookRM/facebook_12.vcxproj.filters index f0c51221bd..235840f852 100644 --- a/protocols/FacebookRM/facebook_12.vcxproj.filters +++ b/protocols/FacebookRM/facebook_12.vcxproj.filters @@ -144,5 +144,8 @@ <Image Include="res\conversation.ico">
<Filter>Resource Files\Icons</Filter>
</Image>
+ <Image Include="res\read.ico">
+ <Filter>Resource Files\Icons</Filter>
+ </Image>
</ItemGroup>
</Project>
\ No newline at end of file diff --git a/protocols/FacebookRM/res/facebook.rc b/protocols/FacebookRM/res/facebook.rc index 8fa89e9f5d..7c0961e2d3 100644 --- a/protocols/FacebookRM/res/facebook.rc +++ b/protocols/FacebookRM/res/facebook.rc @@ -58,6 +58,7 @@ IDI_NOTIFICATION ICON "notification.ico" IDI_NEWSFEED ICON "feeds.ico"
IDI_FRIENDS ICON "friends.ico"
IDI_CONVERSATION ICON "conversation.ico"
+IDI_READ ICON "read.ico"
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/protocols/FacebookRM/res/read.ico b/protocols/FacebookRM/res/read.ico Binary files differnew file mode 100644 index 0000000000..91e9b72370 --- /dev/null +++ b/protocols/FacebookRM/res/read.ico 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
|