diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-15 21:31:36 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-15 21:31:36 +0000 |
commit | 10a205a4c77765d6300e16e3b202dfef97a3e45c (patch) | |
tree | 603fa0b562e5bd424c49cab6c647f536fcb67c5a /plugins/TabSRMM/src/contactcache.cpp | |
parent | 4fec1417fa432990c0d9cb34a722c1c894d87468 (diff) |
fix for displaying sub's xstatus in tabSRMM
git-svn-id: http://svn.miranda-ng.org/main/trunk@9818 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/contactcache.cpp')
-rw-r--r-- | plugins/TabSRMM/src/contactcache.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 38ef4e3f92..adba2c2130 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -155,10 +155,12 @@ void CContactCache::updateMeta(bool fForce) MCONTACT hSub = db_mc_getSrmmSub(cc->contactID);
m_szMetaProto = GetContactProto(hSub);
m_wMetaStatus = (WORD)db_get_w(hSub, m_szMetaProto, "Status", ID_STATUS_OFFLINE);
+ m_xStatus = (WORD)db_get_w(hSub, m_szMetaProto, "XStatusId", ID_STATUS_OFFLINE);
}
else {
m_szMetaProto = NULL;
m_wMetaStatus = ID_STATUS_OFFLINE;
+ m_xStatus = 0;
}
}
@@ -446,11 +448,13 @@ void CContactCache::updateStatusMsg(const char *szKey) if (!m_Valid)
return;
+ MCONTACT hContact = getActiveContact();
+
if (szKey == 0 || (szKey && !strcmp("StatusMsg", szKey))) {
if (m_szStatusMsg)
mir_free(m_szStatusMsg);
m_szStatusMsg = 0;
- ptrT szStatus(db_get_tsa(m_hContact, "CList", "StatusMsg"));
+ ptrT szStatus(db_get_tsa(hContact, "CList", "StatusMsg"));
if (szStatus != 0)
m_szStatusMsg = (lstrlen(szStatus) > 0 ? getNormalizedStatusMsg(szStatus) : 0);
}
@@ -458,7 +462,7 @@ void CContactCache::updateStatusMsg(const char *szKey) if (m_ListeningInfo)
mir_free(m_ListeningInfo);
m_ListeningInfo = 0;
- ptrT szListeningTo(db_get_tsa(m_hContact, cc->szProto, "ListeningTo"));
+ ptrT szListeningTo(db_get_tsa(hContact, cc->szProto, "ListeningTo"));
if (szListeningTo != 0 && *szListeningTo)
m_ListeningInfo = szListeningTo.detouch();
}
@@ -466,11 +470,11 @@ void CContactCache::updateStatusMsg(const char *szKey) if (m_xStatusMsg)
mir_free(m_xStatusMsg);
m_xStatusMsg = 0;
- ptrT szXStatusMsg(db_get_tsa(m_hContact, cc->szProto, "XStatusMsg"));
+ ptrT szXStatusMsg(db_get_tsa(hContact, cc->szProto, "XStatusMsg"));
if (szXStatusMsg != 0 && *szXStatusMsg)
m_xStatusMsg = szXStatusMsg.detouch();
}
- m_xStatus = db_get_b(m_hContact, cc->szProto, "XStatusId", 0);
+ m_xStatus = db_get_b(hContact, cc->szProto, "XStatusId", 0);
}
/**
@@ -511,12 +515,10 @@ void CContactCache::cacheUpdateMetaChanged() }
// meta contacts are enabled, but current contact is a subcontact - > close window
-
if (fMetaActive && c.isSubContact())
c.closeWindow();
// reset meta contact information, if metacontacts protocol became avail
-
if (fMetaActive && !strcmp(c.getProto(), META_PROTO))
c.resetMeta();
}
|