From 7d2d0d17e720b43162433410b88ff1de7f019f38 Mon Sep 17 00:00:00 2001 From: sje Date: Sun, 1 Jul 2007 16:50:43 +0000 Subject: fix 'unentitizing' formatting unentitize nicks try to fix missed packets again (not fixed yet) git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@235 4f64403b-2f21-0410-a795-97e2b3489a10 --- MySpace/proto.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'MySpace/proto.cpp') diff --git a/MySpace/proto.cpp b/MySpace/proto.cpp index 821b33e..35ace9b 100644 --- a/MySpace/proto.cpp +++ b/MySpace/proto.cpp @@ -24,7 +24,7 @@ int GetCaps(WPARAM wParam,LPARAM lParam) { ret = PF2_ONLINE | PF2_SHORTAWAY | PF2_INVISIBLE; break; case PFLAGNUM_4: - //ret = PF4_SUPPORTTYPING; + ret = PF4_SUPPORTTYPING; break; case PFLAGNUM_5: //ret = PF2_INVISIBLE; @@ -389,6 +389,24 @@ int SetAwayMsg(WPARAM wParam, LPARAM lParam) { return 0; } +int SendTyping(WPARAM wParam, LPARAM lParam) { + HANDLE hContact = (HANDLE)wParam; + int flags = (int)lParam, uid; + if(status != ID_STATUS_OFFLINE) { + if((uid = DBGetContactSettingDword(hContact, MODULE, "UID", 0)) != 0) { + ClientNetMessage msg; + msg.add_int("bm", 121); + msg.add_int("sesskey", sesskey); + msg.add_int("t", uid); + msg.add_int("f", my_uid); + msg.add_int("cv", CLIENT_VER); + msg.add_string("msg", (flags == PROTOTYPE_SELFTYPING_ON ? "%typing%" : "%stoptyping%")); + SendMessage(msg); + } + } + return 0; +} + int ContactDeleted(WPARAM wParam, LPARAM lParam) { HANDLE hContact = (HANDLE)wParam; int uid = DBGetContactSettingDword(hContact, MODULE, "UID", 0); @@ -433,7 +451,7 @@ void RegisterProto() { CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd); } -#define NUM_FILTER_SERVICES 16 +#define NUM_FILTER_SERVICES 17 HANDLE hServices[NUM_FILTER_SERVICES]; HANDLE hEventContactDeleted; @@ -459,6 +477,8 @@ void CreateProtoServices() { hServices[i++] = CreateProtoServiceFunction(MODULE, PSS_GETAWAYMSG, GetAwayMsg); hServices[i++] = CreateProtoServiceFunction(MODULE, PSR_AWAYMSG, RecvAwayMsg); hServices[i++] = CreateProtoServiceFunction(MODULE, PS_SETAWAYMSG, SetAwayMsg); + + hServices[i++] = CreateProtoServiceFunction(MODULE, PSS_USERISTYPING, SendTyping); // remember to modify the NUM_FILTER_SERVICES #define above if you add more services! hEventContactDeleted = HookEvent(ME_DB_CONTACT_DELETED, ContactDeleted); -- cgit v1.2.3