summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-06-03 14:59:24 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-06-03 14:59:24 +0300
commite8c67aa8819b0ca83726f8606d3ab2b4c7b64188 (patch)
tree5ba96ead270c13b7ee790702e30fc8bc4a76de6a
parent80042a770a94fbb2dc56d81fd889a6d8b22a5ff1 (diff)
fixes #2733 (ICQ: после блокировки спамерского чата через оф. клиент, он не удаляется из Миранды)
-rw-r--r--protocols/ICQ-WIM/src/ignore.cpp4
-rw-r--r--protocols/ICQ-WIM/src/server.cpp6
2 files changed, 7 insertions, 3 deletions
diff --git a/protocols/ICQ-WIM/src/ignore.cpp b/protocols/ICQ-WIM/src/ignore.cpp
index 00578d6c17..3ccbf95271 100644
--- a/protocols/ICQ-WIM/src/ignore.cpp
+++ b/protocols/ICQ-WIM/src/ignore.cpp
@@ -51,11 +51,11 @@ void CIcqProto::ProcessPermissions(const JSONNode &ev)
CMStringW wszId(it.as_mstring());
auto *p = FindContactByUIN(wszId);
if (p == nullptr) {
- auto hContact = CreateContact(wszId, false);
- Contact_Hide(hContact);
+ CreateContact(wszId, false);
p = FindContactByUIN(wszId);
}
p->m_iApparentMode = ID_STATUS_OFFLINE;
+ Contact_Hide(p->m_hContact);
m_bIgnoreListEmpty = false;
}
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp
index b6eb594f6a..354f43ac65 100644
--- a/protocols/ICQ-WIM/src/server.cpp
+++ b/protocols/ICQ-WIM/src/server.cpp
@@ -282,7 +282,11 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact)
CMStringW wszChatId(buddy["aimId"].as_mstring());
CMStringW wszChatName(buddy["friendly"].as_mstring());
- SESSION_INFO *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, wszChatId, wszChatName);
+ auto *pContact = FindContactByUIN(wszId);
+ if (pContact && pContact->m_iApparentMode == ID_STATUS_OFFLINE)
+ return INVALID_CONTACT_ID;
+
+ auto *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, wszChatId, wszChatName);
if (si == nullptr)
return INVALID_CONTACT_ID;