summaryrefslogtreecommitdiff
path: root/plugins/TipperYM/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-05-30 15:31:28 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-05-30 15:31:28 +0000
commit581204a18bc5a50d1c8a7412e147e560503d11b8 (patch)
tree59f78fa2cc227e4feae48c9cf4e10544c80c4c71 /plugins/TipperYM/src
parentfd0d38e50db088692bfff7608df3b765d804e847 (diff)
db_mc_getMostOnline - a handy helper for MS_MC_GETMOSTONLINECONTACT
git-svn-id: http://svn.miranda-ng.org/main/trunk@9372 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TipperYM/src')
-rw-r--r--plugins/TipperYM/src/subst.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp
index 8bb06815d4..653ed2a655 100644
--- a/plugins/TipperYM/src/subst.cpp
+++ b/plugins/TipperYM/src/subst.cpp
@@ -218,7 +218,7 @@ TCHAR* GetStatusMessageText(MCONTACT hContact)
char *szProto = GetContactProto(hContact);
if (szProto) {
if (!strcmp(szProto, META_PROTO))
- hContact = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0);
+ hContact = db_mc_getMostOnline(hContact);
else {
WORD wStatus = (int)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
if (wStatus == ID_STATUS_OFFLINE)
@@ -303,21 +303,23 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff
}
else if (!_tcscmp(swzRawSpec, _T("meta_subname"))) {
// get contact list name of active subcontact
- HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0);
- if (!hSubContact || (INT_PTR)hSubContact == CALLSERVICE_NOTFOUND) return false;
+ MCONTACT hSubContact = db_mc_getMostOnline(hContact);
+ if (!hSubContact)
+ return false;
+
TCHAR *swzNick = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hSubContact, GCDNF_TCHAR);
if (swzNick) _tcsncpy(buff, swzNick, bufflen);
return true;
}
else if (!_tcscmp(swzRawSpec, _T("meta_subuid"))) {
- MCONTACT hSubContact = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0);
+ MCONTACT hSubContact = db_mc_getMostOnline(hContact);
if (!hSubContact || (INT_PTR)hSubContact == CALLSERVICE_NOTFOUND)
return false;
return Uid(hSubContact, 0, buff, bufflen);
}
else if (!_tcscmp(swzRawSpec, _T("meta_subproto"))) {
// get protocol of active subcontact
- MCONTACT hSubContact = (MCONTACT)CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0);
+ MCONTACT hSubContact = db_mc_getMostOnline(hContact);
if (!hSubContact || (INT_PTR)hSubContact == CALLSERVICE_NOTFOUND)
return false;
return GetSysSubstText(hSubContact, _T("account"), buff, bufflen);