diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2013-08-15 17:25:49 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2013-08-15 17:25:49 +0000 |
commit | b017d6e495ed9ed7c1ae781086b3f705ea8efed0 (patch) | |
tree | 949111512a198ff9aae9487f43e2155fabd78ba1 /plugins/NewEventNotify/src/main.cpp | |
parent | c97b20dc06e8d7c848e7ec20590243ffd5f011c4 (diff) |
translation fix and minor cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@5705 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewEventNotify/src/main.cpp')
-rw-r--r-- | plugins/NewEventNotify/src/main.cpp | 48 |
1 files changed, 2 insertions, 46 deletions
diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp index 82e282302c..80d3975a66 100644 --- a/plugins/NewEventNotify/src/main.cpp +++ b/plugins/NewEventNotify/src/main.cpp @@ -24,7 +24,6 @@ #include "neweventnotify.h"
-int g_IsSrmmServiceAvail = 0;
int g_IsSrmmWindowAPI = 0;
extern PLUGIN_DATA* PopupList[20];
@@ -64,7 +63,6 @@ int HookedNewEvent(WPARAM wParam, LPARAM lParam) {
HANDLE hContact = (HANDLE)wParam;
PLUGIN_DATA* pdata;
- DBEVENTTYPEDESCR* pei;
//are popups currently enabled?
if (pluginOptions.bDisable)
@@ -85,7 +83,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM lParam) //custom database event types
if (ServiceExists(MS_DB_EVENT_GETTYPE))
{
- pei = (DBEVENTTYPEDESCR*)CallService(MS_DB_EVENT_GETTYPE, (WPARAM)dbe.szModule, (LPARAM)dbe.eventType);
+ DBEVENTTYPEDESCR *pei = (DBEVENTTYPEDESCR*)CallService(MS_DB_EVENT_GETTYPE, (WPARAM)dbe.szModule, (LPARAM)dbe.eventType);
if (pei && pei->cbSize >= DBEVENTTYPEDESCR_SIZE && pei->flags & DETF_NONOTIFY)
// ignore events according to flags
return 0;
@@ -125,7 +123,7 @@ int HookedNewEvent(WPARAM wParam, LPARAM lParam) }
//---Called when all the modules are loaded
-int HookedInit(WPARAM wParam, LPARAM lParam)
+int HookedInit(WPARAM, LPARAM)
{
hHookedNewEvent = HookEvent(ME_DB_EVENT_ADDED, HookedNewEvent);
// Plugin sweeper support
@@ -137,11 +135,6 @@ int HookedInit(WPARAM wParam, LPARAM lParam) else
g_IsSrmmWindowAPI = 0;
- if (ServiceExists(MS_MSG_MOD_MESSAGEDIALOGOPENED))
- g_IsSrmmServiceAvail = 1;
- else
- g_IsSrmmServiceAvail = 0;
-
return 0;
}
@@ -215,41 +208,4 @@ int CheckMsgWnd(HANDLE hContact) if (mwd.hwndWindow != NULL && (mwd.uState & MSG_WINDOW_STATE_EXISTS)) return 1;
}
}
- if (g_IsSrmmServiceAvail) { // use the service provided by tabSRMM
- if (CallService(MS_MSG_MOD_MESSAGEDIALOGOPENED, (WPARAM)hContact, 0))
- return 1;
- else
- return 0;
- }
- else
- { // old way: find it by using the window class & title
- TCHAR newtitle[256];
- char *szProto;
- TCHAR *contactName, *szStatus;
-
- szProto = GetContactProto(hContact);
- contactName = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
- szStatus = (TCHAR*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, szProto?db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE):ID_STATUS_OFFLINE, GSMDF_TCHAR);
-
- // vj: This code was added by preeze and it does not work:
- // vlko: it maybe work with other plugins
- mir_sntprintf(newtitle, SIZEOF(newtitle), _T("%s (%s)"), contactName, szStatus);
- if(FindWindow(_T("TMsgWindow"), newtitle))
- return 2;
-
- mir_sntprintf(newtitle, SIZEOF(newtitle), _T("[%s (%s)]"), contactName, szStatus);
- if(FindWindow(_T("TfrmContainer"), newtitle))
- return 1;
-
- // vj: I have restored this code from original plugin's source: (NewEventNotify 0.0.4)
- mir_sntprintf(newtitle, SIZEOF(newtitle), _T("%s (%s): %s"), contactName, szStatus, TranslateT("Message Session"));
- if(FindWindow(_T("#32770"), newtitle)) // JK, this works for old SRMMs (1.0.4.x) and for mine SRMMJ
- return 1;
-
- mir_sntprintf(newtitle, SIZEOF(newtitle), _T("%s (%s): %s"), contactName, szStatus, TranslateT("Message Received"));
- if(FindWindow(_T("#32770"), newtitle))
- return 2;
-
- return 0;
- }
}
\ No newline at end of file |