summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MySpace/server_con.cpp43
-rw-r--r--MySpace/version.h2
2 files changed, 26 insertions, 19 deletions
diff --git a/MySpace/server_con.cpp b/MySpace/server_con.cpp
index d2c5916..2b524e7 100644
--- a/MySpace/server_con.cpp
+++ b/MySpace/server_con.cpp
@@ -546,24 +546,31 @@ void __cdecl ServerThreadFunc(void*) {
}
char text[MAX_MESSAGE_SIZE + 1];
if(msg.get_string("msg", text, MAX_MESSAGE_SIZE + 1)) {
- CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)0); // auto end typing
-
- strip_tags(text);
- decode_smileys(text);
- unentitize_xml(text);
-
- PROTORECVEVENT pre = {0};
- pre.flags = PREF_UTF;
- pre.szMessage = text;
- pre.timestamp = (DWORD)time(0);
- pre.lParam = EVENTTYPE_MESSAGE;
-
- CCSDATA css = {0};
- css.hContact = hContact;
- css.lParam = (LPARAM)⪯
- css.szProtoService = PSR_MESSAGE;
-
- CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&css);
+ // handle dodgy client with wrong message type
+ if(strcmp(text, "%typing%") == 0) {
+ CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)20);
+ } else if(strcmp(text, "%stoptyping%") == 0) {
+ CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)0);
+ } else {
+ CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)0); // auto end typing
+
+ strip_tags(text);
+ decode_smileys(text);
+ unentitize_xml(text);
+
+ PROTORECVEVENT pre = {0};
+ pre.flags = PREF_UTF;
+ pre.szMessage = text;
+ pre.timestamp = (DWORD)time(0);
+ pre.lParam = EVENTTYPE_MESSAGE;
+
+ CCSDATA css = {0};
+ css.hContact = hContact;
+ css.lParam = (LPARAM)⪯
+ css.szProtoService = PSR_MESSAGE;
+
+ CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&css);
+ }
}
}
} else if(msg.exists(NMString("persistr"))) {
diff --git a/MySpace/version.h b/MySpace/version.h
index b889416..87968ca 100644
--- a/MySpace/version.h
+++ b/MySpace/version.h
@@ -5,7 +5,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 0
#define __RELEASE_NUM 6
-#define __BUILD_NUM 2
+#define __BUILD_NUM 3
#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM