diff options
author | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2010-06-16 20:40:57 +0000 |
---|---|---|
committer | (no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> | 2010-06-16 20:40:57 +0000 |
commit | 6c12bafe804c7d20056a93c72cbe935c10802f9a (patch) | |
tree | ff8aaffaa9cd3cef422f4f4d075d49fe2006c00d | |
parent | 1af4404ec3ac1bc9355e6381bdfcac53a15e5121 (diff) |
- 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
-rw-r--r-- | tipper/m_tipper.h | 22 | ||||
-rw-r--r-- | tipper/popwin.cpp | 26 | ||||
-rw-r--r-- | tipper/tipper.cpp | 2 | ||||
-rw-r--r-- | tipper/tipper_9.vcproj | 5 |
4 files changed, 16 insertions, 39 deletions
diff --git a/tipper/m_tipper.h b/tipper/m_tipper.h index e5a5a16..a2b5abf 100644 --- a/tipper/m_tipper.h +++ b/tipper/m_tipper.h @@ -17,25 +17,3 @@ typedef struct { // wParam not used
// lParam = (DBVTranslation *)translation
#define MS_TIPPER_ADDTRANSLATION "Tipper/AddTranslation"
-
-
-/////////////////////
-///// This service is NOT implemented by tipper - it is to be implemented by plugins that extend the basic away message services
-///// so that tipper has a common interface to use
-////////////////////
-
-// wParam - (WORD)wStatus
-// lParam - (char *)szProto
-// returns (char *)szStatusMessage
-#define MS_AWAY_GETPROTOSTATUSMESSAGE "Away/GetProtoStatusMsg"
-
-// wParam - (WORD)wStatus
-// lParam - (wchar_t *)swzProto
-// returns (wchar_t *)swzStatusMessage
-#define MS_AWAY_GETPROTOSTATUSMESSAGEW "Away/GetProtoStatusMsgW"
-
-#ifdef _UNICODE
-#define MS_AWAY_GETPROTOSTATUSMESSAGET MS_AWAY_GETPROTOSTATUSMESSAGEW
-#else
-#define MS_AWAY_GETPROTOSTATUSMESSAGET MS_AWAY_GETPROTOSTATUSMESSAGE
-#endif
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);
diff --git a/tipper/tipper.cpp b/tipper/tipper.cpp index 59a5117..cfa08e9 100644 --- a/tipper/tipper.cpp +++ b/tipper/tipper.cpp @@ -53,7 +53,7 @@ extern "C" BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LP {
hInst = hModule;
DisableThreadLibraryCalls(hInst);
- return TRUE;
+ return TRUE;
}
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
diff --git a/tipper/tipper_9.vcproj b/tipper/tipper_9.vcproj index 296e2ee..54b8ae5 100644 --- a/tipper/tipper_9.vcproj +++ b/tipper/tipper_9.vcproj @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="9.00"
+ Version="9,00"
Name="tipper"
- ProjectGUID="{2C818919-A38F-44FF-BD91-A6A204AC592A}"
+ ProjectGUID="{2CFFE6E3-FD83-4E6E-9D7A-8DAA59CC9B18}"
RootNamespace="tipper"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
@@ -404,7 +404,6 @@ Name="VCLinkerTool"
IgnoreImportLibrary="true"
AdditionalDependencies="comctl32.lib wsock32.lib"
- OutputFile="c:\Miranda IM\plugins\tipper.dll"
GenerateManifest="false"
GenerateDebugInformation="true"
SubSystem="2"
|