diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2013-09-30 19:51:19 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2013-09-30 19:51:19 +0000 |
commit | 334f2948a725ab44b8c856242c2399f920d8ee7b (patch) | |
tree | b6293448b663284494b45c2b306b760f13e48e12 /plugins/KeyboardNotify/src/main.cpp | |
parent | b4b70001d3199c2c81868e9a6049cc22352aa795 (diff) |
KeyboardNotify: cleanup
Jabber: Fixed error message when AdvaImg not found
git-svn-id: http://svn.miranda-ng.org/main/trunk@6280 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/KeyboardNotify/src/main.cpp')
-rw-r--r-- | plugins/KeyboardNotify/src/main.cpp | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 5b046fceeb..ad3507975a 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -26,13 +26,6 @@ #define NCONVERS_BLINKID ((HANDLE)123456) //nconvers' random identifier used to flash an icon for "incoming message" on contact list
-#ifndef WM_XBUTTONDBLCLK
-#define WM_XBUTTONDBLCLK 0x020D
-#endif
-#ifndef WM_NCXBUTTONDBLCLK
-#define WM_NCXBUTTONDBLCLK 0x00AD
-#endif
-
HINSTANCE hInst;
@@ -372,13 +365,14 @@ BOOL checkMsgTimestamp(HANDLE hEventCurrent, DWORD timestampCurrent) if (!bFlashIfMsgOlder)
return TRUE;
- DBEVENTINFO einfo = { sizeof(einfo) };
for (HANDLE hEvent = db_event_prev(hEventCurrent); hEvent; hEvent = db_event_prev(hEvent)) {
- db_event_get(hEvent, &einfo);
- if ((einfo.timestamp + wSecondsOlder) <= timestampCurrent)
- return TRUE;
- if (einfo.eventType == EVENTTYPE_MESSAGE)
- return FALSE;
+ DBEVENTINFO einfo = { sizeof(einfo) };
+ if(!db_event_get(hEvent, &einfo)) {
+ if ((einfo.timestamp + wSecondsOlder) <= timestampCurrent)
+ return TRUE;
+ if (einfo.eventType == EVENTTYPE_MESSAGE)
+ return FALSE;
+ }
}
return TRUE;
@@ -409,7 +403,6 @@ BOOL checkStatus(char *szProto) BOOL checkXstatus(char *szProto)
{
int status=0;
- CUSTOM_STATUS xstatus = { sizeof(CUSTOM_STATUS) };
if (!szProto)
return checkGlobalXstatus();
@@ -419,6 +412,7 @@ BOOL checkXstatus(char *szProto) if (!ProtoList.protoInfo[i].xstatus.count) return TRUE;
// Retrieve xstatus for protocol
+ CUSTOM_STATUS xstatus = { sizeof(CUSTOM_STATUS) };
xstatus.flags = CSSF_MASK_STATUS;
xstatus.status = &status;
CallProtoService(ProtoList.protoInfo[i].szProto, PS_GETCUSTOMSTATUSEX, 0, (LPARAM)&xstatus);
@@ -438,8 +432,7 @@ static int PluginMessageEventHook(WPARAM wParam, LPARAM lParam) //get DBEVENTINFO without pBlob
DBEVENTINFO einfo = { sizeof(einfo) };
- db_event_get(hEvent, &einfo);
- if (!(einfo.flags & DBEF_SENT))
+ if (!db_event_get(hEvent, &einfo) && !(einfo.flags & DBEF_SENT))
if ((einfo.eventType == EVENTTYPE_MESSAGE && bFlashOnMsg && checkOpenWindow(hContact) && checkMsgTimestamp(hEvent, einfo.timestamp)) ||
(einfo.eventType == EVENTTYPE_URL && bFlashOnURL) ||
(einfo.eventType == EVENTTYPE_FILE && bFlashOnFile) ||
@@ -468,9 +461,8 @@ static VOID CALLBACK ReminderTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DW return;
}
- DBEVENTINFO einfo = { sizeof(einfo) };
for (nIndex = 0; !bReminderDisabled && (pCLEvent = (CLISTEVENT*)CallService(MS_CLIST_GETEVENT, -1, nIndex)); nIndex++) {
- einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);
+ DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);
if ((einfo.eventType == EVENTTYPE_MESSAGE && bFlashOnMsg) ||
(einfo.eventType == EVENTTYPE_URL && bFlashOnURL) ||
@@ -589,12 +581,10 @@ void createProcessList(void) void destroyProcessList(void)
{
- unsigned int i, count;
-
- count = ProcessList.count;
+ unsigned int count = ProcessList.count;
ProcessList.count = 0;
- for (i=0; i < count; i++)
+ for (unsigned int i=0; i < count; i++)
if (ProcessList.szFileName[i])
free(ProcessList.szFileName[i]);
@@ -673,9 +663,9 @@ void LoadSettings(void) void GetWindowsVersion(void)
{
OSVERSIONINFOEX osvi = { sizeof(OSVERSIONINFOEX) };
- BOOL bOsVersionInfoEx;
+ BOOL bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) &osvi);
- if (!(bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) &osvi))) {
+ if (!bOsVersionInfoEx) {
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (!GetVersionEx((OSVERSIONINFO *)&osvi))
osvi.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS;
@@ -1022,10 +1012,9 @@ void countUnopenEvents(int *msgCount, int *fileCount, int *urlCount, int *otherC {
int nIndex;
CLISTEVENT *pCLEvent;
- DBEVENTINFO einfo = { sizeof(einfo) };
for (nIndex = 0; pCLEvent = (CLISTEVENT*)CallService(MS_CLIST_GETEVENT, -1, nIndex); nIndex++) {
- einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);
+ DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact);
if (metaCheckProtocol(einfo.szModule, pCLEvent->hContact, einfo.eventType))
switch (einfo.eventType) {
|