diff options
author | George Hazan <ghazan@miranda.im> | 2022-09-24 13:16:24 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-09-24 13:16:24 +0300 |
commit | a4bd7890860122ffc5e7799194ae390c10299c18 (patch) | |
tree | ac745cf90e0c4520c8d476f05756a9ab1e16bee4 /protocols/ICQ-WIM | |
parent | 6047ddcf042d0650137c75a94dcc700e3af2b263 (diff) |
fixes #3199 (ICQ: cannot view/add MRA contact)
Diffstat (limited to 'protocols/ICQ-WIM')
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 2 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/stdafx.h | 1 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/utils.cpp | 6 |
3 files changed, 8 insertions, 1 deletions
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(); |