From 5e9e63c45e37917ffb0acd83832d0d8f99d01883 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 28 Nov 2012 17:38:49 +0000 Subject: new macroses for MS_PROTO_CHAINRECV: ProtoChainRecv, ProtoChainRecvMsg & ProtoChainRecvFile git-svn-id: http://svn.miranda-ng.org/main/trunk@2540 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Xfire/src/main.cpp | 42 ++++++++++----------------------------- protocols/Xfire/src/variables.cpp | 2 +- 2 files changed, 12 insertions(+), 32 deletions(-) (limited to 'protocols/Xfire/src') diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index c1cb8b7f61..9b6af47d47 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -626,25 +626,17 @@ void XFireClient::sendmsg(char*usr,char*cmsg) { HANDLE handle=CList_AddContact(xfire_newc,TRUE,TRUE,0); if(handle) { // invite nachricht mitsenden - string str; - CCSDATA ccs; - PROTORECVEVENT pre; - - str=(char*)invite->msg.c_str(); + string str = (char*)invite->msg.c_str(); - time_t t = time(NULL); - ccs.szProtoService = PSR_MESSAGE; - ccs.hContact = handle; - ccs.wParam = 0; - ccs.lParam = (LPARAM) & pre; + PROTORECVEVENT pre; pre.flags = 0; - pre.timestamp = t; + pre.timestamp = time(NULL); pre.szMessage = (char*)mir_utf8decode((char*)str.c_str(),NULL); //invite nachricht konnte nicht zugewiesen werden?!?!?! if(!pre.szMessage) pre.szMessage=(char*)str.c_str(); pre.lParam = 0; - CallService(MS_PROTO_CHAINRECV, 0, (LPARAM) &ccs); + ProtoChainRecvMsg(handle, &pre); } } else @@ -731,41 +723,29 @@ void XFireClient::sendmsg(char*usr,char*cmsg) { //ne nachricht für mich, juhu case XFIRE_MESSAGE_ID: { string str; - CCSDATA ccs; - PROTORECVEVENT pre; if( (( MessagePacket*)content)->getMessageType() == 0){ BuddyListEntry *entry = client->getBuddyList()->getBuddyBySid( ((MessagePacket*)content)->getSid() ); if(entry!=NULL) { str=((MessagePacket*)content)->getMessage(); - time_t t = time(NULL); - ccs.szProtoService = PSR_MESSAGE; - ccs.hContact = entry->hcontact; - ccs.wParam = 0; - ccs.lParam = (LPARAM) & pre; - pre.flags = 0; - pre.timestamp = t; - if(this->useutf8) - { + + PROTORECVEVENT pre = { 0 }; + pre.timestamp = time(NULL); + if (this->useutf8) { pre.szMessage = (char*)str.c_str(); pre.flags = PREF_UTF; } - else - pre.szMessage = (char*)mir_utf8decode((char*)str.c_str(),NULL); - pre.lParam = 0; - - CallService(MS_PROTO_CONTACTISTYPING,(WPARAM)ccs.hContact,PROTOTYPE_CONTACTTYPING_OFF); - CallService(MS_PROTO_CHAINRECV, 0, (LPARAM) &ccs); + else pre.szMessage = (char*)mir_utf8decode((char*)str.c_str(),NULL); + CallService(MS_PROTO_CONTACTISTYPING,(WPARAM)entry->hcontact,PROTOTYPE_CONTACTTYPING_OFF); + ProtoChainRecvMsg(entry->hcontact, &pre); } } else if( (( MessagePacket*)content)->getMessageType() == 3) { BuddyListEntry *entry = client->getBuddyList()->getBuddyBySid( ((MessagePacket*)content)->getSid() ); if(entry!=NULL) - { CallService(MS_PROTO_CONTACTISTYPING,(WPARAM)entry->hcontact,5); - } } break; diff --git a/protocols/Xfire/src/variables.cpp b/protocols/Xfire/src/variables.cpp index d7dd38b9e3..1ba54f6ddd 100644 --- a/protocols/Xfire/src/variables.cpp +++ b/protocols/Xfire/src/variables.cpp @@ -172,7 +172,7 @@ char* XFireGetFoldersPath(char * pathtype) extern HANDLE XFireWorkingFolder; extern HANDLE XFireIconFolder; extern HANDLE XFireAvatarFolder; - char path[1024] = ""; + static char path[1024]; path[0] = 0; if (ServiceExists(MS_FOLDERS_REGISTER_PATH)){ if (!strcmp(pathtype,"Avatar")){ FoldersGetCustomPath(XFireAvatarFolder, path, 1024, "" );} -- cgit v1.2.3