From 53b41c5180eaa9d01b7a57d6ccd4602384a1aebb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 11 Nov 2023 20:31:15 +0300 Subject: ICQ: missing PS_LEAVECHAT service added --- protocols/ICQ-WIM/src/groupchats.cpp | 9 +++++++++ protocols/ICQ-WIM/src/proto.cpp | 2 ++ protocols/ICQ-WIM/src/proto.h | 1 + 3 files changed, 12 insertions(+) (limited to 'protocols') diff --git a/protocols/ICQ-WIM/src/groupchats.cpp b/protocols/ICQ-WIM/src/groupchats.cpp index 9f9e314811..c45eaecfa4 100644 --- a/protocols/ICQ-WIM/src/groupchats.cpp +++ b/protocols/ICQ-WIM/src/groupchats.cpp @@ -36,6 +36,15 @@ SESSION_INFO* CIcqProto::CreateGroupChat(const wchar_t *pwszId, const wchar_t *p return si; } +INT_PTR CIcqProto::OnLeaveChat(WPARAM hContact, LPARAM) +{ + CMStringW wszId(GetUserId(hContact)); + if (auto *si = Chat_Find(wszId, m_szModuleName)) + LeaveDestroyChat(si); + + return 0; +} + ///////////////////////////////////////////////////////////////////////////////////////// void CIcqProto::LoadChatInfo(SESSION_INFO *si) diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index aec09ffb55..b4239637d6 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -91,6 +91,8 @@ CIcqProto::CIcqProto(const char *aProtoName, const wchar_t *aUserName) : gcr.pszModule = m_szModuleName; Chat_Register(&gcr); + CreateProtoService(PS_LEAVECHAT, &CIcqProto::OnLeaveChat); + // avatars CreateDirectoryTreeW(GetAvatarPath()); diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h index 1cf5f4381b..fdd552a1cc 100644 --- a/protocols/ICQ-WIM/src/proto.h +++ b/protocols/ICQ-WIM/src/proto.h @@ -381,6 +381,7 @@ class CIcqProto : public PROTO INT_PTR __cdecl GotoInbox(WPARAM, LPARAM); INT_PTR __cdecl UploadGroups(WPARAM, LPARAM); + INT_PTR __cdecl OnLeaveChat(WPARAM, LPARAM); INT_PTR __cdecl OnMenuLoadHistory(WPARAM, LPARAM); //////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3