diff options
author | George Hazan <george.hazan@gmail.com> | 2016-08-08 11:12:32 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-08-08 11:12:32 +0000 |
commit | 2cdd9ae1c6bbd4c19dcf3393db1943c1dff39604 (patch) | |
tree | 2423705f3ebb84915ca84d3c34d375df1a016bd2 /plugins/TabSRMM/src/contactcache.cpp | |
parent | 77d2c4bc51547dcf8812375812961c9fbb87e666 (diff) |
more cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@17170 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/contactcache.cpp')
-rw-r--r-- | plugins/TabSRMM/src/contactcache.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index afe9bd384c..b2ac11e277 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -38,7 +38,7 @@ static DBCachedContact ccInvalid; CContactCache::CContactCache(MCONTACT hContact) { m_hContact = hContact; - m_wStatus = m_wOldStatus = ID_STATUS_OFFLINE; + m_iStatus = m_iOldStatus = ID_STATUS_OFFLINE; if (hContact) { if ((cc = db_get_contact(hContact)) != NULL) { @@ -88,7 +88,7 @@ void CContactCache::resetMeta() { m_isMeta = false; m_szMetaProto = 0; - m_wMetaStatus = ID_STATUS_OFFLINE; + m_iMetaStatus = ID_STATUS_OFFLINE; initPhaseTwo(); } @@ -135,7 +135,7 @@ void CContactCache::updateMeta() MCONTACT hOldSub = m_hSub; m_hSub = db_mc_getSrmmSub(cc->contactID); m_szMetaProto = GetContactProto(m_hSub); - m_wMetaStatus = (WORD)db_get_w(m_hSub, m_szMetaProto, "Status", ID_STATUS_OFFLINE); + m_iMetaStatus = (WORD)db_get_w(m_hSub, m_szMetaProto, "Status", ID_STATUS_OFFLINE); PROTOACCOUNT *pa = Proto_GetAccount(m_szMetaProto); if (pa) m_szAccount = pa->tszAccountName; @@ -148,7 +148,7 @@ void CContactCache::updateMeta() else { m_hSub = 0; m_szMetaProto = NULL; - m_wMetaStatus = ID_STATUS_OFFLINE; + m_iMetaStatus = ID_STATUS_OFFLINE; m_xStatus = 0; } } @@ -578,13 +578,9 @@ size_t CContactCache::getMaxMessageLength() return m_nMax; } -int CContactCache::getStatus() const
+bool CContactCache::updateStatus(int iStatus)
{
- return db_get_w(getActiveContact(), getActiveProto(), "Status", ID_STATUS_OFFLINE);
-}
-
-void CContactCache::updateStatus()
-{
- m_wOldStatus = m_wStatus;
- m_wStatus = getStatus();
+ m_iOldStatus = m_iStatus;
+ m_iStatus = iStatus;
+ return m_iOldStatus != iStatus;
}
|