From ffa0fa4f142eb6ee5f919a96b10f36363c511b16 Mon Sep 17 00:00:00 2001 From: sje Date: Tue, 10 Jul 2007 14:23:37 +0000 Subject: implemented zaps git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@269 4f64403b-2f21-0410-a795-97e2b3489a10 --- MySpace/server_con.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'MySpace/server_con.cpp') diff --git a/MySpace/server_con.cpp b/MySpace/server_con.cpp index 0ef40e6..71ebe09 100644 --- a/MySpace/server_con.cpp +++ b/MySpace/server_con.cpp @@ -36,6 +36,10 @@ int signon_status = ID_STATUS_ONLINE; char signon_status_msg[512] = {0}; CRITICAL_SECTION write_cs; +char *zap_array[11] = { + "zap", "whack", "torch", "smooch", "hug", "bslap", "goose", "hi-five", "punk'd", "raspberry", 0 +}; + bool WriteData(char *fn, int fn_size, char *data, int data_size) { char szTempPath[MAX_PATH], szTempFileName[MAX_PATH]; @@ -481,6 +485,24 @@ void __cdecl ServerThreadFunc(void*) { CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)5); else if(strcmp(smsg, "%stoptyping%") == 0) { CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, (LPARAM)0); + } else if(strncmp(smsg, "!!!ZAP_SEND!!!=RTE_BTN_ZAPS_", 28) == 0) { + // recvd a zap + int zapnum = smsg[28] - '0'; + char rmsg[512]; + mir_snprintf(rmsg, 512, Translate("You received a ZAP: %s"), Translate(zap_array[zapnum])); + + PROTORECVEVENT pre = {0}; + pre.flags = PREF_UTF; + pre.szMessage = rmsg; + pre.timestamp = (DWORD)time(0); + + CCSDATA css = {0}; + css.hContact = hContact; + css.lParam = (LPARAM)⪯ + css.szProtoService = PSR_MESSAGE; + + CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&css); + } } } -- cgit v1.2.3