From a4bd7890860122ffc5e7799194ae390c10299c18 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 24 Sep 2022 13:16:24 +0300 Subject: fixes #3199 (ICQ: cannot view/add MRA contact) --- protocols/ICQ-WIM/src/server.cpp | 2 +- protocols/ICQ-WIM/src/stdafx.h | 1 + protocols/ICQ-WIM/src/utils.cpp | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'protocols/ICQ-WIM/src') diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index db7f034934..9795da2c3c 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -305,7 +305,7 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact, boo return si->hContact; } - bool bIgnored = !m_isMra && buddy["userType"].as_string() != "icq"; + bool bIgnored = !IsValidType(buddy); if (hContact == INVALID_CONTACT_ID) { if (bIgnored) return INVALID_CONTACT_ID; diff --git a/protocols/ICQ-WIM/src/stdafx.h b/protocols/ICQ-WIM/src/stdafx.h index c5c4f0dc7e..465a385f02 100644 --- a/protocols/ICQ-WIM/src/stdafx.h +++ b/protocols/ICQ-WIM/src/stdafx.h @@ -101,6 +101,7 @@ #include "proto.h" bool IsChat(const CMStringW &aimid); +bool IsValidType(const JSONNode &aimid); void RefreshGroups(void); wchar_t* time2text(time_t time); diff --git a/protocols/ICQ-WIM/src/utils.cpp b/protocols/ICQ-WIM/src/utils.cpp index 4d6a975cd3..2b74e1a4bf 100644 --- a/protocols/ICQ-WIM/src/utils.cpp +++ b/protocols/ICQ-WIM/src/utils.cpp @@ -275,6 +275,12 @@ bool IsChat(const CMStringW &aimid) return aimid.Right(11) == "@chat.agent"; } +bool IsValidType(const JSONNode &n) +{ + auto type = n["userType"].as_string(); + return type == "icq" || type == "aim" || type == "interop"; +} + int CIcqProto::StatusFromPresence(const JSONNode &presence, MCONTACT hContact) { CMStringW wszStatus = presence["state"].as_mstring(); -- cgit v1.2.3