diff options
Diffstat (limited to 'MySpace/proto.cpp')
-rw-r--r-- | MySpace/proto.cpp | 24 |
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);
|