summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-22 20:57:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-22 20:57:18 +0000
commit252fef051a5ec3bd2d247976772f677d8c82e65d (patch)
tree0352cf5a6baf062ab307502153ec54b3c58560f0 /src
parent20015ea138dd46c88610d6d08486fba9d5fb5839 (diff)
fix for the hardcoded xstatus checkbox
git-svn-id: http://svn.miranda-ng.org/main/trunk@2434 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/core/commonheaders.h1
-rw-r--r--src/modules/clist/clistmenus.cpp8
-rw-r--r--src/modules/clist/clisttray.cpp21
3 files changed, 14 insertions, 16 deletions
diff --git a/src/core/commonheaders.h b/src/core/commonheaders.h
index 79be0e0ecf..f691cf8c26 100644
--- a/src/core/commonheaders.h
+++ b/src/core/commonheaders.h
@@ -98,6 +98,7 @@ using namespace std;
#include <m_help.h>
#include <m_timezones.h>
#include <m_extraicons.h>
+#include <m_xstatus.h>
#include "miranda.h"
#include "stdplug.h"
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index 4b54616adf..ce37c3ad59 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -451,7 +451,13 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
StatusMenuExecParam *smep = (StatusMenuExecParam*)pcpp->MenuItemOwnerData;
if (smep && !smep->status && smep->custom) {
if (wildcmp(smep->svc, "*XStatus*")) {
- int XStatus = CallProtoServiceInt(NULL,smep->proto, "/GetXStatus", 0, 0);
+ int XStatus;
+ CUSTOM_STATUS cs = { sizeof(cs) };
+ cs.flags = CSSF_MASK_STATUS;
+ cs.status = &XStatus;
+ if ( CallProtoServiceInt(NULL, smep->proto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&cs) != 0)
+ XStatus = 0;
+
char buf[255];
mir_snprintf(buf, sizeof(buf), "*XStatus%d", XStatus);
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp
index 351ca78a7b..12d177eb2c 100644
--- a/src/modules/clist/clisttray.cpp
+++ b/src/modules/clist/clisttray.cpp
@@ -54,21 +54,12 @@ static TCHAR* sttGetXStatus(const char* szProto)
TCHAR* result = NULL;
if (CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0) > ID_STATUS_OFFLINE) {
- char str[MAXMODULELABELLENGTH];
- mir_snprintf(str, sizeof(str), "%s/GetXStatus", szProto);
- if (ServiceExists(str)) {
- char* dbTitle = "XStatusName";
- char* dbTitle2 = NULL;
- int xstatus = CallProtoServiceInt(NULL,szProto, "/GetXStatus", (WPARAM)&dbTitle, (LPARAM)&dbTitle2);
- if (dbTitle && xstatus) {
- DBVARIANT dbv = {0};
- if ( !DBGetContactSettingTString(NULL, szProto, dbTitle, &dbv)) {
- if (dbv.ptszVal[0] != 0)
- result = mir_tstrdup(dbv.ptszVal);
- db_free(&dbv);
- }
- }
- }
+ TCHAR tszStatus[512];
+ CUSTOM_STATUS cs = { sizeof(cs) };
+ cs.flags = CSSF_MASK_MESSAGE | CSSF_TCHAR;
+ cs.ptszMessage = tszStatus;
+ if ( CallProtoServiceInt(NULL, szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&cs) == 0)
+ result = mir_tstrdup(tszStatus);
}
return result;