summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/contactcache.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-09-09 16:14:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-09-09 16:14:28 +0000
commit3e6e572558a049fe8ebb7ac2390e954d12b2c320 (patch)
tree9b5493ada959c7522c1c05ef5af000a08393baee /plugins/TabSRMM/src/contactcache.cpp
parent50a2be2affae63fc6ba4e7ebb22af563f1f8b867 (diff)
we don't use cache for statuses anymore
git-svn-id: http://svn.miranda-ng.org/main/trunk@17276 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/contactcache.cpp')
-rw-r--r--plugins/TabSRMM/src/contactcache.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp
index d3f7600f6d..c42ac94347 100644
--- a/plugins/TabSRMM/src/contactcache.cpp
+++ b/plugins/TabSRMM/src/contactcache.cpp
@@ -50,7 +50,7 @@ CContactCache::CContactCache(MCONTACT hContact)
cc = &ccInvalid;
m_szAccount = C_INVALID_ACCOUNT;
m_isMeta = false;
- m_Valid = false;
+ m_isValid = false;
}
/**
@@ -66,8 +66,8 @@ void CContactCache::initPhaseTwo()
m_szAccount = acc->tszAccountName;
}
- m_Valid = (cc->szProto != 0 && m_szAccount != 0) ? true : false;
- if (m_Valid) {
+ m_isValid = (cc->szProto != 0 && m_szAccount != 0) ? true : false;
+ if (m_isValid) {
m_isMeta = db_mc_isMeta(cc->contactID) != 0; // don't use cc->IsMeta() here
if (m_isMeta)
updateMeta();
@@ -110,7 +110,7 @@ void CContactCache::closeWindow()
bool CContactCache::updateNick()
{
bool fChanged = false;
- if (m_Valid) {
+ if (m_isValid) {
wchar_t *tszNick = pcli->pfnGetContactDisplayName(getActiveContact(), 0);
if (tszNick && mir_wstrcmp(m_szNick, tszNick))
fChanged = true;
@@ -126,7 +126,7 @@ bool CContactCache::updateNick()
*/
void CContactCache::updateMeta()
{
- if (m_Valid) {
+ if (m_isValid) {
MCONTACT hOldSub = m_hSub;
m_hSub = db_mc_getSrmmSub(cc->contactID);
m_szMetaProto = GetContactProto(m_hSub);
@@ -156,7 +156,7 @@ bool CContactCache::updateUIN()
{
m_szUIN[0] = 0;
- if (m_Valid) {
+ if (m_isValid) {
ptrW uid(Contact_GetInfo(CNF_DISPLAYUID, getActiveContact(), getActiveProto()));
if (uid != NULL)
wcsncpy_s(m_szUIN, uid, _TRUNCATE);
@@ -390,12 +390,13 @@ void CContactCache::releaseAlloced()
*/
void CContactCache::deletedHandler()
{
- m_Valid = false;
+ cc = &ccInvalid;
+ m_isValid = false;
if (m_hwnd)
::SendMessage(m_hwnd, WM_CLOSE, 1, 2);
releaseAlloced();
- m_hContact = (MCONTACT)-1;
+ m_hContact = INVALID_CONTACT_ID;
}
/**
@@ -416,7 +417,7 @@ void CContactCache::updateFavorite()
*/
void CContactCache::updateStatusMsg(const char *szKey)
{
- if (!m_Valid)
+ if (!m_isValid)
return;
MCONTACT hContact = getActiveContact();
@@ -573,9 +574,9 @@ size_t CContactCache::getMaxMessageLength()
return m_nMax;
}
-bool CContactCache::updateStatus(int iStatus)
-{
- m_iOldStatus = m_iStatus;
- m_iStatus = iStatus;
- return m_iOldStatus != iStatus;
-}
+bool CContactCache::updateStatus(int iStatus)
+{
+ m_iOldStatus = m_iStatus;
+ m_iStatus = iStatus;
+ return m_iOldStatus != iStatus;
+}