summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/ICQ-WIM')
-rw-r--r--protocols/ICQ-WIM/src/poll.cpp1
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp4
-rw-r--r--protocols/ICQ-WIM/src/utils.cpp2
3 files changed, 6 insertions, 1 deletions
diff --git a/protocols/ICQ-WIM/src/poll.cpp b/protocols/ICQ-WIM/src/poll.cpp
index 9b1e5aae92..c507c3babb 100644
--- a/protocols/ICQ-WIM/src/poll.cpp
+++ b/protocols/ICQ-WIM/src/poll.cpp
@@ -69,6 +69,7 @@ void CIcqProto::ProcessBuddyList(const JSONNode &ev)
if (bEnableMenu)
Menu_ShowItem(m_hUploadGroups, true);
+ mir_cslock lck(m_csCache);
for (auto &it : m_arCache)
if (!it->m_bInList && !getBool(it->m_hContact, "IcqDeleted"))
Contact::RemoveFromList(it->m_hContact);
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index 1e6ffb5ada..8ee9b60d8b 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -154,8 +154,10 @@ void CIcqProto::OnContactAdded(MCONTACT hContact)
void CIcqProto::OnContactDeleted(MCONTACT hContact)
{
CMStringW szId(GetUserId(hContact));
- if (!isChatRoom(hContact))
+ if (!isChatRoom(hContact)) {
+ mir_cslock lck(m_csCache);
m_arCache.remove(FindUser(szId));
+ }
Push(new AsyncHttpRequest(CONN_MAIN, REQUEST_GET, ICQ_API_SERVER "/buddylist/removeBuddy")
<< AIMSID(this) << WCHAR_PARAM("buddy", szId) << INT_PARAM("allGroups", 1));
diff --git a/protocols/ICQ-WIM/src/utils.cpp b/protocols/ICQ-WIM/src/utils.cpp
index bdaac877bf..83d876adb0 100644
--- a/protocols/ICQ-WIM/src/utils.cpp
+++ b/protocols/ICQ-WIM/src/utils.cpp
@@ -46,6 +46,8 @@ void CIcqProto::InitContactCache()
auto *pUser = FindUser(wszId);
if (pUser == nullptr) {
pUser = new IcqUser(wszId, it);
+
+ mir_cslock lck(m_csCache);
m_arCache.insert(pUser);
}
pUser->m_iProcessedMsgId = getId(it, DB_KEY_LASTMSGID);