diff options
author | George Hazan <ghazan@miranda.im> | 2023-02-10 12:54:20 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-02-10 12:54:20 +0300 |
commit | ef0ba268b340eaf1217a96d763342c25668588b4 (patch) | |
tree | 17396375e213043c2ce1c59b50b7f30488dcb83d /protocols/Sametime | |
parent | 33733576589076f080ddfa000b899843016a2597 (diff) |
Protocols: preventing recursive contact deletion
Diffstat (limited to 'protocols/Sametime')
-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 |
3 files changed, 3 insertions, 5 deletions
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);
|