diff options
-rw-r--r-- | protocols/Steam/src/main.cpp | 1 | ||||
-rw-r--r-- | protocols/Steam/src/steam_chats.cpp | 12 | ||||
-rw-r--r-- | protocols/Steam/src/steam_proto.h | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/protocols/Steam/src/main.cpp b/protocols/Steam/src/main.cpp index 13a688ac4e..babfc1b747 100644 --- a/protocols/Steam/src/main.cpp +++ b/protocols/Steam/src/main.cpp @@ -178,6 +178,7 @@ void CMPlugin::InitSteamServices() serviceHandlers[DeleteChatMessage] = ServiceResponseHandler(&CSteamProto::OnDoNothing);
serviceHandlers[NotifyIncomingChatMessage] = ServiceResponseHandler(&CSteamProto::OnGetChatMessage);
serviceHandlers[NotifyModifiedChatMessage] = ServiceResponseHandler(&CSteamProto::OnDoNothing);
+ serviceHandlers[NotifyChatGroupUserStateChanged] = ServiceResponseHandler(&CSteamProto::OnDoNothing);
serviceHandlers[GetOwnAuthorizedDevices] = ServiceResponseHandler(&CSteamProto::OnGotDeviceList);
diff --git a/protocols/Steam/src/steam_chats.cpp b/protocols/Steam/src/steam_chats.cpp index dab76be00c..e59d39efe7 100644 --- a/protocols/Steam/src/steam_chats.cpp +++ b/protocols/Steam/src/steam_chats.cpp @@ -28,6 +28,7 @@ void CSteamProto::OnGetMyChats(const CChatRoomGetMyChatRoomGroupsResponse &reply if (hdr.failed()) return; + std::map<MCONTACT, bool> chatIds; for (int i = 0; i < reply.n_chat_room_groups; i++) { auto *pGroup = reply.chat_room_groups[i]->group_summary; @@ -87,6 +88,8 @@ void CSteamProto::OnGetMyChats(const CChatRoomGetMyChatRoomGroupsResponse &reply } else si->pParent = pOwner; + chatIds[si->hContact] = true; + setDword(si->hContact, "ChatId", pChat->chat_id); if (!wszGrpName.IsEmpty()) Clist_SetGroup(si->hContact, wszGrpName); @@ -112,6 +115,15 @@ void CSteamProto::OnGetMyChats(const CChatRoomGetMyChatRoomGroupsResponse &reply SendGetChatHistory(si->hContact, dwLastMsgId); } } + + // clean garbage + for (auto &cc : AccContacts()) { + if (!Contact::IsGroupChat(cc)) + continue; + + if (chatIds.find(cc) == chatIds.end()) + db_delete_contact(cc, CDF_DEL_CONTACT); + } } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h index 870d513c89..360a7403b3 100644 --- a/protocols/Steam/src/steam_proto.h +++ b/protocols/Steam/src/steam_proto.h @@ -41,6 +41,7 @@ #define NotifyIncomingChatMessage "ChatRoomClient.NotifyIncomingChatMessage#1"
#define NotifyModifiedChatMessage "ChatRoomClient.NotifyChatMessageModified#1"
+#define NotifyChatGroupUserStateChanged "ChatRoomClient.NotifyChatGroupUserStateChanged#1"
#define NotificationReceived "SteamNotificationClient.NotificationsReceived#1"
|