diff options
32 files changed, 74 insertions, 108 deletions
diff --git a/include/delphi/m_clist.inc b/include/delphi/m_clist.inc index 388990f8af..c625bb5f02 100644 --- a/include/delphi/m_clist.inc +++ b/include/delphi/m_clist.inc @@ -107,10 +107,9 @@ const type
PCLISTEVENT = ^TCLISTEVENT;
TCLISTEVENT = record
- cbSize : int; // size in bytes
hContact : TMCONTACT; // handle to the contact to put the icon by
- hIcon : HICON; // icon to flash!
flags : dword;
+ hIcon : HICON; // icon to flash!
hDBEvent : TMEVENT; // caller defined, but should be unique for hContact
// or pszProtocol:PAnsiChar
lParam : LPARAM;
diff --git a/include/m_clist.h b/include/m_clist.h index 940de8078d..18b8961931 100644 --- a/include/m_clist.h +++ b/include/m_clist.h @@ -217,31 +217,29 @@ typedef struct { // bypasses the double-click.
typedef struct {
- int cbSize; //size in bytes of this structure
- MCONTACT hContact; //handle to the contact to put the icon by
- HICON hIcon; //icon to flash
- DWORD flags; //...of course
+ MCONTACT hContact; // handle to the contact to put the icon by
+ DWORD flags; // ...of course
+ HICON hIcon; // icon to flash
union
{
- MEVENT hDbEvent; //caller defined but should be unique for hContact
+ MEVENT hDbEvent; // caller defined but should be unique for hContact
char * lpszProtocol;
};
- LPARAM lParam; //caller defined
- char *pszService; //name of the service to call on activation
+ LPARAM lParam; // caller defined
+ char *pszService; // name of the service to call on activation
union {
- char *pszTooltip; //short description of the event to display as a
- TCHAR *ptszTooltip; //tooltip on the system tray
+ char *pszTooltip; // short description of the event to display as a
+ TCHAR *ptszTooltip; // tooltip on the system tray
};
} CLISTEVENT;
-#define CLEF_URGENT 1 //flashes the icon even if the user is occupied,
- //and puts the event at the top of the queue
-#define CLEF_ONLYAFEW 2 //the icon will not flash for ever, only a few
- //times. This is for eg online alert
-#define CLEF_UNICODE 4 //set pszTooltip as unicode
-
-#define CLEF_PROTOCOLGLOBAL 8 //set event globally for protocol, hContact has to be NULL,
- //lpszProtocol the protocol ID name to be set
-
+#define CLEF_URGENT 1 // flashes the icon even if the user is occupied,
+ // and puts the event at the top of the queue
+#define CLEF_ONLYAFEW 2 // the icon will not flash for ever, only a few
+ // times. This is for eg online alert
+#define CLEF_UNICODE 4 // set pszTooltip as unicode
+
+#define CLEF_PROTOCOLGLOBAL 8 // set event globally for protocol, hContact has to be NULL,
+ // lpszProtocol the protocol ID name to be set
#if defined(_UNICODE)
#define CLEF_TCHAR CLEF_UNICODE //will use TCHAR* instead of char*
#else
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp index 0c0d224de1..1d394db194 100644 --- a/plugins/Alarms/src/alarmlist.cpp +++ b/plugins/Alarms/src/alarmlist.cpp @@ -555,7 +555,7 @@ void DoAlarm(ALARM *alarm) if (alarm->action & AAF_SYSTRAY)
{
- CLISTEVENT cle = { sizeof(cle) };
+ CLISTEVENT cle = {};
cle.hIcon = hIconSystray;
cle.ptszTooltip = alarm->szTitle;
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index ceefadb950..17d334e030 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -278,7 +278,7 @@ void ReturnNotify(MCONTACT hContact, TCHAR *message) }
if (options.iShowEvent > 0) {
- CLISTEVENT cle = { sizeof(cle) };
+ CLISTEVENT cle = {};
cle.hContact = hContact;
cle.hIcon = hIcon;
cle.pszService = "BuddyExpectator/actionReturned";
@@ -317,7 +317,7 @@ void GoneNotify(MCONTACT hContact, TCHAR *message) }
if (options.iShowEvent2 > 0) {
- CLISTEVENT cle = { sizeof(cle) };
+ CLISTEVENT cle = {};
cle.hContact = hContact;
cle.hIcon = hIcon;
cle.pszService = "BuddyExpectator/actionStillAbsent";
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index be03a06270..f51fe04ad3 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -49,8 +49,8 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY); int ShowHide(WPARAM wParam, LPARAM lParam);
int ClcShutdown(WPARAM wParam, LPARAM lParam);
-CListEvent *AddEvent(CLISTEVENT *cle);
-ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
+CListEvent* AddEvent(CLISTEVENT *cle);
+ClcGroup* AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
int AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact);
int AddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText);
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index 5ec186bf19..33ffa53e20 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -76,7 +76,7 @@ static int HookDBEventAdded(WPARAM hContact, LPARAM hDbEvent) TCHAR caToolTip[128];
mir_sntprintf(caToolTip, _T("%s %s"), TranslateT("Contacts received from"), pcli->pfnGetContactDisplayName(hContact, 0));
- CLISTEVENT cle = { sizeof(cle) };
+ CLISTEVENT cle = {};
cle.hContact = hContact;
cle.hDbEvent = hDbEvent;
cle.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONTACTS));
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index 8864263545..6a62142159 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -463,9 +463,7 @@ void FILEECHO::incomeRequest(char *param) // else
if (!IsWindowVisible(hDlg) && !AutoMin)
{
- CLISTEVENT cle;
- memset(&cle, 0, sizeof(cle));
- cle.cbSize = sizeof(cle);
+ CLISTEVENT cle = {};
cle.hContact = hContact;
cle.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SMALLICON));
cle.flags = CLEF_URGENT;
diff --git a/plugins/GmailNotifier/src/notify.cpp b/plugins/GmailNotifier/src/notify.cpp index a4f6c054ea..b4991cfaa5 100644 --- a/plugins/GmailNotifier/src/notify.cpp +++ b/plugins/GmailNotifier/src/notify.cpp @@ -87,7 +87,7 @@ void NotifyUser(Account *curAcc) }
}
if (opt.notifierOnTray&&newMails > 0) {
- CLISTEVENT cle = { sizeof(cle) };
+ CLISTEVENT cle = {};
cle.hContact = curAcc->hContact;
cle.hDbEvent = 1;
cle.flags = CLEF_URGENT;
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index ee1910fd42..571870f566 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -311,8 +311,7 @@ void GetStatusText(MCONTACT hContact, WORD newStatus, WORD oldStatus, TCHAR *stz void BlinkIcon(MCONTACT hContact, HICON hIcon, TCHAR *stzText)
{
- CLISTEVENT cle = { 0 };
- cle.cbSize = sizeof(cle);
+ CLISTEVENT cle = {};
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
cle.hContact = hContact;
cle.hDbEvent = hContact;
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index e356728c4a..87222c5e08 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -186,9 +186,7 @@ static void RemoveReminderSystemEvent(REMINDERDATA *p) for (i=0; ; i++)
{
- CLISTEVENT *pev;
-
- pev = (CLISTEVENT*) CallService(MS_CLIST_GETEVENT,(WPARAM)INVALID_HANDLE_VALUE,i);
+ CLISTEVENT *pev = (CLISTEVENT*) CallService(MS_CLIST_GETEVENT,(WPARAM)INVALID_HANDLE_VALUE,i);
if (!pev)
break;
@@ -685,23 +683,18 @@ static void UpdateReminderEvent(REMINDERDATA *pReminder, UINT nElapsedSeconds, B static void FireReminder(REMINDERDATA *pReminder, BOOL *pHasPlayedSound)
{
- DWORD dwSoundMask;
-
if (pReminder->SystemEventQueued)
return;
// add a system event
{
- CLISTEVENT ev = { 0 };
-
- ev.cbSize = sizeof(ev);
- ev.hIcon = g_hReminderIcon;
- ev.flags = CLEF_URGENT;
- ev.lParam = (LPARAM)pReminder->uid;
- ev.pszService = MODULENAME"/OpenTriggeredReminder";
- ev.pszTooltip = Translate("Reminder");
-
- CallService(MS_CLIST_ADDEVENT,0,(LPARAM)&ev);
+ CLISTEVENT ev = {};
+ ev.hIcon = g_hReminderIcon;
+ ev.flags = CLEF_URGENT;
+ ev.lParam = (LPARAM)pReminder->uid;
+ ev.pszService = MODULENAME"/OpenTriggeredReminder";
+ ev.pszTooltip = Translate("Reminder");
+ CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&ev);
}
pReminder->SystemEventQueued = TRUE;
@@ -713,7 +706,7 @@ static void FireReminder(REMINDERDATA *pReminder, BOOL *pHasPlayedSound) return;
}
- dwSoundMask = 1 << pReminder->SoundSel;
+ DWORD dwSoundMask = 1 << pReminder->SoundSel;
pReminder->RepeatSoundTTL = pReminder->RepeatSound;
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp index 775ad114a1..766cca7866 100644 --- a/plugins/SMS/src/receive.cpp +++ b/plugins/SMS/src/receive.cpp @@ -234,7 +234,7 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent) memcpy(pszServiceFunctionName, SMS_READ, sizeof(SMS_READ));
mir_sntprintf(szToolTip, TranslateT("SMS Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
- CLISTEVENT cle = { sizeof(cle) };
+ CLISTEVENT cle = {};
cle.flags = CLEF_TCHAR;
cle.hContact = hContact;
cle.hDbEvent = hDbEvent;
@@ -257,7 +257,7 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent) memcpy(pszServiceFunctionName, SMS_READ_ACK, sizeof(SMS_READ_ACK));
mir_sntprintf(szToolTip, TranslateT("SMS Confirmation from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
- CLISTEVENT cle = { sizeof(cle) };
+ CLISTEVENT cle = {};
cle.flags = CLEF_TCHAR;
cle.hContact = hContact;
cle.hDbEvent = hDbEvent;
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index a7e3db3628..e8cf42c21d 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -123,7 +123,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) TCHAR *contactName = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
TCHAR toolTip[256];
- CLISTEVENT cle = { sizeof(cle) };
+ CLISTEVENT cle = {};
cle.flags = CLEF_TCHAR;
cle.hContact = hContact;
cle.hDbEvent = hDbEvent;
@@ -223,7 +223,6 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) pcli->pfnRemoveEvent(hContact, 1);
CLISTEVENT cle = {};
- cle.cbSize = sizeof(cle);
cle.hContact = hContact;
cle.hDbEvent = 1;
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
@@ -297,7 +296,6 @@ static void RestoreUnreadMessageAlerts(void) TCHAR toolTip[256];
CLISTEVENT cle = {};
- cle.cbSize = sizeof(cle);
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
cle.flags = CLEF_TCHAR;
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 2c0e32a1e5..e3ea4f20e9 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -561,7 +561,6 @@ void CGlobals::RestoreUnreadMessageAlerts(void) TCHAR toolTip[256];
CLISTEVENT cle = {};
- cle.cbSize = sizeof(cle);
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
cle.flags = CLEF_TCHAR;
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index c2bb842037..9febb58db2 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -314,7 +314,6 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) pcli->pfnRemoveEvent(hContact, 1); CLISTEVENT cle = {}; - cle.cbSize = sizeof(cle); cle.hContact = hContact; cle.hDbEvent = 1; cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR; @@ -545,7 +544,7 @@ nowindowcreate: if (!nen_options.bTraySupport) { TCHAR toolTip[256], *contactName; - CLISTEVENT cle = { sizeof(cle) }; + CLISTEVENT cle = {}; cle.hContact = hContact; cle.hDbEvent = hDbEvent; cle.flags = CLEF_TCHAR; diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index f7b32970e7..c669c187cb 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -773,7 +773,6 @@ void TSAPI FlashOnClist(HWND hwndDlg, TWindowData *dat, MEVENT hEvent, DBEVENTIN if ((GetForegroundWindow() != dat->pContainer->hwnd || dat->pContainer->hwndActive != hwndDlg) && !(dbei->flags & DBEF_SENT) && dbei->eventType == EVENTTYPE_MESSAGE && !(dat->dwFlagsEx & MWF_SHOW_FLASHCLIST)) {
CLISTEVENT cle = {};
- cle.cbSize = sizeof(cle);
cle.hContact = (MCONTACT)dat->hContact;
cle.hDbEvent = hEvent;
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 44467f2fac..ceddb9aaba 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -310,7 +310,7 @@ static void NotifyFlashCListIcon(MCONTACT hContact, const CEvent &evt) TCHAR szMsg[MAX_PATH];
- CLISTEVENT cle = { sizeof(cle) };
+ CLISTEVENT cle = {};
cle.hContact = hContact;
cle.flags = CLEF_URGENT|CLEF_TCHAR;
cle.hDbEvent = NULL;
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index ea390d7cd8..644c849372 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -638,16 +638,14 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D char sMsg[250]; mir_snprintf(sMsg, Translate("%s : %d new mail message(s), %d total"), ActualAccount->Name, MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC); if (!(nflags & YAMN_ACC_CONTNOEVENT)) { - CLISTEVENT cEvent; - cEvent.cbSize = sizeof(CLISTEVENT); - cEvent.hContact = ActualAccount->hContact; - cEvent.hIcon = g_LoadIconEx(2); - cEvent.hDbEvent = ActualAccount->hContact; - cEvent.lParam = ActualAccount->hContact; - cEvent.pszService = MS_YAMN_CLISTDBLCLICK; - cEvent.pszTooltip = sMsg; - cEvent.flags = 0; - CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM)&cEvent); + CLISTEVENT evt = {};
+ evt.hContact = ActualAccount->hContact; + evt.hIcon = g_LoadIconEx(2); + evt.hDbEvent = ActualAccount->hContact; + evt.lParam = ActualAccount->hContact; + evt.pszService = MS_YAMN_CLISTDBLCLICK; + evt.pszTooltip = sMsg; + CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM)&evt); } db_set_s(ActualAccount->hContact, "CList", "StatusMsg", sMsg); diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index b97728c4a9..3f8c63cdd3 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -1006,11 +1006,10 @@ retry: }
else
{
- CLISTEVENT cle = {0};
char service[128];
mir_snprintf(service, GGS_RECVIMAGE, m_szModuleName);
- cle.cbSize = sizeof(cle);
+ CLISTEVENT cle = { 0 };
cle.hContact = hContact;
cle.hIcon = LoadIconEx("image", FALSE);
cle.flags = CLEF_URGENT;
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index d63dc3cfc1..cd52f2297f 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -62,7 +62,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask, PostIrcMessage(_T("/PRIVMSG %s \001VERSION\001"), name.c_str());
}
else {
- CLISTEVENT cle = { sizeof(cle) };
+ CLISTEVENT cle = {};
cle.hContact = hContact;
cle.hDbEvent = -100;
cle.flags = CLEF_TCHAR;
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 5d4cc14e9d..53c9ef9f72 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -451,8 +451,7 @@ BOOL CJabberProto::AddClistHttpAuthEvent(CJabberHttpAuthParams *pParams) char szService[256];
mir_snprintf(szService, "%s%s", m_szModuleName, JS_HTTP_AUTH);
- CLISTEVENT cle = { 0 };
- cle.cbSize = sizeof(CLISTEVENT);
+ CLISTEVENT cle = {};
cle.hIcon = (HICON)LoadIconEx("openid");
cle.flags = CLEF_PROTOCOLGLOBAL | CLEF_TCHAR;
cle.hDbEvent = -99;
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index 3322b50b4a..dffac55378 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -776,10 +776,10 @@ bool CJabberProto::OnIncomingNote(const TCHAR *szFrom, HXML hXml) return false;
}
- CLISTEVENT cle = { 0 };
char szService[256];
mir_snprintf(szService, "%s%s", m_szModuleName, JS_INCOMING_NOTE_EVENT);
- cle.cbSize = sizeof(CLISTEVENT);
+
+ CLISTEVENT cle = {};
cle.hIcon = (HICON)LoadIconEx("notes");
cle.flags = CLEF_PROTOCOLGLOBAL | CLEF_TCHAR;
cle.hDbEvent = -99;
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index c2ab7efd85..f63e04ecf9 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -657,11 +657,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & if (bTrayIconNewMailNotify) {
char szServiceFunction[MAX_PATH] = { 0 }, *pszServiceFunctionName;
- CLISTEVENT cle = { 0 };
-
- cle.cbSize = sizeof(cle);
- //cle.hContact;
- //cle.hDbEvent;
+ CLISTEVENT cle = {};
cle.lpszProtocol = m_szModuleName;
cle.hIcon = IconLibGetIcon(gdiMenuItems[0].hIcolib);
cle.flags = (CLEF_UNICODE | CLEF_PROTOCOLGLOBAL);
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index 834144232e..6723946566 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -286,9 +286,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) displayEmailCount(hContact);
if (ShowPopup && !getByte("DisableHotmailTray", 1)) {
- CLISTEVENT cle = { 0 };
-
- cle.cbSize = sizeof(cle);
+ CLISTEVENT cle = {};
cle.hContact = hContact;
cle.hDbEvent = 1;
cle.flags = CLEF_URGENT | CLEF_TCHAR;
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp index 4de27f121a..933747d290 100644 --- a/protocols/SkypeWeb/src/skype_trouter.cpp +++ b/protocols/SkypeWeb/src/skype_trouter.cpp @@ -198,8 +198,8 @@ void CSkypeProto::OnTrouterEvent(const JSONNode &body, const JSONNode &) MEVENT hEvent = AddDbEvent(SKYPE_DB_EVENT_TYPE_INCOMING_CALL, hContact, time(NULL), DBEF_READ, gp.c_str(), callId.c_str());
SkinPlaySound("skype_inc_call");
- CLISTEVENT cle = { sizeof(cle) };
- cle.flags |= CLEF_TCHAR;
+ CLISTEVENT cle = {};
+ cle.flags = CLEF_TCHAR;
cle.hContact = hContact;
cle.hDbEvent = hEvent;
cle.lParam = SKYPE_DB_EVENT_TYPE_INCOMING_CALL;
diff --git a/protocols/Tox/src/tox_multimedia.cpp b/protocols/Tox/src/tox_multimedia.cpp index 1bbc9b5f11..9bd2aefb41 100644 --- a/protocols/Tox/src/tox_multimedia.cpp +++ b/protocols/Tox/src/tox_multimedia.cpp @@ -344,8 +344,8 @@ INT_PTR CToxProto::OnRecvAudioCall(WPARAM hContact, LPARAM lParam) MEVENT hEvent = AddEventToDb(hContact, DB_EVENT_CALL, pre->timestamp, DBEF_UTF, (PBYTE)pre->szMessage, mir_strlen(pre->szMessage));
- CLISTEVENT cle = { sizeof(cle) };
- cle.flags |= CLEF_TCHAR;
+ CLISTEVENT cle = {};
+ cle.flags = CLEF_TCHAR;
cle.hContact = hContact;
cle.hDbEvent = hEvent;
cle.lParam = DB_EVENT_CALL;
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index df114f5caf..83c1e2b18e 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -77,7 +77,8 @@ void CVkProto::AddCListEvent(bool bNews) return;
MCONTACT hContact = FindUser(VK_FEED_USER, true);
- CLISTEVENT cle = { sizeof(cle) };
+
+ CLISTEVENT cle = {};
cle.hIcon = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
cle.pszService = "SRMsg/ReadMessage";
cle.flags = CLEF_URGENT | CLEF_TCHAR;
diff --git a/src/core/stdauth/src/auth.cpp b/src/core/stdauth/src/auth.cpp index 6f2bb36fee..1358e7858c 100644 --- a/src/core/stdauth/src/auth.cpp +++ b/src/core/stdauth/src/auth.cpp @@ -59,15 +59,14 @@ static int AuthEventAdded(WPARAM, LPARAM lParam) MCONTACT hContact = DbGetAuthEventContact(&dbei);
- CLISTEVENT cli = { 0 };
- cli.cbSize = sizeof(cli);
+ CLISTEVENT cli = {};
cli.hContact = hContact;
cli.ptszTooltip = szTooltip;
cli.flags = CLEF_TCHAR;
cli.lParam = lParam;
cli.hDbEvent = hDbEvent;
- CONTACTINFO ci = { 0 };
+ CONTACTINFO ci = {};
ci.cbSize = sizeof(ci);
ci.hContact = hContact;
ci.szProto = GetContactProto(hContact);
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 1ebfbae438..752c1f1fae 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -111,8 +111,7 @@ static INT_PTR RecvFileCommand(WPARAM, LPARAM lParam) void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam)
{
- CLISTEVENT cle = { 0 };
- cle.cbSize = sizeof(cle);
+ CLISTEVENT cle = {};
cle.hContact = hContact;
cle.hDbEvent = hdbe;
cle.lParam = lParam;
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 3172bdb661..ebb815c423 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -88,14 +88,15 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) return 0;
}
- CLISTEVENT cle = { sizeof(cle) };
+ TCHAR toolTip[256];
+ mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+
+ CLISTEVENT cle = {};
cle.hContact = hContact;
cle.hDbEvent = lParam;
cle.flags = CLEF_TCHAR;
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
- TCHAR toolTip[256];
- mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = toolTip;
pcli->pfnAddEvent(&cle);
return 0;
@@ -181,7 +182,6 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) pcli->pfnRemoveEvent(hContact, 1);
CLISTEVENT cle = {};
- cle.cbSize = sizeof(cle);
cle.hContact = hContact;
cle.hDbEvent = 1;
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
@@ -274,7 +274,6 @@ static void RestoreUnreadMessageAlerts(void) TCHAR toolTip[256];
CLISTEVENT cle = {};
- cle.cbSize = sizeof(cle);
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
cle.flags = CLEF_TCHAR;
diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index ca6327d979..12f7cda357 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -57,17 +57,15 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) DWORD ticked = db_get_dw(NULL, "UserOnline", cws->szModule, GetTickCount());
// only play the sound (or show event) if this event happens at least 10 secs after the proto went from offline
if (GetTickCount() - ticked > (1000*10)) {
- CLISTEVENT cle;
TCHAR tooltip[256];
+ mir_sntprintf(tooltip, TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0));
- memset(&cle, 0, sizeof(cle));
- cle.cbSize = sizeof(cle);
+ CLISTEVENT cle = {};
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
cle.hContact = hContact;
cle.hDbEvent = uniqueEventId++;
cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_USERONLINE, false);
cle.pszService = "UserOnline/Description";
- mir_sntprintf(tooltip, TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = tooltip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
IcoLib_ReleaseIcon(cle.hIcon, 0);
diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp index 24c7bba5c1..267fca44d5 100644 --- a/src/mir_app/src/chat_clist.cpp +++ b/src/mir_app/src/chat_clist.cpp @@ -212,8 +212,7 @@ BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, TCHAR* fm mir_vsntprintf(szBuf, _countof(szBuf), fmt, marker);
va_end(marker);
- CLISTEVENT cle = { 0 };
- cle.cbSize = sizeof(cle);
+ CLISTEVENT cle = {};
cle.hContact = hContact;
cle.hDbEvent = hEvent;
cle.flags = type | CLEF_TCHAR;
diff --git a/src/mir_app/src/clistevents.cpp b/src/mir_app/src/clistevents.cpp index 8a6831b93e..2d7e90aaa2 100644 --- a/src/mir_app/src/clistevents.cpp +++ b/src/mir_app/src/clistevents.cpp @@ -54,7 +54,7 @@ int fnGetImlIconIndex(HICON hIcon) return imlIcon[i].index;
}
-static char * GetEventProtocol(int idx)
+static char* GetEventProtocol(int idx)
{
if (!cli.events.count || idx < 0 && idx >= cli.events.count)
return NULL;
@@ -132,11 +132,10 @@ static VOID CALLBACK IconFlashTimer(HWND, UINT, UINT_PTR idEvent, DWORD) CListEvent* fnAddEvent(CLISTEVENT *cle)
{
- int i;
-
- if (cle == NULL || cle->cbSize != sizeof(CLISTEVENT))
+ if (cle == NULL)
return NULL;
+ int i;
if (cle->flags & CLEF_URGENT) {
for (i=0; i < cli.events.count; i++)
if (!(cli.events.items[i]->flags & CLEF_URGENT))
|