summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-27 13:03:16 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-27 13:03:16 +0000
commitffc370d5135d3c4a4d08f5f5990c7b347c318e49 (patch)
treeb0e5c1d5bf922af61c10d0eb0b088081935682dd /plugins
parent6d8eaf6e4309b3b6f371b8ebacd02b35b7060402 (diff)
MS_AWAYMSG_GETSTATUSMSGW service added to NAS
git-svn-id: http://svn.miranda-ng.org/main/trunk@8290 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/NewAwaySysMod/src/AwaySys.cpp5
-rw-r--r--plugins/NewAwaySysMod/src/Services.cpp17
-rw-r--r--plugins/NewAwaySysMod/src/Services.h1
-rw-r--r--plugins/NewAwaySysMod/src/version.h2
4 files changed, 15 insertions, 10 deletions
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp
index cad89b6c49..2ee9c2832a 100644
--- a/plugins/NewAwaySysMod/src/AwaySys.cpp
+++ b/plugins/NewAwaySysMod/src/AwaySys.cpp
@@ -680,12 +680,15 @@ int MirandaLoaded(WPARAM, LPARAM)
CreateServiceFunction(MS_AWAYSYS_AUTOREPLY_ON, srvAutoreplyOn);
CreateServiceFunction(MS_AWAYSYS_AUTOREPLY_OFF, srvAutoreplyOff);
CreateServiceFunction(MS_AWAYSYS_AUTOREPLY_USEDEFAULT, srvAutoreplyUseDefault);
+ CreateServiceFunction(MS_AWAYMSG_GETSTATUSMSG, GetStatusMsg);
+ CreateServiceFunction(MS_AWAYMSG_GETSTATUSMSGW, GetStatusMsgW);
+
CreateServiceFunction(MS_NAS_GETSTATEA, GetStateA);
CreateServiceFunction(MS_NAS_SETSTATEA, SetStateA);
CreateServiceFunction(MS_NAS_GETSTATEW, GetStateW);
CreateServiceFunction(MS_NAS_SETSTATEW, SetStateW);
CreateServiceFunction(MS_NAS_INVOKESTATUSWINDOW, InvokeStatusWindow);
- CreateServiceFunction(MS_AWAYMSG_GETSTATUSMSG, GetStatusMsg);
+
// and old AwaySysMod service, for compatibility reasons
CreateServiceFunction(MS_AWAYSYS_SETSTATUSMODE, SetStatusMode);
diff --git a/plugins/NewAwaySysMod/src/Services.cpp b/plugins/NewAwaySysMod/src/Services.cpp
index 5696b98766..bce50f84d3 100644
--- a/plugins/NewAwaySysMod/src/Services.cpp
+++ b/plugins/NewAwaySysMod/src/Services.cpp
@@ -53,18 +53,19 @@ __inline void PSSetStatus(char *szProto, WORD Status, int bNoClistSetStatusMode
INT_PTR GetStatusMsg(WPARAM wParam, LPARAM)
{
LogMessage("MS_AWAYMSG_GETSTATUSMSG called. status=%d", wParam);
- CString Msg(_T2A(GetDynamicStatMsg(INVALID_CONTACT_ID, NULL, 0, wParam)));
- char *szMsg;
- if (Msg == NULL) // it's ok to return NULL, so we'll do it
- szMsg = NULL;
- else {
- szMsg = (char*)mir_alloc(Msg.GetLen() + 1);
- lstrcpyA(szMsg, Msg);
- }
+ char *szMsg = mir_t2a(GetDynamicStatMsg(INVALID_CONTACT_ID, NULL, 0, wParam));
LogMessage("returned szMsg:\n%s", szMsg ? szMsg : "NULL");
return (INT_PTR)szMsg;
}
+INT_PTR GetStatusMsgW(WPARAM wParam, LPARAM)
+{
+ LogMessage("MS_AWAYMSG_GETSTATUSMSG called. status=%d", wParam);
+ WCHAR *szMsg = mir_t2u(GetDynamicStatMsg(INVALID_CONTACT_ID, NULL, 0, wParam));
+ LogMessage("returned szMsg:\n%S", szMsg ? szMsg : L"NULL");
+ return (INT_PTR)szMsg;
+}
+
// wParam = int iMode
// lParam = char* szMsg, may be null - then we need to use the default message
INT_PTR SetStatusMode(WPARAM wParam, LPARAM lParam) // called by GamerStatus and StatCtrl
diff --git a/plugins/NewAwaySysMod/src/Services.h b/plugins/NewAwaySysMod/src/Services.h
index 903bbd3784..2aac3c7cc0 100644
--- a/plugins/NewAwaySysMod/src/Services.h
+++ b/plugins/NewAwaySysMod/src/Services.h
@@ -18,6 +18,7 @@
*/
INT_PTR GetStatusMsg(WPARAM wParam, LPARAM lParam);
+INT_PTR GetStatusMsgW(WPARAM wParam, LPARAM lParam);
INT_PTR SetStatusMode(WPARAM wParam, LPARAM lParam);
// int IgnoreNextStatusChange(WPARAM wParam, LPARAM lParam);
INT_PTR GetStateA(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/NewAwaySysMod/src/version.h b/plugins/NewAwaySysMod/src/version.h
index c6783a1bcc..5335e9900e 100644
--- a/plugins/NewAwaySysMod/src/version.h
+++ b/plugins/NewAwaySysMod/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 4
#define __RELEASE_NUM 0
-#define __BUILD_NUM 2
+#define __BUILD_NUM 3
#include <stdver.h>