diff options
author | George Hazan <george.hazan@gmail.com> | 2012-05-28 14:38:30 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-05-28 14:38:30 +0000 |
commit | 9728260c2851d1e45ca79237af6bda64db467045 (patch) | |
tree | 2d5f5c4719b8200c358d2883fa56e75c66a68871 /plugins/TipperYM/subst.cpp | |
parent | c69a4eeaf118719b3cc7d8e762696e131fe969f2 (diff) |
- improved status messaging retrieving
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@211 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TipperYM/subst.cpp')
-rw-r--r-- | plugins/TipperYM/subst.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/plugins/TipperYM/subst.cpp b/plugins/TipperYM/subst.cpp index 4fe91dff2f..bc99aee44b 100644 --- a/plugins/TipperYM/subst.cpp +++ b/plugins/TipperYM/subst.cpp @@ -834,9 +834,6 @@ void TruncateString(TCHAR *swzText) TCHAR *GetProtoStatusMessage(char *szProto, WORD wStatus)
{
- TCHAR *swzText = NULL;
- char *tmpMsg = NULL;
-
if (!szProto || wStatus == ID_STATUS_OFFLINE)
return NULL;
@@ -845,20 +842,24 @@ TCHAR *GetProtoStatusMessage(char *szProto, WORD wStatus) if (!(flags & Proto_Status2Flag(wStatus)))
return NULL;
- swzText = (TCHAR *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
- if ((INT_PTR)swzText != CALLSERVICE_NOTFOUND)
+ TCHAR *swzText = (TCHAR *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
+ if ((INT_PTR)swzText == CALLSERVICE_NOTFOUND)
{
- if (swzText == NULL)
- tmpMsg = ( char* )CallProtoService(szProto, PS_GETMYAWAYMSG, 0, 0);
+ swzText = (TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, wStatus, 0);
}
- else swzText = ( TCHAR* )CallService(MS_AWAYMSG_GETSTATUSMSGT, wStatus, 0);
-
- if (tmpMsg && (INT_PTR)tmpMsg != CALLSERVICE_NOTFOUND)
+#ifdef _UNICODE
+ else if (swzText == NULL)
{
- swzText = mir_a2t(tmpMsg);
- mir_free(tmpMsg);
+ // try to use service without SGMA_TCHAR
+ char *tmpMsg = (char *)CallProtoService(szProto, PS_GETMYAWAYMSG, 0, 0);
+ if (tmpMsg && (INT_PTR)tmpMsg != CALLSERVICE_NOTFOUND)
+ {
+ swzText = mir_a2t(tmpMsg);
+ mir_free(tmpMsg);
+ }
}
-
+#endif
+
if (swzText && !swzText[0])
{
mir_free(swzText);
|