summaryrefslogtreecommitdiff
path: root/plugins/MetaContacts/src
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2013-05-24 19:45:46 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2013-05-24 19:45:46 +0000
commit386b0374969f724a99d145242dddf8562ff1be7c (patch)
tree50695d06b56cd4c8283e77ffa59b4d3dd0e4f80a /plugins/MetaContacts/src
parent977f89fd3104eefe691126266bef323304d6b236 (diff)
MetaContacts mow uses status descriptions from the core
git-svn-id: http://svn.miranda-ng.org/main/trunk@4813 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MetaContacts/src')
-rwxr-xr-xplugins/MetaContacts/src/meta_services.cpp5
-rw-r--r--plugins/MetaContacts/src/meta_utils.cpp48
-rw-r--r--plugins/MetaContacts/src/metacontacts.h1
3 files changed, 5 insertions, 49 deletions
diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp
index db338c5477..74bfbfbc7c 100755
--- a/plugins/MetaContacts/src/meta_services.cpp
+++ b/plugins/MetaContacts/src/meta_services.cpp
@@ -583,7 +583,6 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
{
DBCONTACTWRITESETTING *dcws = (DBCONTACTWRITESETTING *)lParam;
char buffer[512], szId[40];
- TCHAR buffer2[512];
int contact_number;
HANDLE hMeta, most_online;
@@ -740,8 +739,8 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam)
strcpy(buffer, "StatusString");
strcat(buffer, _itoa(contact_number, szId, 10));
- Meta_GetStatusString(dcws->value.wVal, buffer2, 512);
- db_set_ts(hMeta, META_PROTO, buffer, buffer2);
+ TCHAR *szStatus = (TCHAR*) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)dcws->value.wVal, GSMDF_TCHAR);
+ db_set_ts(hMeta, META_PROTO, buffer, szStatus);
// if the contact was forced, unforce it (which updates status)
if ((HANDLE)db_get_dw(hMeta, META_PROTO, "ForceSend", 0) == (HANDLE)wParam) {
diff --git a/plugins/MetaContacts/src/meta_utils.cpp b/plugins/MetaContacts/src/meta_utils.cpp
index 365df63864..7cb5176d5a 100644
--- a/plugins/MetaContacts/src/meta_utils.cpp
+++ b/plugins/MetaContacts/src/meta_utils.cpp
@@ -230,7 +230,6 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default)
DBCONTACTWRITESETTING cws;
DWORD metaID, num_contacts;
char buffer[512], szId[40];
- TCHAR buffer2[512];
WORD status;
HANDLE most_online;
@@ -337,8 +336,9 @@ BOOL Meta_Assign(HANDLE src, HANDLE dest, BOOL set_as_default)
// write status string
strcpy(buffer, "StatusString");
strcat(buffer, szId);
- Meta_GetStatusString(status, buffer2, 512);
- db_set_ts(dest, META_PROTO, buffer, buffer2);
+
+ TCHAR *szStatus = (TCHAR*) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)status, GSMDF_TCHAR);
+ db_set_ts(dest, META_PROTO, buffer, szStatus);
// Write the link in the contact
db_set_dw(src, META_PROTO, META_LINK, metaID);
@@ -1148,48 +1148,6 @@ void Meta_SetGroup(HANDLE hContact) {
}
}
-void Meta_GetStatusString(int status, TCHAR *buf, size_t size)
-{
- switch(status) {
- case ID_STATUS_OFFLINE:
- _tcsncpy(buf, TranslateT("Offline"), size);
- break;
- case ID_STATUS_ONLINE:
- _tcsncpy(buf, TranslateT("Online"), size);
- break;
- case ID_STATUS_AWAY:
- _tcsncpy(buf, TranslateT("Away"), size);
- break;
- case ID_STATUS_DND:
- _tcsncpy(buf, TranslateT("DND"), size);
- break;
- case ID_STATUS_NA:
- _tcsncpy(buf, TranslateT("N/A"), size);
- break;
- case ID_STATUS_OCCUPIED:
- _tcsncpy(buf, TranslateT("Occupied"), size);
- break;
- case ID_STATUS_FREECHAT:
- _tcsncpy(buf, TranslateT("Free to Chat"), size);
- break;
- case ID_STATUS_INVISIBLE:
- _tcsncpy(buf, TranslateT("Invisible"), size);
- break;
- case ID_STATUS_ONTHEPHONE:
- _tcsncpy(buf, TranslateT("On the Phone"), size);
- break;
- case ID_STATUS_OUTTOLUNCH:
- _tcsncpy(buf, TranslateT("Out to Lunch"), size);
- break;
- case ID_STATUS_IDLE:
- _tcsncpy(buf, TranslateT("IDLE"), size);
- break;
- default:
- _tcsncpy(buf, TranslateT("Unknown"), size);
- break;
- }
-}
-
int Meta_SuppressStatus(BOOL suppress)
{
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
diff --git a/plugins/MetaContacts/src/metacontacts.h b/plugins/MetaContacts/src/metacontacts.h
index e5139a5e0b..8843e9c1b8 100644
--- a/plugins/MetaContacts/src/metacontacts.h
+++ b/plugins/MetaContacts/src/metacontacts.h
@@ -96,7 +96,6 @@ int Meta_SetHandles(void);
int Meta_UnhideLinkedContacts(void);
int Meta_GetContactNumber(HANDLE hContact);
HANDLE Meta_GetContactHandle(HANDLE hMeta, int contact_number);
-void Meta_GetStatusString(int status, TCHAR *buf, size_t size);
void Meta_RestoreGroup(HANDLE hContact);
void Meta_SetGroup(HANDLE hContact);
int Meta_HideMetaContacts(int hide);