summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdmsg/src/cmdlist.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/stdmsg/src/cmdlist.cpp b/src/core/stdmsg/src/cmdlist.cpp
index 2b6c17fe5f..62f57de562 100644
--- a/src/core/stdmsg/src/cmdlist.cpp
+++ b/src/core/stdmsg/src/cmdlist.cpp
@@ -66,14 +66,12 @@ TMsgQueue* msgQueue_find(MCONTACT hContact, int id)
mir_cslockfull lck(csMsgQueue);
for (auto &it : msgQueue) {
if ((it->hContact == hContact || it->hContact == hMeta) && it->id == id) {
- msgQueue.remove(it);
-
- if (!msgQueue.getCount() && timerId) {
+ if (msgQueue.getCount() == 1 && timerId) {
KillTimer(nullptr, timerId);
timerId = 0;
}
- return it;
+ return msgQueue.removeItem(&it);
}
}
return nullptr;