summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2015-08-13 16:02:12 +0000
committerRobert Pösel <robyer@seznam.cz>2015-08-13 16:02:12 +0000
commit5c84f735bc4f40d3f2f645d003ef9a08576878d8 (patch)
tree5bbad675eace2e3a7eeea4fd711adefc17e2b05e /protocols
parentde4e8cb32266b1e7e62f3373997ed2e152a8d276 (diff)
Steam: Support for "Read status message" dialog
Revert r14928 and implement correctly GetAwayMsg method. If contact has no status message, it shows the xstatus message. git-svn-id: http://svn.miranda-ng.org/main/trunk@14940 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Steam/src/steam_proto.cpp33
-rw-r--r--protocols/Steam/src/steam_proto.h3
2 files changed, 33 insertions, 3 deletions
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp
index c8e9f36dd5..efe610c209 100644
--- a/protocols/Steam/src/steam_proto.cpp
+++ b/protocols/Steam/src/steam_proto.cpp
@@ -203,11 +203,9 @@ DWORD_PTR CSteamProto:: GetCaps(int type, MCONTACT)
switch(type)
{
case PFLAGNUM_1:
- return PF1_IM | PF1_BASICSEARCH | PF1_SEARCHBYNAME | PF1_AUTHREQ | PF1_SERVERCLIST | PF1_ADDSEARCHRES;
+ return PF1_IM | PF1_BASICSEARCH | PF1_SEARCHBYNAME | PF1_AUTHREQ | PF1_SERVERCLIST | PF1_ADDSEARCHRES | PF1_MODEMSGRECV;
case PFLAGNUM_2:
return PF2_ONLINE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_HEAVYDND | PF2_OUTTOLUNCH | PF2_FREECHAT;
- case PFLAGNUM_3:
- return PF2_SHORTAWAY | PF2_LONGAWAY | PF2_HEAVYDND | PF2_OUTTOLUNCH | PF2_FREECHAT;
case PFLAGNUM_4:
return PF4_AVATARS | PF4_NOCUSTOMAUTH | PF4_NOAUTHDENYREASON | PF4_FORCEAUTH | PF4_FORCEADDED | PF4_SUPPORTIDLE | PF4_SUPPORTTYPING;// | PF4_IMSENDOFFLINE;
case PFLAGNUM_5:
@@ -340,6 +338,35 @@ int CSteamProto::SetStatus(int new_status)
return 0;
}
+void __cdecl CSteamProto::GetAwayMsgThread(void *arg)
+{
+ // Maybe not needed, but better to be sure that this won't happen faster than core handling return value of GetAwayMsg()
+ Sleep(50);
+
+ MCONTACT hContact = (MCONTACT)arg;
+ CMString message(db_get_tsa(hContact, "CList", "StatusMsg"));
+
+ // if contact has no status message, get xstatus message
+ if (message.IsEmpty())
+ {
+ ptrT xStatusName(getTStringA(hContact, "XStatusName"));
+ ptrT xStatusMsg(getTStringA(hContact, "XStatusMsg"));
+
+ if (xStatusName)
+ message.AppendFormat(_T("%s: %s"), xStatusName, xStatusMsg);
+ else
+ message.Append(xStatusMsg);
+ }
+
+ ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)message.c_str());
+}
+
+HANDLE __cdecl CSteamProto::GetAwayMsg(MCONTACT hContact)
+{
+ ForkThread(&CSteamProto::GetAwayMsgThread, (void*)hContact);
+ return (HANDLE)1;
+}
+
int __cdecl CSteamProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
{
switch (eventType)
diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h
index 12e1cee5a2..2b9ae01492 100644
--- a/protocols/Steam/src/steam_proto.h
+++ b/protocols/Steam/src/steam_proto.h
@@ -192,6 +192,9 @@ protected:
HICON GetXStatusIcon(int status, UINT flags);
int GetContactXStatus(MCONTACT hContact);
+ HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
+ void __cdecl GetAwayMsgThread(void *arg);
+
// events
int OnModulesLoaded(WPARAM, LPARAM);
int OnPreShutdown(WPARAM, LPARAM);