From 6c12bafe804c7d20056a93c72cbe935c10802f9a Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Wed, 16 Jun 2010 20:40:57 +0000 Subject: - fix for the Unicode status messages - removed MS_AWAY_GETPROTOSTATUSMESSAGE git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@523 4f64403b-2f21-0410-a795-97e2b3489a10 --- tipper/popwin.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'tipper/popwin.cpp') diff --git a/tipper/popwin.cpp b/tipper/popwin.cpp index e1a6486..26afd34 100644 --- a/tipper/popwin.cpp +++ b/tipper/popwin.cpp @@ -100,20 +100,20 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if(status >= ID_STATUS_OFFLINE && status <= ID_STATUS_IDLE) { TCHAR *swzText = 0; char *status_msg = 0; - if(ServiceExists(MS_AWAY_GETPROTOSTATUSMESSAGET)) { - TCHAR *temp = (TCHAR *)CallService(MS_AWAY_GETPROTOSTATUSMESSAGET, (LPARAM)status, (WPARAM)pwd->clcit.proto); - swzText = _tcsdup(temp); - mir_free(temp); - } else if(ServiceExists(MS_AWAY_GETPROTOSTATUSMESSAGE)) { - status_msg = (char *)CallService(MS_AWAY_GETPROTOSTATUSMESSAGE, (LPARAM)status, (WPARAM)pwd->clcit.proto); - } else { - char svc[256]; - mir_snprintf(svc, 256, "%s%s", pwd->clcit.proto, PS_GETMYAWAYMSG); - if(ServiceExists(svc)) { - status_msg = (char *)CallService(svc, status, 0); - } else - status_msg = (char *)CallService(MS_AWAYMSG_GETSTATUSMSG, status, 0); + + // supported by protocols from Miranda 0.8+ + char svc[256]; + mir_snprintf(svc, 256, "%s%s", pwd->clcit.proto, PS_GETMYAWAYMSG); + if ( ServiceExists( svc )) { + TCHAR* p = (TCHAR *)CallProtoService(pwd->clcit.proto, PS_GETMYAWAYMSG, 0, SGMA_TCHAR); + if ( !p ) + status_msg = (char *)CallProtoService(pwd->clcit.proto, PS_GETMYAWAYMSG, 0, 0); + else { + swzText = _tcsdup( p ); + mir_free( p ); + } } + else status_msg = (char *)CallService(MS_AWAYMSG_GETSTATUSMSG, status, 0); if(status_msg && status_msg[0]) swzText = a2t(status_msg); -- cgit v1.2.3