summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);