summaryrefslogtreecommitdiff
path: root/MySpace/proto.cpp
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-01 16:50:43 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-01 16:50:43 +0000
commit7d2d0d17e720b43162433410b88ff1de7f019f38 (patch)
treed9693399fbf3ab569941b5ac1da14f70013c2f30 /MySpace/proto.cpp
parentf98ef8ff5f7c6d2485d9e627a9af67d67e846d72 (diff)
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
Diffstat (limited to 'MySpace/proto.cpp')
-rw-r--r--MySpace/proto.cpp24
1 files changed, 22 insertions, 2 deletions
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);