diff options
author | George Hazan <george.hazan@gmail.com> | 2016-01-28 13:05:28 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-01-28 13:05:28 +0000 |
commit | a040f3a8dbcc17d8a3a50a9594b3226dce28788c (patch) | |
tree | 8c033c939982d3f58e3d81fb721a94b5840a5250 | |
parent | 3ffb500915c8b5a9e02d2b0136c20e9519d4f983 (diff) |
- local structure declarations moved to the global header;
- structure definition optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@16178 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | include/m_clistint.h | 10 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clistevents.cpp | 39 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_commonprototypes.h | 4 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clistevents.cpp | 44 | ||||
-rw-r--r-- | src/mir_app/src/clistevents.cpp | 103 |
5 files changed, 91 insertions, 109 deletions
diff --git a/include/m_clistint.h b/include/m_clistint.h index 5d0143c529..8efc5bc886 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -165,9 +165,17 @@ struct ClcDataBase int filterSearch;
};
+struct CListEvent : public CLISTEVENT
+{
+ int imlIconIndex;
+ int flashesDone;
+
+ int menuId;
+ int imlIconOverlayIndex;
+};
+
struct ClcContact;
struct ClcData;
-struct CListEvent;
struct ClcCacheEntry;
struct trayIconInfo_t
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index 0b365ea153..6ea11cdc73 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -48,15 +48,6 @@ void EventArea_ConfigureEventArea(); HWND g_hwndEventArea = 0;
-struct CListEvent {
- int imlIconIndex;
- int flashesDone;
- CLISTEVENT cle;
-
- int menuId;
- int imlIconOverlayIndex;
-};
-
static CListEvent *event;
static int eventCount;
static int disableTrayFlash;
@@ -86,7 +77,7 @@ static CLISTEVENT* MyGetEvent(int iSelection) for (int i = 0; i < pcli->events.count; i++) {
CListEvent *p = pcli->events.items[i];
if (p->menuId == iSelection)
- return &p->cle;
+ return p;
}
return NULL;
}
@@ -104,31 +95,31 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle) if (p == NULL)
return NULL;
- if (p->cle.hContact != 0 && p->cle.hDbEvent != 1 && !(p->cle.flags & CLEF_ONLYAFEW)) {
+ if (p->hContact != 0 && p->hDbEvent != 1 && !(p->flags & CLEF_ONLYAFEW)) {
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA | MIIM_BITMAP | MIIM_ID;
- if (p->cle.pszService &&
- (!strncmp("SRMsg/ReadMessage", p->cle.pszService, _countof("SRMsg/ReadMessage")) ||
- !strncmp("GChat/DblClickEvent", p->cle.pszService, _countof("GChat/DblClickEvent"))))
+ if (p->pszService &&
+ (!strncmp("SRMsg/ReadMessage", p->pszService, _countof("SRMsg/ReadMessage")) ||
+ !strncmp("GChat/DblClickEvent", p->pszService, _countof("GChat/DblClickEvent"))))
{
// dup check only for msg events
for (int j = 0; j < GetMenuItemCount(g_CluiData.hMenuNotify); j++) {
if (GetMenuItemInfo(g_CluiData.hMenuNotify, j, TRUE, &mii) != 0) {
NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
- if (nmi != 0 && (HANDLE)nmi->hContact == (HANDLE)p->cle.hContact && nmi->iIcon == p->imlIconIndex)
+ if (nmi != 0 && (HANDLE)nmi->hContact == (HANDLE)p->hContact && nmi->iIcon == p->imlIconIndex)
return p;
}
}
}
- char *szProto = GetContactProto(p->cle.hContact);
- TCHAR *szName = pcli->pfnGetContactDisplayName(p->cle.hContact, 0);
+ char *szProto = GetContactProto(p->hContact);
+ TCHAR *szName = pcli->pfnGetContactDisplayName(p->hContact, 0);
if (szProto && szName) {
NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) malloc(sizeof(struct NotifyMenuItemExData));
if (nmi) {
TCHAR szBuffer[128];
- TCHAR* szStatus = pcli->pfnGetStatusModeDescription(db_get_w(p->cle.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
+ TCHAR* szStatus = pcli->pfnGetStatusModeDescription(db_get_w(p->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
TCHAR szwProto[64];
MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64);
szwProto[63] = 0;
@@ -136,10 +127,10 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle) szBuffer[127] = 0;
AppendMenu(g_CluiData.hMenuNotify, MF_BYCOMMAND | MF_STRING, g_CluiData.wNextMenuID, szBuffer);
mii.hbmpItem = HBMMENU_CALLBACK;
- nmi->hContact = p->cle.hContact;
+ nmi->hContact = p->hContact;
nmi->iIcon = p->imlIconIndex;
- nmi->hIcon = p->cle.hIcon;
- nmi->hDbEvent = p->cle.hDbEvent;
+ nmi->hIcon = p->hIcon;
+ nmi->hDbEvent = p->hDbEvent;
mii.dwItemData = (ULONG_PTR)nmi;
mii.wID = g_CluiData.wNextMenuID;
SetMenuItemInfo(g_CluiData.hMenuNotify, g_CluiData.wNextMenuID, FALSE, &mii);
@@ -151,9 +142,9 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle) }
}
}
- else if (p->cle.hContact != 0 && (p->cle.flags & CLEF_ONLYAFEW)) {
+ else if (p->hContact != 0 && (p->flags & CLEF_ONLYAFEW)) {
g_CluiData.iIconNotify = p->imlIconIndex;
- g_CluiData.hUpdateContact = p->cle.hContact;
+ g_CluiData.hUpdateContact = p->hContact;
}
if (pcli->events.count > 0) {
@@ -174,7 +165,7 @@ int cli_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent) // Find the event that should be removed
int i;
for (i = 0; i < pcli->events.count; i++)
- if ((pcli->events.items[i]->cle.hContact == hContact) && (pcli->events.items[i]->cle.hDbEvent == hDbEvent))
+ if ((pcli->events.items[i]->hContact == hContact) && (pcli->events.items[i]->hDbEvent == hDbEvent))
break;
// Event was not found
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h index 00e87952a3..4e7833944c 100644 --- a/plugins/Clist_modern/src/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/modern_commonprototypes.h @@ -270,8 +270,8 @@ TCHAR* cli_GetGroupCountsText(ClcData *dat, ClcContact *contact); void cli_ChangeContactIcon(MCONTACT hContact, int iIcon, int add);
void cli_SetContactCheckboxes(ClcContact*, int);
LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
-struct CListEvent* cliCreateEvent(void);
-struct CListEvent* cli_AddEvent(CLISTEVENT *cle);
+CListEvent* cliCreateEvent(void);
+CListEvent* cli_AddEvent(CLISTEVENT *cle);
LRESULT CALLBACK cli_ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
int cliShowHide(WPARAM wParam, LPARAM lParam);
BOOL CLUI__cliInvalidateRect(HWND hWnd, CONST RECT* lpRect, BOOL bErase);
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index cb424b8579..5e87211e03 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -34,16 +34,6 @@ extern HPEN g_hPenCLUIFrames; HWND g_hwndEventArea = 0;
-struct CListEvent
-{
- int imlIconIndex;
- int flashesDone;
- CLISTEVENT cle;
-
- int menuId;
- int imlIconOverlayIndex;
-};
-
struct CListImlIcon
{
int index;
@@ -86,12 +76,10 @@ void HideShowNotifyFrame() static CLISTEVENT* MyGetEvent(int iSelection)
{
- int i;
-
- for (i = 0; i < pcli->events.count; i++) {
+ for (int i = 0; i < pcli->events.count; i++) {
CListEvent* p = pcli->events.items[i];
if (p->menuId == iSelection)
- return &p->cle;
+ return p;
}
return NULL;
}
@@ -260,28 +248,28 @@ CListEvent* AddEvent(CLISTEVENT *cle) if (p == NULL)
return NULL;
- if (p->cle.hContact != 0 && p->cle.hDbEvent != 1 && !(p->cle.flags & CLEF_ONLYAFEW)) {
+ if (p->hContact != 0 && p->hDbEvent != 1 && !(p->flags & CLEF_ONLYAFEW)) {
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA | MIIM_BITMAP | MIIM_ID;
- if (p->cle.pszService && !strncmp("SRMsg/ReadMessage", p->cle.pszService, 17)) {
+ if (p->pszService && !strncmp("SRMsg/ReadMessage", p->pszService, 17)) {
// dup check only for msg events
for (int j = 0; j < GetMenuItemCount(cfg::dat.hMenuNotify); j++) {
if (GetMenuItemInfo(cfg::dat.hMenuNotify, j, TRUE, &mii) != 0) {
NotifyMenuItemExData *nmi = (NotifyMenuItemExData*)mii.dwItemData;
- if (nmi != 0 && (HANDLE)nmi->hContact == (HANDLE)p->cle.hContact && nmi->iIcon == p->imlIconIndex)
+ if (nmi != 0 && (HANDLE)nmi->hContact == (HANDLE)p->hContact && nmi->iIcon == p->imlIconIndex)
return p;
}
}
}
- char *szProto = GetContactProto(p->cle.hContact);
- TCHAR *szName = pcli->pfnGetContactDisplayName(p->cle.hContact, 0);
+ char *szProto = GetContactProto(p->hContact);
+ TCHAR *szName = pcli->pfnGetContactDisplayName(p->hContact, 0);
if (szProto && szName) {
NotifyMenuItemExData *nmi = (NotifyMenuItemExData*)malloc(sizeof(NotifyMenuItemExData));
if (nmi) {
TCHAR szBuffer[128];
- TCHAR* szStatus = pcli->pfnGetStatusModeDescription(cfg::getWord(p->cle.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
+ TCHAR* szStatus = pcli->pfnGetStatusModeDescription(cfg::getWord(p->hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
TCHAR szwProto[64];
MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64);
@@ -291,10 +279,10 @@ CListEvent* AddEvent(CLISTEVENT *cle) szBuffer[127] = 0;
AppendMenu(cfg::dat.hMenuNotify, MF_BYCOMMAND | MF_STRING, cfg::dat.wNextMenuID, szBuffer);
mii.hbmpItem = HBMMENU_CALLBACK;
- nmi->hContact = p->cle.hContact;
+ nmi->hContact = p->hContact;
nmi->iIcon = p->imlIconIndex;
- nmi->hIcon = p->cle.hIcon;
- nmi->hDbEvent = p->cle.hDbEvent;
+ nmi->hIcon = p->hIcon;
+ nmi->hDbEvent = p->hDbEvent;
mii.dwItemData = (ULONG_PTR)nmi;
mii.wID = cfg::dat.wNextMenuID;
SetMenuItemInfo(cfg::dat.hMenuNotify, cfg::dat.wNextMenuID, FALSE, &mii);
@@ -306,16 +294,16 @@ CListEvent* AddEvent(CLISTEVENT *cle) }
}
}
- else if (p->cle.hContact != 0 && (p->cle.flags & CLEF_ONLYAFEW)) {
+ else if (p->hContact != 0 && (p->flags & CLEF_ONLYAFEW)) {
cfg::dat.hIconNotify = p->imlIconIndex;
- cfg::dat.hUpdateContact = p->cle.hContact;
+ cfg::dat.hUpdateContact = p->hContact;
}
if (cfg::dat.dwFlags & CLUI_STICKYEVENTS) {
- HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree, CLM_FINDCONTACT, (WPARAM)p->cle.hContact, 0);
+ HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree, CLM_FINDCONTACT, (WPARAM)p->hContact, 0);
if (hItem) {
SendMessage(pcli->hwndContactTree, CLM_SETSTICKY, (WPARAM)hItem, 1);
- pcli->pfnClcBroadcast(INTM_PROTOCHANGED, (WPARAM)p->cle.hContact, 0);
+ pcli->pfnClcBroadcast(INTM_PROTOCHANGED, (WPARAM)p->hContact, 0);
}
}
@@ -340,7 +328,7 @@ int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent) // Find the event that should be removed
int i;
for (i = 0; i < pcli->events.count; i++)
- if ((pcli->events.items[i]->cle.hContact == hContact) && (pcli->events.items[i]->cle.hDbEvent == hDbEvent))
+ if ((pcli->events.items[i]->hContact == hContact) && (pcli->events.items[i]->hDbEvent == hDbEvent))
break;
// Event was not found
diff --git a/src/mir_app/src/clistevents.cpp b/src/mir_app/src/clistevents.cpp index 26c2a6adc2..2b49417a6b 100644 --- a/src/mir_app/src/clistevents.cpp +++ b/src/mir_app/src/clistevents.cpp @@ -25,13 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
#include "clc.h"
-struct CListEvent
-{
- int imlIconIndex;
- int flashesDone;
- CLISTEVENT cle;
-};
-
struct CListImlIcon
{
int index;
@@ -67,15 +60,15 @@ static char * GetEventProtocol(int idx) return NULL;
CListEvent *ev = cli.events.items[idx];
- if (ev->cle.hContact != NULL)
- return GetContactProto(ev->cle.hContact);
+ if (ev->hContact != NULL)
+ return GetContactProto(ev->hContact);
- return (ev->cle.flags & CLEF_PROTOCOLGLOBAL) ? ev->cle.lpszProtocol : NULL;
+ return (ev->flags & CLEF_PROTOCOLGLOBAL) ? ev->lpszProtocol : NULL;
}
static void ShowOneEventInTray(int idx)
{
- cli.pfnTrayIconUpdateWithImageList((iconsOn || disableTrayFlash) ? cli.events.items[idx]->imlIconIndex : 0, cli.events.items[idx]->cle.ptszTooltip, GetEventProtocol(idx));
+ cli.pfnTrayIconUpdateWithImageList((iconsOn || disableTrayFlash) ? cli.events.items[idx]->imlIconIndex : 0, cli.events.items[idx]->ptszTooltip, GetEventProtocol(idx));
}
static void ShowEventsInTray()
@@ -118,15 +111,15 @@ static VOID CALLBACK IconFlashTimer(HWND, UINT, UINT_PTR idEvent, DWORD) for (int i=0; i < cli.events.count; i++) {
int j;
for (j = 0; j < i; j++)
- if (cli.events.items[j]->cle.hContact == cli.events.items[i]->cle.hContact)
+ if (cli.events.items[j]->hContact == cli.events.items[i]->hContact)
break;
if (j >= i)
- cli.pfnChangeContactIcon(cli.events.items[i]->cle.hContact, iconsOn || disableIconFlash ? cli.events.items[i]->imlIconIndex : 0, 0);
+ cli.pfnChangeContactIcon(cli.events.items[i]->hContact, iconsOn || disableIconFlash ? cli.events.items[i]->imlIconIndex : 0, 0);
// decrease eflashes in any case - no need to collect all events
- if (cli.events.items[i]->cle.flags & CLEF_ONLYAFEW)
+ if (cli.events.items[i]->flags & CLEF_ONLYAFEW)
if (0 >= --cli.events.items[i]->flashesDone)
- cli.pfnRemoveEvent(cli.events.items[i]->cle.hContact, cli.events.items[i]->cle.hDbEvent);
+ cli.pfnRemoveEvent(cli.events.items[i]->hContact, cli.events.items[i]->hDbEvent);
}
if (cli.events.count == 0) {
@@ -146,7 +139,7 @@ CListEvent* fnAddEvent(CLISTEVENT *cle) if (cle->flags & CLEF_URGENT) {
for (i=0; i < cli.events.count; i++)
- if (!(cli.events.items[i]->cle.flags & CLEF_URGENT))
+ if (!(cli.events.items[i]->flags & CLEF_URGENT))
break;
}
else i = cli.events.count;
@@ -156,14 +149,14 @@ CListEvent* fnAddEvent(CLISTEVENT *cle) return NULL;
List_Insert((SortedList*)&cli.events, p, i);
- p->cle = *cle;
- p->imlIconIndex = fnGetImlIconIndex(cli.events.items[i]->cle.hIcon);
+ memcpy(p, cle, sizeof(*cle));
+ p->imlIconIndex = fnGetImlIconIndex(cli.events.items[i]->hIcon);
p->flashesDone = 12;
- p->cle.pszService = mir_strdup(cli.events.items[i]->cle.pszService);
- if (p->cle.flags & CLEF_UNICODE)
- p->cle.ptszTooltip = mir_tstrdup(p->cle.ptszTooltip);
+ p->pszService = mir_strdup(cli.events.items[i]->pszService);
+ if (p->flags & CLEF_UNICODE)
+ p->ptszTooltip = mir_tstrdup(p->ptszTooltip);
else
- p->cle.ptszTooltip = mir_a2u(p->cle.pszTooltip); //if no flag defined it handled as unicode
+ p->ptszTooltip = mir_a2u(p->pszTooltip); //if no flag defined it handled as unicode
if (cli.events.count == 1) {
char *szProto;
if (cle->hContact == NULL) {
@@ -176,7 +169,7 @@ CListEvent* fnAddEvent(CLISTEVENT *cle) iconsOn = 1;
flashTimerId = SetTimer(NULL, 0, db_get_w(NULL, "CList", "IconFlashTime", 550), IconFlashTimer);
- cli.pfnTrayIconUpdateWithImageList(p->imlIconIndex, p->cle.ptszTooltip, szProto);
+ cli.pfnTrayIconUpdateWithImageList(p->imlIconIndex, p->ptszTooltip, szProto);
}
cli.pfnChangeContactIcon(cle->hContact, p->imlIconIndex, 1);
return p;
@@ -188,9 +181,11 @@ int fnRemoveEvent(MCONTACT hContact, MEVENT dbEvent) {
// Find the event that should be removed
int i;
- for (i=0; i < cli.events.count; i++)
- if ((cli.events.items[i]->cle.hContact == hContact) && (cli.events.items[i]->cle.hDbEvent == dbEvent))
+ for (i = 0; i < cli.events.count; i++) {
+ CListEvent *e = cli.events.items[i];
+ if (e->hContact == hContact && e->hDbEvent == dbEvent)
break;
+ }
// Event was not found
if (i == cli.events.count)
@@ -198,21 +193,21 @@ int fnRemoveEvent(MCONTACT hContact, MEVENT dbEvent) // Update contact's icon
char *szProto = GetContactProto(hContact);
- cli.pfnChangeContactIcon(cli.events.items[i]->cle.hContact,
- CallService(MS_CLIST_GETCONTACTICON, (WPARAM)cli.events.items[i]->cle.hContact, 1), 0);
+ cli.pfnChangeContactIcon(cli.events.items[i]->hContact,
+ CallService(MS_CLIST_GETCONTACTICON, (WPARAM)cli.events.items[i]->hContact, 1), 0);
// Free any memory allocated to the event
cli.pfnFreeEvent(cli.events.items[i]);
List_Remove((SortedList*)&cli.events, i);
- //count same protocoled events
+ // count same protocoled events
int nSameProto = 0;
char *szEventProto;
for (i = 0; i < cli.events.count; i++) {
- if (cli.events.items[i]->cle.hContact)
- szEventProto = GetContactProto((cli.events.items[i]->cle.hContact));
- else if (cli.events.items[i]->cle.flags & CLEF_PROTOCOLGLOBAL)
- szEventProto = (char *)cli.events.items[i]->cle.lpszProtocol;
+ if (cli.events.items[i]->hContact)
+ szEventProto = GetContactProto((cli.events.items[i]->hContact));
+ else if (cli.events.items[i]->flags & CLEF_PROTOCOLGLOBAL)
+ szEventProto = (char*)cli.events.items[i]->lpszProtocol;
else
szEventProto = NULL;
if (szEventProto && szProto && !mir_strcmp(szEventProto, szProto))
@@ -225,11 +220,11 @@ int fnRemoveEvent(MCONTACT hContact, MEVENT dbEvent) cli.pfnTrayIconSetToBase(hContact == NULL ? NULL : szProto);
}
else {
- if (cli.events.items[0]->cle.hContact == NULL)
+ if (cli.events.items[0]->hContact == NULL)
szProto = NULL;
else
- szProto = GetContactProto(cli.events.items[0]->cle.hContact);
- cli.pfnTrayIconUpdateWithImageList(iconsOn ? cli.events.items[0]->imlIconIndex : 0, cli.events.items[0]->cle.ptszTooltip, szProto);
+ szProto = GetContactProto(cli.events.items[0]->hContact);
+ cli.pfnTrayIconUpdateWithImageList(iconsOn ? cli.events.items[0]->imlIconIndex : 0, cli.events.items[0]->ptszTooltip, szProto);
}
return 0;
@@ -240,22 +235,22 @@ CLISTEVENT* fnGetEvent(MCONTACT hContact, int idx) if (hContact == INVALID_CONTACT_ID) {
if (idx >= cli.events.count)
return NULL;
- return &cli.events.items[idx]->cle;
+ return cli.events.items[idx];
}
for (int i=0; i < cli.events.count; i++)
- if (cli.events.items[i]->cle.hContact == hContact)
+ if (cli.events.items[i]->hContact == hContact)
if (idx-- == 0)
- return &cli.events.items[i]->cle;
+ return cli.events.items[i];
return NULL;
}
int fnEventsProcessContactDoubleClick(MCONTACT hContact)
{
for (int i = 0; i < cli.events.count; i++) {
- if (cli.events.items[i]->cle.hContact == hContact) {
- MEVENT hDbEvent = cli.events.items[i]->cle.hDbEvent;
- CallService(cli.events.items[i]->cle.pszService, (WPARAM)(HWND)NULL, (LPARAM)& cli.events.items[i]->cle);
+ if (cli.events.items[i]->hContact == hContact) {
+ MEVENT hDbEvent = cli.events.items[i]->hDbEvent;
+ CallService(cli.events.items[i]->pszService, NULL, (LPARAM)cli.events.items[i]);
cli.pfnRemoveEvent(hContact, hDbEvent);
return 0;
}
@@ -287,10 +282,10 @@ int fnEventsProcessTrayDoubleClick(int index) if (szProto) {
for (i = 0; i < cli.events.count; i++) {
char *eventProto = NULL;
- if (cli.events.items[i]->cle.hContact)
- eventProto = GetContactProto(cli.events.items[i]->cle.hContact);
+ if (cli.events.items[i]->hContact)
+ eventProto = GetContactProto(cli.events.items[i]->hContact);
if (!eventProto)
- eventProto = cli.events.items[i]->cle.lpszProtocol;
+ eventProto = cli.events.items[i]->lpszProtocol;
if (!eventProto || !_strcmpi(eventProto, szProto)) {
eventIndex = i;
@@ -303,10 +298,10 @@ int fnEventsProcessTrayDoubleClick(int index) if (click_in_first_icon) {
for (i = 0; i < cli.events.count; i++) {
char *eventProto = NULL;
- if (cli.events.items[i]->cle.hContact)
- eventProto = GetContactProto(cli.events.items[i]->cle.hContact);
+ if (cli.events.items[i]->hContact)
+ eventProto = GetContactProto(cli.events.items[i]->hContact);
if (!eventProto)
- eventProto = cli.events.items[i]->cle.lpszProtocol;
+ eventProto = cli.events.items[i]->lpszProtocol;
if (!eventProto)
continue;
@@ -328,10 +323,10 @@ int fnEventsProcessTrayDoubleClick(int index) }
lck.unlock();
- MCONTACT hContact = cli.events.items[eventIndex]->cle.hContact;
- MEVENT hDbEvent = cli.events.items[eventIndex]->cle.hDbEvent;
+ MCONTACT hContact = cli.events.items[eventIndex]->hContact;
+ MEVENT hDbEvent = cli.events.items[eventIndex]->hDbEvent;
// ; may be better to show send msg?
- CallService(cli.events.items[eventIndex]->cle.pszService, 0, (LPARAM)& cli.events.items[eventIndex]->cle);
+ CallService(cli.events.items[eventIndex]->pszService, 0, (LPARAM)cli.events.items[eventIndex]);
cli.pfnRemoveEvent(hContact, hDbEvent);
return 0;
}
@@ -349,8 +344,8 @@ static int RemoveEventsForContact(WPARAM wParam, LPARAM) for (; cli.events.count > 0;) {
for (hit = 0, j = 0; j < cli.events.count; j++) {
- if (cli.events.items[j]->cle.hContact == wParam) {
- cli.pfnRemoveEvent(wParam, cli.events.items[j]->cle.hDbEvent);
+ if (cli.events.items[j]->hContact == wParam) {
+ cli.pfnRemoveEvent(wParam, cli.events.items[j]->hDbEvent);
hit = 1;
}
}
@@ -403,8 +398,8 @@ CListEvent* fnCreateEvent(void) void fnFreeEvent(CListEvent *p)
{
- mir_free(p->cle.pszService);
- mir_free(p->cle.pszTooltip);
+ mir_free(p->pszService);
+ mir_free(p->pszTooltip);
mir_free(p);
}
|