From 3aae70e7ad1247f82d14314a6afe9c4b22d0fa2a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 7 Feb 2019 19:40:11 +0300 Subject: MRA account support moved from Dummy to ICQ --- protocols/Dummy/src/main.cpp | 9 --------- protocols/ICQ-WIM/src/main.cpp | 9 +++++++++ protocols/ICQ-WIM/src/proto.cpp | 2 ++ protocols/ICQ-WIM/src/server.cpp | 2 +- protocols/ICQ-WIM/src/utils.cpp | 7 +++++++ 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/protocols/Dummy/src/main.cpp b/protocols/Dummy/src/main.cpp index d6c786e42b..4dbf8e16eb 100644 --- a/protocols/Dummy/src/main.cpp +++ b/protocols/Dummy/src/main.cpp @@ -112,12 +112,3 @@ struct CMPluginWhatsapp : public ACCPROTOPLUGIN } } static g_pluginWhatsapp; - -struct CMPluginMra : public ACCPROTOPLUGIN -{ - CMPluginMra() : ACCPROTOPLUGIN("MRA", pluginInfoEx) - { - SetUniqueId("e-mail"); - } -} -static g_pluginMra; diff --git a/protocols/ICQ-WIM/src/main.cpp b/protocols/ICQ-WIM/src/main.cpp index d3175491ac..2a5cd298f2 100644 --- a/protocols/ICQ-WIM/src/main.cpp +++ b/protocols/ICQ-WIM/src/main.cpp @@ -44,6 +44,15 @@ CMPlugin::CMPlugin() : SetUniqueId(DB_KEY_ID); } +struct CMPluginMra : public ACCPROTOPLUGIN +{ + CMPluginMra() : ACCPROTOPLUGIN("MRA", pluginInfoEx) + { + SetUniqueId(DB_KEY_ID); + } +} +static g_pluginMra; + ///////////////////////////////////////////////////////////////////////////////////////// extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST }; diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index ba57b37cdc..6e0b3f3989 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -102,6 +102,8 @@ void CIcqProto::OnModulesLoaded() } else { CMStringW wszEmail(getMStringW("Email")); + if (wszEmail.IsEmpty()) + wszEmail = getMStringW("e-mail"); if (!wszEmail.IsEmpty()) m_szOwnId = wszEmail; } diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 8c4fc52b78..1144df6b4b 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -258,7 +258,7 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact) setDword(hContact, "Status", StatusFromString(str)); Json2string(hContact, buddy, "friendly", "Nick"); - Json2string(hContact, buddy, "emailId", "e-mail"); + Json2string(hContact, buddy, "emailId", "Email"); Json2string(hContact, buddy, "cellNumber", "Cellular"); Json2string(hContact, buddy, "phoneNumber", "Phone"); Json2string(hContact, buddy, "workNumber", "CompanyPhone"); diff --git a/protocols/ICQ-WIM/src/utils.cpp b/protocols/ICQ-WIM/src/utils.cpp index cd5265674f..0e41836901 100644 --- a/protocols/ICQ-WIM/src/utils.cpp +++ b/protocols/ICQ-WIM/src/utils.cpp @@ -35,6 +35,13 @@ void CIcqProto::InitContactCache() _itow(dwUin, buf, 10); setWString(it, DB_KEY_ID, buf); } + else { + CMStringW wszEmail(getMStringW(it, "e-mail")); + if (!wszEmail.IsEmpty()) { + delSetting(it, "UIN"); + setWString(it, DB_KEY_ID, wszEmail); + } + } m_arCache.insert(new IcqCacheItem(GetUserId(it), it)); } -- cgit v1.2.3