From 76b283677bd66b4f41289bc211504834bb0f0513 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 24 Sep 2013 11:14:26 +0000 Subject: PROTORECVEVENT::pCustomData field added to add user-defined into to incoming messages git-svn-id: http://svn.miranda-ng.org/main/trunk@6206 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/AimOscar/src/server.cpp | 3 +-- protocols/EmLanProto/src/mlan.cpp | 7 ++----- protocols/IRCG/src/commandmonitor.cpp | 2 +- protocols/IcqOscarJ/src/fam_02location.cpp | 3 +-- protocols/IcqOscarJ/src/fam_13servclist.cpp | 3 +-- protocols/MSN/src/msn_commands.cpp | 2 +- protocols/Skype/src/skype_contacts.cpp | 2 +- protocols/Skype/src/skype_messages.cpp | 2 +- protocols/Tlen/src/tlen_thread.cpp | 12 ++++-------- protocols/Twitter/src/connection.cpp | 2 +- protocols/Yahoo/src/im.cpp | 2 +- 11 files changed, 15 insertions(+), 25 deletions(-) (limited to 'protocols') diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp index 9359813aba..3988e342fa 100644 --- a/protocols/AimOscar/src/server.cpp +++ b/protocols/AimOscar/src/server.cpp @@ -1315,11 +1315,10 @@ void CAimProto::snac_received_message(SNAC &snac,HANDLE hServerConn,unsigned sho // Okay we are setting up the structure to give the message back to miranda's core CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hMsgContact, 0); { - PROTORECVEVENT pre; + PROTORECVEVENT pre = { 0 }; pre.flags = PREF_UTF; pre.timestamp = (is_offline) ? offline_timestamp : (DWORD)time(0); pre.szMessage = msg_buf; - pre.lParam = 0; ProtoChainRecvMsg(hMsgContact, &pre); } diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index 01fe5a9c49..c899fd4121 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -342,11 +342,9 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) RequestStatus(true, cont->m_addr.S_un.S_addr); else { - PROTORECVEVENT pre; - pre.flags = 0; + PROTORECVEVENT pre = { 0 }; pre.timestamp = get_time(); pre.szMessage = pak.strMessage; - pre.lParam = 0; ProtoChainRecv( FindContact(cont->m_addr, cont->m_nick, true, false, false, cont->m_status), pak.flIsUrl ? PSR_URL : PSR_MESSAGE, 0, (LPARAM)&pre ); @@ -367,8 +365,7 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) if (pak.strAwayMessage && cont) { - PROTORECVEVENT pre; - pre.flags = 0; + PROTORECVEVENT pre = { 0 }; pre.timestamp = get_time(); pre.szMessage = pak.strAwayMessage; pre.lParam = pak.idAckAwayMessage; diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 6873bc918c..a280009923 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -718,7 +718,7 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage* pmsg) HANDLE hContact = CList_AddContact(&user, false, true); - PROTORECVEVENT pre; + PROTORECVEVENT pre = { 0 }; pre.timestamp = (DWORD)time(NULL); pre.flags = PREF_UTF; pre.szMessage = mir_utf8encodeW( mess.c_str()); diff --git a/protocols/IcqOscarJ/src/fam_02location.cpp b/protocols/IcqOscarJ/src/fam_02location.cpp index 5b3fcf07a2..1913681070 100644 --- a/protocols/IcqOscarJ/src/fam_02location.cpp +++ b/protocols/IcqOscarJ/src/fam_02location.cpp @@ -278,8 +278,7 @@ void CIcqProto::handleLocationUserInfoReply(BYTE* buf, WORD wLen, DWORD dwCookie disposeChain(&pChain); } - PROTORECVEVENT pre; - pre.flags = 0; + PROTORECVEVENT pre = { 0 }; pre.szMessage = szMsg ? szMsg : (char *)""; pre.timestamp = time(NULL); pre.lParam = dwCookie; diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp index e451e63ffc..ee848c5e0f 100644 --- a/protocols/IcqOscarJ/src/fam_13servclist.cpp +++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp @@ -1634,8 +1634,7 @@ void CIcqProto::handleRecvAuthRequest(unsigned char *buf, WORD wLen) HANDLE hContact = HContactFromUID(dwUin, szUid, &bAdded); - PROTORECVEVENT pre; - pre.flags = 0; + PROTORECVEVENT pre = { 0 }; pre.timestamp = time(NULL); pre.lParam = sizeof(DWORD) + sizeof(HANDLE) + 5; // Prepare reason diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 41d622b965..43d413a206 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -500,7 +500,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para { CallService(MS_PROTO_CONTACTISTYPING, WPARAM(hContact), 0); - PROTORECVEVENT pre; + PROTORECVEVENT pre = { 0 }; pre.szMessage = (char*)msgBody; pre.flags = PREF_UTF + (isRtl ? PREF_RTL : 0); pre.timestamp = (DWORD)time(NULL); diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp index 0f848d522f..72a518a80f 100644 --- a/protocols/Skype/src/skype_contacts.cpp +++ b/protocols/Skype/src/skype_contacts.cpp @@ -469,7 +469,7 @@ void CSkypeProto::OnContactsReceived(const ConversationRef &conversation, const message->GetPropGuid(guid); ReadMessageParam param = { guid, messageType }; - PROTORECVEVENT pre; + PROTORECVEVENT pre = { 0 }; pre.flags = PREF_UTF; pre.lParam = (LPARAM)¶m; pre.timestamp = timestamp; diff --git a/protocols/Skype/src/skype_messages.cpp b/protocols/Skype/src/skype_messages.cpp index 93d8f71f49..d0e4ea81da 100644 --- a/protocols/Skype/src/skype_messages.cpp +++ b/protocols/Skype/src/skype_messages.cpp @@ -68,7 +68,7 @@ void CSkypeProto::OnMessageReceived(const ConversationRef &conversation, const M if (status != CMessage::UNCONSUMED_NORMAL) flags |= PREF_CREATEREAD; - PROTORECVEVENT recv; + PROTORECVEVENT recv = { 0 }; recv.flags = flags; recv.lParam = (LPARAM)¶m; recv.timestamp = timestamp; diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp index f9fe2ef01e..a08f3763a8 100644 --- a/protocols/Tlen/src/tlen_thread.cpp +++ b/protocols/Tlen/src/tlen_thread.cpp @@ -586,7 +586,6 @@ static void TlenProcessAvatar(XmlNode* node, ThreadData *info) static void TlenProcessMessage(XmlNode *node, ThreadData *info) { HANDLE hContact; - PROTORECVEVENT recv; XmlNode *bodyNode, *subjectNode, *xNode, *n; char *from, *type, *nick, *p, *localMessage, *idStr; DWORD msgTime; @@ -703,7 +702,7 @@ static void TlenProcessMessage(XmlNode *node, ThreadData *info) msgTime = time(NULL); } } - recv.flags = 0; + PROTORECVEVENT recv = { 0 }; recv.timestamp = (DWORD) msgTime; recv.szMessage = localMessage; recv.lParam = 0; @@ -952,7 +951,6 @@ static void TlenProcessIq(XmlNode *node, ThreadData *info) static void TlenProcessW(XmlNode *node, ThreadData *info) { HANDLE hContact; - PROTORECVEVENT recv; char *f, *e, *s, *body; char *str, *localMessage; int strSize; @@ -984,10 +982,9 @@ static void TlenProcessW(XmlNode *node, ThreadData *info) localMessage = TlenTextDecode(str); - recv.flags = 0; + PROTORECVEVENT recv = { 0 }; recv.timestamp = (DWORD) time(NULL); recv.szMessage = localMessage; - recv.lParam = 0; ProtoChainRecvMsg(hContact, &recv); mir_free(localMessage); @@ -1001,7 +998,6 @@ static void TlenProcessW(XmlNode *node, ThreadData *info) static void TlenProcessM(XmlNode *node, ThreadData *info) { HANDLE hContact; - PROTORECVEVENT recv; char *f;//, *from;//username char *tp;//typing start/stop char *p, *n, *r, *s, *str, *localMessage; @@ -1071,10 +1067,10 @@ static void TlenProcessM(XmlNode *node, ThreadData *info) db_set_b(hContact, info->proto->m_szModuleName, "bChat", TRUE); mir_free(str); localMessage = TlenTextDecode(bNode->text); - recv.flags = 0; + + PROTORECVEVENT recv = { 0 }; recv.timestamp = (DWORD) timestamp; recv.szMessage = localMessage; - recv.lParam = 0; ProtoChainRecvMsg(hContact, &recv); mir_free(localMessage); } else { diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp index 623975696d..bad727f993 100644 --- a/protocols/Twitter/src/connection.cpp +++ b/protocols/Twitter/src/connection.cpp @@ -622,7 +622,7 @@ void TwitterProto::UpdateMessages(bool pre_read) { HANDLE hContact = AddToClientList(i->username.c_str(),""); - PROTORECVEVENT recv = {}; + PROTORECVEVENT recv = { 0 }; recv.flags = PREF_UTF; if(pre_read) recv.flags |= PREF_CREATEREAD; diff --git a/protocols/Yahoo/src/im.cpp b/protocols/Yahoo/src/im.cpp index 5fc8f536e0..08ab726172 100644 --- a/protocols/Yahoo/src/im.cpp +++ b/protocols/Yahoo/src/im.cpp @@ -104,7 +104,7 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons //setWord(hContact, "yprotoid", protocol); Set_Protocol(hContact, protocol); - PROTORECVEVENT pre; + PROTORECVEVENT pre = { 0 }; pre.flags = (utf8) ? PREF_UTF : 0; if (tm) { -- cgit v1.2.3