From b665a90f50f09435aef5bc3b5b9da710e4558690 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 5 Apr 2013 16:54:27 +0000 Subject: various menu items quirks, simplifications & optimization git-svn-id: http://svn.miranda-ng.org/main/trunk@4319 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/contactcache.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'plugins/TabSRMM/src/contactcache.cpp') diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 28ae75bb1d..74238bb783 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -148,14 +148,12 @@ bool CContactCache::updateNick() */ bool CContactCache::updateStatus() { - if (m_Valid) { - m_wOldStatus = m_wStatus; - m_wStatus = (WORD)DBGetContactSettingWord(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE); + if (!m_Valid) + return false; - return(m_wOldStatus != m_wStatus); - } - else - return(false); + m_wOldStatus = m_wStatus; + m_wStatus = (WORD)db_get_w(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE); + return m_wOldStatus != m_wStatus; } /** @@ -174,7 +172,7 @@ void CContactCache::updateMeta(bool fForce) PROTOACCOUNT *acc = reinterpret_cast(::CallService(MS_PROTO_GETACCOUNT, 0, (LPARAM)m_szMetaProto)); if (acc && acc->tszAccountName) m_szAccount = acc->tszAccountName; - m_wMetaStatus = DBGetContactSettingWord(m_hSubContact, m_szMetaProto, "Status", ID_STATUS_OFFLINE); + m_wMetaStatus = db_get_w(m_hSubContact, m_szMetaProto, "Status", ID_STATUS_OFFLINE); MultiByteToWideChar(CP_ACP, 0, m_szMetaProto, -1, m_tszMetaProto, 40); m_tszMetaProto[39] = 0; } -- cgit v1.2.3