summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-31 16:50:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-31 16:50:53 +0000
commitd57b6799dac75f3c428393666d079fe59361c4b5 (patch)
tree4bcb3de1b241e89c4dca03bd8b031bc17dbe9b56 /plugins
parent85e27141c915d057deeb4be6c4bc81d387c39be6 (diff)
fixes for PS_SETAWAYMSG calls
git-svn-id: http://svn.miranda-ng.org/main/trunk@13939 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/CmdLine/src/mimcmd_handlers.cpp3
-rw-r--r--plugins/MirFox/src/MirandaUtils.cpp2
-rw-r--r--plugins/NewAwaySysMod/src/AwaySys.cpp8
-rw-r--r--plugins/NewAwaySysMod/src/Client.cpp6
-rw-r--r--plugins/NewAwaySysMod/src/Common.h6
5 files changed, 13 insertions, 12 deletions
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp
index 5e91e041eb..e26b134d7e 100644
--- a/plugins/CmdLine/src/mimcmd_handlers.cpp
+++ b/plugins/CmdLine/src/mimcmd_handlers.cpp
@@ -369,7 +369,8 @@ void HandleAwayMsgCommand(PCommand command, TArgument *argv, int argc, PReply re
if ((CallProtoService(protocol, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) != 0) //if the protocol supports away messages
{
status = CallProtoService(protocol, PS_GETSTATUS, 0, 0);
- res = CallProtoService(protocol, PS_SETAWAYMSG, status, (LPARAM) awayMsg);
+ ptrW wszAwayMsg(mir_a2u(awayMsg));
+ res = CallProtoService(protocol, PS_SETAWAYMSG, status, (LPARAM)wszAwayMsg);
PrettyStatusMode(status, pn, sizeof(pn));
if (res)
szReply.AppendFormat(Translate("Failed to set '%S' status message to '%s' (status is '%s')."), accounts[i]->tszAccountName , awayMsg, pn);
diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp
index e13f507caa..8feae7a960 100644
--- a/plugins/MirFox/src/MirandaUtils.cpp
+++ b/plugins/MirFox/src/MirandaUtils.cpp
@@ -371,7 +371,7 @@ void MirandaUtils::setStatusOnAccount(ActionThreadArgStruct* args)
INT_PTR result = -1;
if (!(CallProtoService(args->accountSzModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_INDIVMODEMSG))
- result = CallProtoService(args->accountSzModuleName, PS_SETAWAYMSG, (WPARAM)status, (LPARAM)args->userActionSelection);
+ result = CallProtoService(args->accountSzModuleName, PS_SETAWAYMSG, status, (LPARAM)args->userActionSelection);
MirandaAccount* mirandaAccount = args->mirfoxDataPtr->getMirandaAccountPtrBySzModuleName(args->accountSzModuleName);
TCHAR* tszAccountName = NULL;
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp
index 7649a3f68a..4343b9878d 100644
--- a/plugins/NewAwaySysMod/src/AwaySys.cpp
+++ b/plugins/NewAwaySysMod/src/AwaySys.cpp
@@ -143,13 +143,13 @@ int StatusMsgReq(WPARAM wParam, LPARAM lParam, CString &szProto)
return 0;
}
if (CContactSettings(iMode, hContactForSettings).Ignore) {
- CallAllowedPS_SETAWAYMSG(szProto, iMode, ""); // currently NULL makes ICQ to ignore _any_ further status message requests until the next PS_SETAWAYMSG, so i can't use it here..
+ CallAllowedPS_SETAWAYMSG(szProto, iMode, _T("")); // currently NULL makes ICQ to ignore _any_ further status message requests until the next PS_SETAWAYMSG, so i can't use it here..
return 0; // move along, sir
}
- if (iMode) { // if it's not an xstatus message request
- CallAllowedPS_SETAWAYMSG(szProto, iMode, (char*)_T2A(GetDynamicStatMsg(hFoundContact, szProto, lParam)));
- }
+ if (iMode) // if it's not an xstatus message request
+ CallAllowedPS_SETAWAYMSG(szProto, iMode, GetDynamicStatMsg(hFoundContact, szProto, lParam));
+
// COptPage PopupNotifyData(g_PopupOptPage);
// PopupNotifyData.DBToMem();
VarParseData.szProto = szProto;
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp
index 74244b3d60..22ff666fe5 100644
--- a/plugins/NewAwaySysMod/src/Client.cpp
+++ b/plugins/NewAwaySysMod/src/Client.cpp
@@ -47,7 +47,7 @@ void __cdecl UpdateMsgsThreadProc(void *)
TCString CurMsg(GetDynamicStatMsg(INVALID_CONTACT_ID, p->szModuleName));
if ((TCString)g_ProtoStates[p->szModuleName].CurStatusMsg != (const TCHAR*)CurMsg) { // if the message has changed
g_ProtoStates[p->szModuleName].CurStatusMsg = CurMsg;
- CallAllowedPS_SETAWAYMSG(p->szModuleName, Status, (char*)_T2A(CurMsg));
+ CallAllowedPS_SETAWAYMSG(p->szModuleName, Status, CurMsg);
}
}
}
@@ -86,7 +86,7 @@ void ChangeProtoMessages(char* szProto, int iMode, TCString &Msg)
if (Msg == NULL)
CurMsg = GetDynamicStatMsg(INVALID_CONTACT_ID, szProto);
- CallAllowedPS_SETAWAYMSG(szProto, iMode, (char*)_T2A(CurMsg));
+ CallAllowedPS_SETAWAYMSG(szProto, iMode, CurMsg);
g_ProtoStates[szProto].CurStatusMsg = CurMsg;
}
else { // change message of all protocols
@@ -99,7 +99,7 @@ void ChangeProtoMessages(char* szProto, int iMode, TCString &Msg)
if (Msg == NULL)
CurMsg = GetDynamicStatMsg(INVALID_CONTACT_ID, p->szModuleName);
- CallAllowedPS_SETAWAYMSG(p->szModuleName, iMode, (char*)_T2A(CurMsg));
+ CallAllowedPS_SETAWAYMSG(p->szModuleName, iMode, CurMsg);
g_ProtoStates[p->szModuleName].CurStatusMsg = CurMsg;
}
}
diff --git a/plugins/NewAwaySysMod/src/Common.h b/plugins/NewAwaySysMod/src/Common.h
index cb8af145fa..c8a99eef6d 100644
--- a/plugins/NewAwaySysMod/src/Common.h
+++ b/plugins/NewAwaySysMod/src/Common.h
@@ -327,10 +327,10 @@ static __inline int LogMessage(const char *Format, ...)
return CallService(MS_NETLIB_LOG, NULL, (LPARAM)szText);
}
-__inline int CallAllowedPS_SETAWAYMSG(const char *szProto, int iMode, const char *szMsg)
+__inline int CallAllowedPS_SETAWAYMSG(const char *szProto, int iMode, const TCHAR *szMsg)
{ // we must use this function everywhere we want to call PS_SETAWAYMSG, otherwise NAS won't allow to change the message!
- LogMessage("PS_SETAWAYMSG called by NAS. szProto=%s, Status=%d, Msg:\n%s", szProto, iMode, szMsg ? szMsg : "NULL");
- return CallProtoService(szProto, PS_SETAWAYMSG, (WPARAM)iMode, (LPARAM)szMsg);
+ LogMessage("PS_SETAWAYMSG called by NAS. szProto=%s, Status=%d, Msg:\n%S", szProto, iMode, szMsg ? szMsg : _T("NULL"));
+ return CallProtoService(szProto, PS_SETAWAYMSG, iMode, (LPARAM)szMsg);
}
static __inline int my_variables_showhelp(HWND hwndDlg, UINT uIDEdit, int flags = 0, char *szSubjectDesc = NULL, char *szExtraDesc = NULL)