diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/groupchat.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/services.cpp | 2 | ||||
-rw-r--r-- | protocols/GmailNotifier/src/options.cpp | 2 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 2 | ||||
-rw-r--r-- | protocols/IRCG/src/tools.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_iqid.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_thread.cpp | 2 | ||||
-rw-r--r-- | protocols/NewsAggregator/Src/Options.cpp | 2 | ||||
-rw-r--r-- | protocols/Non-IM Contact/src/dialog.cpp | 4 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime.cpp | 5 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime_proto.cpp | 1 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime_proto.h | 2 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 2 | ||||
-rw-r--r-- | protocols/Twitter/src/contacts.cpp | 18 | ||||
-rw-r--r-- | protocols/Twitter/src/proto.cpp | 3 | ||||
-rw-r--r-- | protocols/Twitter/src/proto.h | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 2 | ||||
-rw-r--r-- | protocols/YAMN/src/proto/pop3/pop3opt.cpp | 2 |
19 files changed, 25 insertions, 34 deletions
diff --git a/protocols/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.cpp b/protocols/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.cpp index db6d2104aa..aafc83affa 100644 --- a/protocols/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.cpp +++ b/protocols/CurrencyRates/src/CurrencyRatesProviderCurrencyConverter.cpp @@ -341,7 +341,7 @@ bool CCurrencyRatesProviderCurrencyConverter::WatchForRate(const TRateInfo &ri, m_aContacts.erase(i); } - db_delete_contact(hContact); + db_delete_contact(hContact, true); return true; } diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 39bd3a0b98..cb2ca4684a 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -126,7 +126,7 @@ int GaduProto::gc_event(WPARAM, LPARAM lParam) list_remove(&chats, chat, 1);
// Remove contact from contact list (duh!) should be done by chat.dll !!
- db_delete_contact(gch->si->hContact);
+ db_delete_contact(gch->si->hContact, true);
return 1;
}
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index 9b08f19823..15c7e14096 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -387,7 +387,7 @@ INT_PTR GaduProto::get_acc_mgr_gui(WPARAM, LPARAM lParam) INT_PTR GaduProto::leavechat(WPARAM hContact, LPARAM)
{
if (hContact)
- db_delete_contact(hContact);
+ db_delete_contact(hContact, true);
return 0;
}
diff --git a/protocols/GmailNotifier/src/options.cpp b/protocols/GmailNotifier/src/options.cpp index 01076473e4..35ba71cb30 100644 --- a/protocols/GmailNotifier/src/options.cpp +++ b/protocols/GmailNotifier/src/options.cpp @@ -197,7 +197,7 @@ public: Account &acc = g_accs[curIndex]; DeleteResults(acc.results.next); - db_delete_contact(acc.hContact); + db_delete_contact(acc.hContact, true); g_accs.remove(curIndex); m_combo.SetCurSel(curIndex = 0); diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 562cdbaa8e..a5916cb40f 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -314,7 +314,7 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact, boo FindContactByUIN(wszId)->m_bInList = true;
}
else if (bIgnored) {
- db_delete_contact(hContact);
+ db_delete_contact(hContact, true);
return INVALID_CONTACT_ID;
}
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp index 56ecbf6ebf..164f955f0b 100644 --- a/protocols/IRCG/src/tools.cpp +++ b/protocols/IRCG/src/tools.cpp @@ -26,7 +26,7 @@ void CIrcProto::CheckUpdate() if (getByte("Compatibility") < 1) {
for (auto &cc : AccContacts()) {
if (getByte(cc, "ChatRoom") == GCW_SERVER)
- db_delete_contact(cc);
+ db_delete_contact(cc, true);
else {
ptrA szNick(getUStringA(cc, "Nick"));
if (szNick)
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 85e2397829..305b9e8ff6 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -532,7 +532,7 @@ void CJabberProto::OnIqResultGetRoster(const TiXmlElement *iqNode, CJabberIqInfo JABBER_LIST_ITEM *item = ListGetItemPtrFromIndex(i);
if (item && item->hContact && !item->bRealContact) {
debugLogA("Syncing roster: preparing to delete %s (hContact=0x%x)", item->jid, item->hContact);
- db_delete_contact(item->hContact);
+ db_delete_contact(item->hContact, true);
}
}
}
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index a088f16c12..6daac6fa9c 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -1386,7 +1386,7 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info) else if (!mir_strcmp(action, "delete")) {
MCONTACT cc = HContactFromJID(jid);
if (cc)
- db_delete_contact(cc);
+ db_delete_contact(cc, true);
}
}
}
diff --git a/protocols/NewsAggregator/Src/Options.cpp b/protocols/NewsAggregator/Src/Options.cpp index 18fff38fbe..ecd13f8494 100644 --- a/protocols/NewsAggregator/Src/Options.cpp +++ b/protocols/NewsAggregator/Src/Options.cpp @@ -953,7 +953,7 @@ void COptionsMain::OnDeleteButtonClick(CCtrlBase*) if (mir_wstrcmp(dbURL, url)) continue; - db_delete_contact(hContact); + db_delete_contact(hContact, true); m_feeds.DeleteItem(isel); break; } diff --git a/protocols/Non-IM Contact/src/dialog.cpp b/protocols/Non-IM Contact/src/dialog.cpp index 1676198969..ab1d7e4dcd 100644 --- a/protocols/Non-IM Contact/src/dialog.cpp +++ b/protocols/Non-IM Contact/src/dialog.cpp @@ -290,7 +290,7 @@ INT_PTR addContact(WPARAM, LPARAM) g_plugin.setWString(hContact, "Nick", TranslateT("New Non-IM Contact")); DoPropertySheet(hContact); if (db_get_static(hContact, MODNAME, "Name", tmp, _countof(tmp))) - db_delete_contact(hContact); + db_delete_contact(hContact, true); replaceAllStrings(hContact); return 0; } @@ -307,7 +307,7 @@ INT_PTR editContact(WPARAM wParam, LPARAM) } DoPropertySheet(hContact); if (db_get_static(hContact, MODNAME, "Name", tmp, _countof(tmp))) - db_delete_contact(hContact); + db_delete_contact(hContact, true); replaceAllStrings(hContact); return 0; } diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 5bf1ebdd9f..e11388ca86 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -128,11 +128,10 @@ void CSametimeProto::OnShutdown() LogOut();
}
-int CSametimeProto::OnSametimeContactDeleted(WPARAM hContact, LPARAM)
+void CSametimeProto::OnContactDeleted(MCONTACT hContact)
{
ContactDeleted(hContact);
ChatDeleted(hContact);
- return 0;
}
void CSametimeProto::SetAllOffline()
@@ -141,7 +140,7 @@ void CSametimeProto::SetAllOffline() for (auto &hContact : AccContacts()) {
if (Contact::IsGroupChat(hContact, m_szModuleName)) {
- db_delete_contact(hContact);
+ db_delete_contact(hContact, true);
continue;
}
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp index ab4fb15f29..3cdd972398 100644 --- a/protocols/Sametime/src/sametime_proto.cpp +++ b/protocols/Sametime/src/sametime_proto.cpp @@ -30,7 +30,6 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const wchar_t* tszUserN HookProtoEvent(ME_MSG_WINDOWEVENT, &CSametimeProto::OnWindowEvent);
HookProtoEvent(ME_IDLE_CHANGED, &CSametimeProto::OnIdleChanged);
- HookProtoEvent(ME_DB_CONTACT_DELETED, &CSametimeProto::OnSametimeContactDeleted);
HookProtoEvent(ME_OPT_INITIALISE, &CSametimeProto::OptInit);
// Initialize temporary DB settings
diff --git a/protocols/Sametime/src/sametime_proto.h b/protocols/Sametime/src/sametime_proto.h index d38daef4ae..0105d33a39 100644 --- a/protocols/Sametime/src/sametime_proto.h +++ b/protocols/Sametime/src/sametime_proto.h @@ -39,9 +39,9 @@ struct CSametimeProto : public PROTO<CSametimeProto> int UserIsTyping(MCONTACT hContact, int type) override;
void OnShutdown() override;
+ void OnContactDeleted(MCONTACT hContact) override;
// sametime.cpp
- int __cdecl OnSametimeContactDeleted(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl GetName(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl SametimeLoadIcon(WPARAM wParam, LPARAM lParam);
int __cdecl OnWindowEvent(WPARAM wParam, LPARAM lParam);
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index fabd66162c..2d1fc6c3b8 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -233,7 +233,7 @@ INT_PTR CSkypeProto::OnLeaveChatRoom(WPARAM hContact, LPARAM) PushRequest(new KickUserRequest(_T2A(idT), m_szSkypename));
- db_delete_contact(hContact);
+ db_delete_contact(hContact, true);
}
return 0;
}
diff --git a/protocols/Twitter/src/contacts.cpp b/protocols/Twitter/src/contacts.cpp index dc3b2668ee..ce4795132b 100644 --- a/protocols/Twitter/src/contacts.cpp +++ b/protocols/Twitter/src/contacts.cpp @@ -154,25 +154,19 @@ HANDLE CTwitterProto::GetAwayMsg(MCONTACT hContact) return (HANDLE)1;
}
-int CTwitterProto::OnContactDeleted(WPARAM wParam, LPARAM)
+void CTwitterProto::OnContactDeleted(MCONTACT hContact)
{
- MCONTACT hContact = (MCONTACT)wParam;
if (m_iStatus != ID_STATUS_ONLINE)
- return 0;
-
- if (!IsMyContact(hContact))
- return 0;
+ return;
- DBVARIANT dbv;
- if (!getString(hContact, TWITTER_KEY_UN, &dbv)) {
+ ptrA szId(getStringA(hContact, TWITTER_KEY_UN));
+ if (szId) {
if (m_si)
- DeleteChatContact(dbv.pszVal);
+ DeleteChatContact(szId);
mir_cslock s(twitter_lock_);
- remove_friend(dbv.pszVal); // Be careful about this until Miranda is fixed
- db_free(&dbv);
+ remove_friend(szId.get()); // Be careful about this until Miranda is fixed
}
- return 0;
}
int CTwitterProto::OnMarkedRead(WPARAM, LPARAM hDbEvent)
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index 3bdb0ee542..0ee353ac67 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -36,7 +36,6 @@ CTwitterProto::CTwitterProto(const char *proto_name, const wchar_t *username) : CreateProtoService(PS_SETMYAVATAR, &CTwitterProto::SetAvatar);
HookProtoEvent(ME_OPT_INITIALISE, &CTwitterProto::OnOptionsInit);
- HookProtoEvent(ME_DB_CONTACT_DELETED, &CTwitterProto::OnContactDeleted);
HookProtoEvent(ME_DB_EVENT_MARKED_READ, &CTwitterProto::OnMarkedRead);
HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &CTwitterProto::OnBuildStatusMenu);
@@ -355,7 +354,7 @@ void CTwitterProto::UpdateSettings() for (MCONTACT hContact = db_find_first(m_szModuleName); hContact;) {
MCONTACT hNext = db_find_next(hContact, m_szModuleName);
if (isChatRoom(hContact))
- db_delete_contact(hContact);
+ db_delete_contact(hContact, true);
hContact = hNext;
}
}
diff --git a/protocols/Twitter/src/proto.h b/protocols/Twitter/src/proto.h index 6868386c29..7fe4922552 100644 --- a/protocols/Twitter/src/proto.h +++ b/protocols/Twitter/src/proto.h @@ -166,6 +166,7 @@ public: HANDLE GetAwayMsg(MCONTACT) override;
+ void OnContactDeleted(MCONTACT) override;
void OnModulesLoaded() override;
void UpdateSettings();
@@ -189,7 +190,6 @@ public: int __cdecl OnBuildStatusMenu(WPARAM, LPARAM);
int __cdecl OnChatOutgoing(WPARAM, LPARAM);
- int __cdecl OnContactDeleted(WPARAM,LPARAM);
int __cdecl OnMarkedRead(WPARAM, LPARAM);
int __cdecl OnOptionsInit(WPARAM,LPARAM);
int __cdecl OnPrebuildContactMenu(WPARAM,LPARAM);
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index d163c059d2..bd7acbac2d 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -1782,7 +1782,7 @@ MEVENT CVkProto::GetMessageFromDb(const char *messageId, UINT ×tamp, CMStri int CVkProto::DeleteContact(MCONTACT hContact)
{
setByte(hContact, "SilentDelete", 1);
- return db_delete_contact(hContact);
+ return db_delete_contact(hContact, true);
}
bool CVkProto::IsMessageExist(UINT iMsgId, VKMesType vkType)
diff --git a/protocols/YAMN/src/proto/pop3/pop3opt.cpp b/protocols/YAMN/src/proto/pop3/pop3opt.cpp index a1dfa14199..195358f197 100644 --- a/protocols/YAMN/src/proto/pop3/pop3opt.cpp +++ b/protocols/YAMN/src/proto/pop3/pop3opt.cpp @@ -528,7 +528,7 @@ public: DlgSetItemTextW(m_hwnd, IDC_STTIMELEFT, TranslateT("Please wait while no account is in use."));
if (ActualAccount->hContact != NULL)
- db_delete_contact(ActualAccount->hContact);
+ db_delete_contact(ActualAccount->hContact, true);
CallService(MS_YAMN_DELETEACCOUNT, (WPARAM)POP3Plugin, (LPARAM)ActualAccount);
|