summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-25 15:57:24 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-25 15:57:24 +0300
commitcbbd47079533e4da06f1342df071894c7fa11c10 (patch)
tree3727f058d9ca8e393e3f80a6b9758637e6b35ca6
parent5b53a45fd65e78f34eb77dea268c591d675cfec3 (diff)
StdUserInfo: fix for protocol calculation
-rw-r--r--src/core/stduserinfo/src/userinfo.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp
index d843147daf..7e3793af1c 100644
--- a/src/core/stduserinfo/src/userinfo.cpp
+++ b/src/core/stduserinfo/src/userinfo.cpp
@@ -227,7 +227,7 @@ class CUserInfoDlg : public CDlgBase
void CheckOnline()
{
- auto *szProto = (m_pCurrent) ? m_pCurrent->szProto : nullptr;
+ const char *szProto = GetProto();
if (szProto == nullptr || m_bIsMeta)
btnUpdate.Disable();
else {
@@ -238,6 +238,14 @@ class CUserInfoDlg : public CDlgBase
}
}
+ const char *GetProto() const
+ {
+ if (m_pCurrent && m_pCurrent->szProto)
+ return m_pCurrent->szProto;
+
+ return (m_hContact) ? Proto_GetBaseAccountName(m_hContact) : nullptr;
+ }
+
void ResizeCurrent()
{
RECT rc;
@@ -547,7 +555,7 @@ public:
m_infosUpdated = NULL;
}
- if (auto *szProto = (m_pCurrent) ? m_pCurrent->szProto : nullptr)
+ if (const char *szProto = GetProto())
if (!CallProtoService(szProto, PSS_GETINFO, 0, 0)) {
btnUpdate.Disable();
ShowWindow(GetDlgItem(m_hwnd, IDC_UPDATING), SW_SHOW);