From 9c8e399b431a9b0995efd24752a47efbe6e84ade Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 24 Feb 2014 12:27:21 +0000 Subject: - added ME_FILEDLG_CANCELED & ME_FILEDLG_SUCCEEDED events to support async file selection dialog; - return value of MS_FILE_SENDFILE* services changed: now it returns a dialog handle; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@8253 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/AimOscar/src/utility.cpp | 2 +- protocols/Gadu-Gadu/src/core.cpp | 4 ++-- protocols/IRCG/src/input.cpp | 2 +- protocols/JabberG/src/jabber_svc.cpp | 5 +---- protocols/SkypeClassic/src/skype.cpp | 35 ----------------------------------- protocols/Tlen/src/tlen_misc.cpp | 4 ++-- protocols/Tlen/src/tlen_muc.cpp | 6 +++--- protocols/Tlen/src/tlen_presence.cpp | 2 +- protocols/Tlen/src/tlen_svc.cpp | 4 ++-- protocols/Tlen/src/tlen_thread.cpp | 11 +++++------ protocols/Tlen/src/tlen_voice.cpp | 5 ++--- protocols/Xfire/src/main.cpp | 4 ++-- protocols/Yahoo/src/im.cpp | 2 +- protocols/Yahoo/src/proto.cpp | 2 +- protocols/Yahoo/src/yahoo.cpp | 6 +++--- 15 files changed, 27 insertions(+), 67 deletions(-) (limited to 'protocols') diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index 864e4edeba..6fa8530527 100644 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -197,7 +197,7 @@ MCONTACT CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool tempo if (addIfNeeded) { MCONTACT hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0); if (hContact) { - if (CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) m_szModuleName) == 0) { + if (CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName) == 0) { setString(hContact, AIM_KEY_SN, norm_sn); setString(hContact, AIM_KEY_NK, sn); debugLogA("Adding contact %s to client side list.",norm_sn); diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index e5c25da860..3e3e9fb723 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -1544,9 +1544,9 @@ MCONTACT GGPROTO::getcontact(uin_t uin, int create, int inlist, TCHAR *szNick) return NULL; } - if (CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) m_szModuleName) != 0) { + if (CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName) != 0) { // For some reason we failed to register the protocol for this contact - CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); + CallService(MS_DB_CONTACT_DELETE, hContact, 0); debugLogA("getcontact(): Failed to register GG contact %d", uin); return NULL; } diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp index 8d7cf7138a..3288a69a40 100644 --- a/protocols/IRCG/src/input.cpp +++ b/protocols/IRCG/src/input.cpp @@ -656,7 +656,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta TCHAR* p = (TCHAR*)temp.c_str(); pp[0] = p; pp[1] = NULL; - CallService(MS_FILE_SENDSPECIFICFILES, hContact, (LPARAM)pp); + CallService(MS_FILE_SENDSPECIFICFILEST, hContact, (LPARAM)pp); } } } diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index dc3b1d9418..3ea38670c1 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -517,15 +517,12 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam) // send file if (!_tcsicmp(szCommand, _T("sendfile"))) { - if (!ServiceExists(MS_FILE_SENDFILE)) - return 1; - MCONTACT hContact = HContactFromJID(szJid, TRUE); if (hContact == NULL) hContact = DBCreateContact(szJid, szJid, TRUE, TRUE); if (hContact == NULL) return 1; - CallService(MS_FILE_SENDFILE, hContact, (LPARAM)NULL); + CallService(MS_FILE_SENDFILE, hContact, NULL); return 0; } diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp index 1310b0bc60..2f464287cd 100644 --- a/protocols/SkypeClassic/src/skype.cpp +++ b/protocols/SkypeClassic/src/skype.cpp @@ -1949,41 +1949,6 @@ LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) if (sex) db_set_b(hContact, SKYPE_PROTONAME, "Gender", sex); } else db_unset(hContact, SKYPE_PROTONAME, "Gender"); } else - /* if (!strcmp(ptr, "AVATAR" )){ - LOG("WndProc", "AVATAR"); - if (!(hContact=find_contact(nick))) - SkypeSend("GET USER %s BUDDYSTATUS", nick); - else - { - TCHAR *unicode = NULL; - - if(utf8_decode((ptr+9), &Avatar)==-1) break; - - if( ServiceExists(MS_AV_SETAVATAR) ) - { - CallService(MS_AV_SETAVATAR,(WPARAM) hContact,(LPARAM) Avatar); - } - else - { - - if(db_set_ts(hContact, "ContactPhoto", "File", Avatar)) - { - #if defined( _UNICODE ) - char buff[TEXT_LEN]; - WideCharToMultiByte(code_page, 0, Avatar, -1, buff, TEXT_LEN, 0, 0); - buff[TEXT_LEN] = 0; - db_set_s(hContact, "ContactPhoto", "File", buff); - #endif - } - - } - - - } - free(buf); - break; - } - */ if (!strcmp(ptr, "MOOD_TEXT")){ LOG(("WndProc MOOD_TEXT")); diff --git a/protocols/Tlen/src/tlen_misc.cpp b/protocols/Tlen/src/tlen_misc.cpp index 2879edfb82..c7205a31cd 100644 --- a/protocols/Tlen/src/tlen_misc.cpp +++ b/protocols/Tlen/src/tlen_misc.cpp @@ -46,7 +46,7 @@ void TlenDBAddAuthRequest(TlenProtocol *proto, char *jid, char *nick) if ((hContact=TlenHContactFromJID(proto, jid)) == NULL) { hContact = (MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0); - CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) proto->m_szModuleName); + CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)proto->m_szModuleName); // strip resource if present s = TlenLoginFromJID(jid); _strlwr(s); @@ -114,7 +114,7 @@ MCONTACT TlenDBCreateContact(TlenProtocol *proto, char *jid, char *nick, BOOL te if ((hContact=TlenHContactFromJID(proto, jid)) == NULL) { hContact = (MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0); - CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) proto->m_szModuleName); + CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)proto->m_szModuleName); db_set_s(hContact, proto->m_szModuleName, "jid", jid); if (nick != NULL && nick[0] != '\0') db_set_s(hContact, proto->m_szModuleName, "Nick", nick); diff --git a/protocols/Tlen/src/tlen_muc.cpp b/protocols/Tlen/src/tlen_muc.cpp index fc87a29b09..02f4d220df 100644 --- a/protocols/Tlen/src/tlen_muc.cpp +++ b/protocols/Tlen/src/tlen_muc.cpp @@ -244,7 +244,7 @@ int TlenProtocol::MUCHandleEvent(WPARAM wParam, LPARAM lParam) mir_snprintf(str, SIZEOF(str), "%s/%s", mucce->pszID, nick); hContact = TlenDBCreateContact(this, str, nick, TRUE); //(char *)mucce->pszUID db_set_b(hContact, m_szModuleName, "bChat", TRUE); - CallService(MS_MSG_SENDMESSAGE, (WPARAM) hContact, (LPARAM) NULL); + CallService(MS_MSG_SENDMESSAGE, hContact, NULL); } else { DBVARIANT dbv; @@ -253,7 +253,7 @@ int TlenProtocol::MUCHandleEvent(WPARAM wParam, LPARAM lParam) mir_snprintf(str, sizeof(str), "%s@%s", nick, dbv.pszVal); db_free(&dbv); hContact = TlenDBCreateContact(this, str, nick, TRUE); - CallService(MS_MSG_SENDMESSAGE, (WPARAM) hContact, (LPARAM) NULL); + CallService(MS_MSG_SENDMESSAGE, hContact, NULL); } } } @@ -977,7 +977,7 @@ static void __cdecl TlenMUCCSendQueryResultThread(void *ptr) if (!db_get(hContact, szProto, "jid", &dbv)) { if (strcmp(dbv.pszVal, "b73@tlen.pl")) { queryResult.pItems[queryResult.iItemsNum].pszID = mir_strdup(dbv.pszVal); - queryResult.pItems[queryResult.iItemsNum].pszName = mir_strdup((char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, 0)); + queryResult.pItems[queryResult.iItemsNum].pszName = mir_strdup((char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, 0)); queryResult.iItemsNum++; } db_free(&dbv); diff --git a/protocols/Tlen/src/tlen_presence.cpp b/protocols/Tlen/src/tlen_presence.cpp index 57bd773bf0..e36f859f65 100644 --- a/protocols/Tlen/src/tlen_presence.cpp +++ b/protocols/Tlen/src/tlen_presence.cpp @@ -146,7 +146,7 @@ void TlenProcessPresence(XmlNode *node, TlenProtocol *proto) } if (item != NULL && item->isTyping) { item->isTyping = FALSE; - CallService(MS_PROTO_CONTACTISTYPING, (WPARAM) hContact, PROTOTYPE_CONTACTTYPING_OFF); + CallService(MS_PROTO_CONTACTISTYPING, hContact, PROTOTYPE_CONTACTTYPING_OFF); } proto->debugLogA("%s offline, set contact status to %d", from, status); } diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index 6221fb5032..53b657bc1e 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -184,7 +184,7 @@ static MCONTACT AddToListByJID(TlenProtocol *proto, const char *newJid, DWORD fl // not already there: add jid = mir_strdup(newJid); _strlwr(jid); hContact = (MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0); - CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) proto->m_szModuleName); + CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM) proto->m_szModuleName); db_set_s(hContact, proto->m_szModuleName, "jid", jid); if ((nick=TlenNickFromJID(newJid)) == NULL) nick = mir_strdup(newJid); @@ -963,7 +963,7 @@ int TlenProtocol::TlenDbSettingChanged(WPARAM wParam, LPARAM lParam) jid = dbv.pszVal; if ((item=TlenListGetItemPtr(this, LIST_ROSTER, dbv.pszVal)) != NULL) { if (cws->value.type == DBVT_DELETED) { - newNick = mir_strdup((char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, GCDNF_NOMYHANDLE)); + newNick = mir_strdup((char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_NOMYHANDLE)); } else if (cws->value.pszVal != NULL) { newNick = settingToChar(cws); } else { diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp index e4eafbda90..d1ad131949 100644 --- a/protocols/Tlen/src/tlen_thread.cpp +++ b/protocols/Tlen/src/tlen_thread.cpp @@ -676,7 +676,7 @@ static void TlenProcessMessage(XmlNode *node, ThreadData *info) if (item->isTyping) { item->isTyping = FALSE; if ((hContact=TlenHContactFromJID(info->proto, fromJid)) != NULL) - CallService(MS_PROTO_CONTACTISTYPING, (WPARAM) hContact, PROTOTYPE_CONTACTTYPING_OFF); + CallService(MS_PROTO_CONTACTISTYPING, hContact, PROTOTYPE_CONTACTTYPING_OFF); } } @@ -1041,12 +1041,11 @@ static void TlenProcessM(XmlNode *node, ThreadData *info) bAlert = IsAuthorized(info->proto, fLogin); } if (bAlert) { - if (info->proto->tlenOptions.useNudge) { - NotifyEventHooks(info->proto->hTlenNudge,(WPARAM) hContact,0); - } else { - if (info->proto->tlenOptions.logAlerts) { + if (info->proto->tlenOptions.useNudge) + NotifyEventHooks(info->proto->hTlenNudge, hContact, 0); + else { + if (info->proto->tlenOptions.logAlerts) TlenLogMessage(info->proto, hContact, 0, Translate("An alert has been received.")); - } SkinPlaySound("TlenAlertNotify"); } } diff --git a/protocols/Tlen/src/tlen_voice.cpp b/protocols/Tlen/src/tlen_voice.cpp index 148fb26919..ce97653f71 100644 --- a/protocols/Tlen/src/tlen_voice.cpp +++ b/protocols/Tlen/src/tlen_voice.cpp @@ -947,9 +947,8 @@ static char *getDisplayName(TlenProtocol *proto, const char *id) if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) { mir_snprintf(jid, sizeof(jid), "%s@%s", id, dbv.pszVal); db_free(&dbv); - if ((hContact=TlenHContactFromJID(proto, jid)) != NULL) { - return mir_strdup((char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM) hContact, 0)); - } + if ((hContact=TlenHContactFromJID(proto, jid)) != NULL) + return mir_strdup((char *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, 0)); } return mir_strdup(id); } diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index f5178659e5..86334fb692 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -1604,7 +1604,7 @@ MCONTACT CList_AddContact(XFireContact xfc, bool InList, bool SetOnline,int clan // here we create a new one since no one is to be found hContact = (MCONTACT) CallService(MS_DB_CONTACT_ADD, 0, 0); if ( hContact ) { - CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM)protocolname ); + CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)protocolname); if ( InList ) db_unset(hContact, "CList", "NotOnList"); @@ -3307,7 +3307,7 @@ INT_PTR BlockFriend(WPARAM hContact, LPARAM lParam) } } } - CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 1); + CallService(MS_DB_CONTACT_DELETE, hContact, 1); db_free(&dbv); } return 0; diff --git a/protocols/Yahoo/src/im.cpp b/protocols/Yahoo/src/im.cpp index bee33002bc..31e47510ec 100644 --- a/protocols/Yahoo/src/im.cpp +++ b/protocols/Yahoo/src/im.cpp @@ -132,7 +132,7 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons pre.lParam = 0; // Turn off typing - CallService(MS_PROTO_CONTACTISTYPING, (WPARAM) hContact, PROTOTYPE_CONTACTTYPING_OFF); + CallService(MS_PROTO_CONTACTISTYPING, hContact, PROTOTYPE_CONTACTTYPING_OFF); ProtoChainRecvMsg(hContact, &pre); // ack the message we just got diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index 68b80dbb35..3b0f6e7494 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -255,7 +255,7 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason ) debugLogA("Rejecting buddy:%s msg: %s", who, u_reason); reject(myid, who, getWord(hContact, "yprotoid", 0), u_reason); - CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); + CallService(MS_DB_CONTACT_DELETE, hContact, 0); } } return 0; diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index 25488ce8a8..51e1ea569b 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -725,7 +725,7 @@ void CYahooProto::ext_rejected(const char *who, const char *msg) * Make sure the contact is temporary so we could delete it w/o extra traffic */ db_set_b( hContact, "CList", "NotOnList", 1 ); - CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); + CallService(MS_DB_CONTACT_DELETE, hContact, 0); } else LOG(("[ext_rejected] Buddy not on our buddy list")); @@ -757,7 +757,7 @@ void CYahooProto::ext_buddy_added(char *myid, char *who, char *group, int status ShowPopup( TranslateT("Invalid Contact"), TranslateT("The ID you tried to add is invalid."), NULL); /* Make it TEMP first, we don't want to send any extra packets for FALSE ids */ db_set_b( hContact, "CList", "NotOnList", 1 ); - CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); + CallService(MS_DB_CONTACT_DELETE, hContact, 0); } break; @@ -767,7 +767,7 @@ void CYahooProto::ext_buddy_added(char *myid, char *who, char *group, int status ShowPopup( TranslateT("Invalid Contact"), TranslateT("Unknown Error."), NULL); /* Make it TEMP first, we don't want to send any extra packets for FALSE ids */ db_set_b( hContact, "CList", "NotOnList", 1 ); - CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0); + CallService(MS_DB_CONTACT_DELETE, hContact, 0); } break; -- cgit v1.2.3