From f114071bca3a336930a5c04ec1b1518214e31b4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Tue, 2 Dec 2014 18:24:02 +0000 Subject: Steam: Raise message length limit; fix encoding of sent messages; version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@11220 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Steam/src/steam_proto.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'protocols/Steam/src/steam_proto.cpp') diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 850cf7e5f0..e4668ebe38 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -196,7 +196,7 @@ DWORD_PTR __cdecl CSteamProto:: GetCaps(int type, MCONTACT hContact) case PFLAGNUM_2: return PF2_ONLINE | PF2_SHORTAWAY | PF2_HEAVYDND | PF2_OUTTOLUNCH; case PFLAGNUM_4: - return PF4_AVATARS | PF4_NOCUSTOMAUTH | PF4_NOAUTHDENYREASON | PF4_FORCEAUTH | PF4_FORCEADDED;// | PF4_IMSENDOFFLINE | PF4_SUPPORTTYPING; + return PF4_AVATARS | PF4_NOCUSTOMAUTH | PF4_NOAUTHDENYREASON | PF4_FORCEAUTH | PF4_FORCEADDED | PF4_IMSENDUTF;// | PF4_IMSENDOFFLINE | PF4_SUPPORTTYPING; case PFLAGNUM_5: return PF2_SHORTAWAY | PF2_HEAVYDND | PF2_OUTTOLUNCH; case PFLAG_UNIQUEIDTEXT: @@ -204,7 +204,7 @@ DWORD_PTR __cdecl CSteamProto:: GetCaps(int type, MCONTACT hContact) case PFLAG_UNIQUEIDSETTING: return (DWORD_PTR)"SteamID"; case PFLAG_MAXLENOFMESSAGE: - return 180; + return 200000; // this is guessed limit, in reality it is probably bigger default: return 0; } @@ -291,6 +291,9 @@ int __cdecl CSteamProto::SendMsg(MCONTACT hContact, int flags, const char *msg) { UINT hMessage = InterlockedIncrement(&hMessageProcess); + if (flags & PREF_UNICODE) + msg = mir_utf8encode(msg); // FIXME: Token from FacebookRM. Is it needed? Usually we get PREF_UTF8 flag instead. And does it cause memory leak? + SendMessageParam *param = (SendMessageParam*)mir_calloc(sizeof(SendMessageParam)); param->hContact = hContact; param->hMessage = (HANDLE)hMessage; @@ -301,7 +304,7 @@ int __cdecl CSteamProto::SendMsg(MCONTACT hContact, int flags, const char *msg) ptrA steamId(getStringA(hContact, "SteamID")); PushRequest( - new SteamWebApi::SendMessageRequest(token, umqid, steamId, ptrA(mir_utf8encode(msg))), + new SteamWebApi::SendMessageRequest(token, umqid, steamId, msg), &CSteamProto::OnMessageSent, param); -- cgit v1.2.3