summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM/src/groupchats.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-11-30 17:53:26 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-11-30 17:53:26 +0300
commit14ba52669cf1f87cbf8564ab68ca5859be1bb282 (patch)
tree928cbadfc259eae5df1af61823270bd3f6ea5721 /protocols/ICQ-WIM/src/groupchats.cpp
parentee46074d500e5ea300f9bef0b979f47a8f0a0c75 (diff)
ICQ: fix for eternal cycle on group chat leaving + some code cleaning
Diffstat (limited to 'protocols/ICQ-WIM/src/groupchats.cpp')
-rw-r--r--protocols/ICQ-WIM/src/groupchats.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/protocols/ICQ-WIM/src/groupchats.cpp b/protocols/ICQ-WIM/src/groupchats.cpp
index aef323b1c9..42aea886a8 100644
--- a/protocols/ICQ-WIM/src/groupchats.cpp
+++ b/protocols/ICQ-WIM/src/groupchats.cpp
@@ -36,7 +36,7 @@ SESSION_INFO* CIcqProto::CreateGroupChat(const wchar_t *pwszId, const wchar_t *p
return si;
}
-INT_PTR CIcqProto::OnLeaveChat(WPARAM hContact, LPARAM)
+INT_PTR CIcqProto::SvcLeaveChat(WPARAM hContact, LPARAM)
{
CMStringW wszId(GetUserId(hContact));
if (auto *si = Chat_Find(wszId, m_szModuleName))
@@ -192,12 +192,17 @@ void CIcqProto::InviteUserToChat(SESSION_INFO *si)
dlg.DoModal();
}
-void CIcqProto::LeaveDestroyChat(SESSION_INFO *si)
+void CIcqProto::OnLeaveChat(NETLIBHTTPREQUEST*, AsyncHttpRequest *pReq)
{
- Push(new AsyncHttpRequest(CONN_MAIN, REQUEST_GET, "/buddylist/hideChat")
- << AIMSID(this) << WCHAR_PARAM("buddy", si->ptszID) << INT64_PARAM("lastMsgId", getId(si->hContact, DB_KEY_LASTMSGID)));
+ db_delete_contact(INT_PTR(pReq->pUserInfo));
+}
- db_delete_contact(si->hContact);
+void CIcqProto::LeaveDestroyChat(SESSION_INFO *si)
+{
+ auto *pReq = new AsyncHttpRequest(CONN_MAIN, REQUEST_GET, "/buddylist/hideChat", &CIcqProto::OnLeaveChat)
+ << AIMSID(this) << WCHAR_PARAM("buddy", si->ptszID) << INT64_PARAM("lastMsgId", getId(si->hContact, DB_KEY_LASTMSGID));
+ pReq->pUserInfo = (void *)si->hContact;
+ Push(pReq);
}
/////////////////////////////////////////////////////////////////////////////////////////