summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mir_app/src/CMPluginBase.cpp9
-rw-r--r--src/mir_app/src/protocols.cpp12
2 files changed, 10 insertions, 11 deletions
diff --git a/src/mir_app/src/CMPluginBase.cpp b/src/mir_app/src/CMPluginBase.cpp
index b6fb78d6f4..b14ce7be28 100644
--- a/src/mir_app/src/CMPluginBase.cpp
+++ b/src/mir_app/src/CMPluginBase.cpp
@@ -293,5 +293,12 @@ void CMPluginBase::RegisterProtocol(int type, pfnInitProto fnInit, pfnUninitProt
void CMPluginBase::SetUniqueId(const char *pszUniqueId)
{
- ::Proto_SetUniqueId(m_szModuleName, pszUniqueId);
+ if (pszUniqueId == nullptr)
+ return;
+
+ MBaseProto tmp;
+ tmp.szName = (char*)m_szModuleName;
+ MBaseProto *pd = g_arProtos.find(&tmp);
+ if (pd != nullptr)
+ pd->szUniqueId = mir_strdup(pszUniqueId);
}
diff --git a/src/mir_app/src/protocols.cpp b/src/mir_app/src/protocols.cpp
index 6a28c9bfeb..f4aea76896 100644
--- a/src/mir_app/src/protocols.cpp
+++ b/src/mir_app/src/protocols.cpp
@@ -145,20 +145,12 @@ MIR_APP_DLL(PROTOCOLDESCRIPTOR*) Proto_RegisterModule(int type, const char *szNa
MIR_APP_DLL(void) Proto_SetUniqueId(const char *szModuleName, const char *pszUniqueId)
{
- if (szModuleName == nullptr || pszUniqueId == nullptr)
+ if (pszUniqueId == nullptr)
return;
PROTOACCOUNT *pa = Proto_GetAccount(szModuleName);
- if (pa != nullptr) {
+ if (pa != nullptr)
pa->szUniqueId = mir_strdup(pszUniqueId);
- return;
- }
-
- MBaseProto tmp;
- tmp.szName = (char*)szModuleName;
- MBaseProto *pd = g_arProtos.find(&tmp);
- if (pd != nullptr)
- pd->szUniqueId = mir_strdup(pszUniqueId);
}
MIR_APP_DLL(const char*) Proto_GetUniqueId(const char *szModuleName)