summaryrefslogtreecommitdiff
path: root/protocols/VKontakte
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-01-30 20:18:37 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-01-30 20:18:46 +0300
commit4c281b28075dfa69d8cc2301b06492fbddb62f24 (patch)
treeb788f37caaff5063fd36eecad191d2a5582be12c /protocols/VKontakte
parenta243c59835182e2a1fa91d9c7bd80defea88e4e8 (diff)
LIST::remove + LIST::indexOf() combination removed with LIST::removeItem
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r--protocols/VKontakte/src/misc.cpp2
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp11
2 files changed, 5 insertions, 8 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 4fe0e82eb5..d8fa035b10 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -212,7 +212,7 @@ bool CVkProto::CheckMid(LIST<void> &lList, int guid)
{
for (auto &it : lList)
if ((INT_PTR)it == guid) {
- lList.remove(lList.indexOf(&it));
+ lList.removeItem(&it);
return true;
}
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index 1668e2959b..a5904b7b46 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -182,26 +182,23 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
}
}
- auto T = cc->m_users.rev_iter();
- for (auto &cu : T) {
+ for (auto &cu : cc->m_users.rev_iter()) {
if (!cu->m_bDel)
continue;
wchar_t wszId[20];
_itow(cu->m_uid, wszId, 10);
+ CMStringW wszNick(FORMAT, L"%s (%s)", cu->m_wszNick.get(), UserProfileUrl(cu->m_uid).c_str());
GCEVENT gce = { m_szModuleName, 0, GC_EVENT_PART };
gce.pszID.w = cc->m_wszId;
gce.pszUID.w = wszId;
gce.dwFlags = GCEF_NOTNOTIFY;
gce.time = time(0);
- gce.pszNick.w = mir_wstrdup(CMStringW(FORMAT, L"%s (%s)",
- cu->m_wszNick,
- UserProfileUrl(cu->m_uid).c_str()
- ));
+ gce.pszNick.w = wszNick;
Chat_Event(&gce);
- cc->m_users.remove(T.indexOf(&cu));
+ cc->m_users.removeItem(&cu);
}
}