diff options
Diffstat (limited to 'plugins')
41 files changed, 101 insertions, 151 deletions
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp index 1ab9cbd72d..0683405bb6 100644 --- a/plugins/CountryFlags/src/extraimg.cpp +++ b/plugins/CountryFlags/src/extraimg.cpp @@ -89,7 +89,7 @@ void UpdateExtraImages() // always call in context of main thread
static void __fastcall SetStatusIcon(MCONTACT hContact,int countryNumber)
{
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODULENAME;
if (countryNumber != 0xFFFF || bUseUnknown) {
@@ -108,7 +108,7 @@ static void __fastcall SetStatusIcon(MCONTACT hContact,int countryNumber) // always call in context of main thread
static void __fastcall UnsetStatusIcon(MCONTACT hContact)
{
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODULENAME;
sid.flags = MBF_HIDDEN;
Srmm_ModifyIcon(hContact, &sid);
@@ -141,7 +141,6 @@ void CALLBACK UpdateStatusIcons(LPARAM) while (msgwi.hContact != NULL) {
/* is a message window opened for this contact? */
MessageWindowData msgw; /* output */
- msgw.cbSize = sizeof(msgw);
if (!CallService(MS_MSG_GETWINDOWDATA,(WPARAM)&msgwi,(LPARAM)&msgw) && msgw.uState & MSG_WINDOW_STATE_EXISTS) {
if (bShowStatusIcon) {
int countryNumber = ServiceDetectContactOriginCountry((WPARAM)msgwi.hContact, 0);
@@ -180,7 +179,7 @@ static int ExtraImgSettingChanged(WPARAM hContact, LPARAM lParam) static int ExtraImgModulesLoaded(WPARAM, LPARAM)
{
/* Status Icon */
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODULENAME; // dwID = 0
sid.flags = MBF_HIDDEN;
Srmm_AddIcon(&sid);
diff --git a/plugins/Dropbox/src/dropbox_events.cpp b/plugins/Dropbox/src/dropbox_events.cpp index 77f5e2c820..13413a56dd 100644 --- a/plugins/Dropbox/src/dropbox_events.cpp +++ b/plugins/Dropbox/src/dropbox_events.cpp @@ -109,15 +109,13 @@ int CDropbox::OnProtoAck(WPARAM, LPARAM lParam) WORD status = ack->lParam;
bool canSendOffline = (CallProtoService(ack->szModule, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_IMSENDOFFLINE) > 0;
- MessageWindowInputData msgwi = { sizeof(msgwi) };
+ MessageWindowInputData msgwi;
msgwi.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
for (MCONTACT hContact = db_find_first(ack->szModule); hContact; hContact = db_find_next(hContact, ack->szModule)) {
msgwi.hContact = hContact;
MessageWindowData msgw;
- msgw.cbSize = sizeof(msgw);
-
if (!CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgwi, (LPARAM)&msgw) && msgw.uState & MSG_WINDOW_STATE_EXISTS) {
BBButton bbd = {};
bbd.pszModuleName = MODULE;
diff --git a/plugins/Dropbox/src/dropbox_options.cpp b/plugins/Dropbox/src/dropbox_options.cpp index 8403890397..68c6d0316e 100644 --- a/plugins/Dropbox/src/dropbox_options.cpp +++ b/plugins/Dropbox/src/dropbox_options.cpp @@ -123,15 +123,13 @@ void CDropboxOptionsInterception::OnApply() interceptedProtos.AppendFormat("%s\t", acc->szModuleName);
// hide tabsrmm button for intercepted accounts
- MessageWindowInputData msgwi = { sizeof(msgwi) };
+ MessageWindowInputData msgwi;
msgwi.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
for (MCONTACT hContact = db_find_first(acc->szModuleName); hContact; hContact = db_find_next(hContact, acc->szModuleName)) {
msgwi.hContact = hContact;
MessageWindowData msgw;
- msgw.cbSize = sizeof(msgw);
-
if (!CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&msgwi, (LPARAM)&msgw) && msgw.uState & MSG_WINDOW_STATE_EXISTS) {
BBButton bbd = {};
bbd.pszModuleName = MODULE;
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp index c4e450a1d8..e61459db72 100644 --- a/plugins/FavContacts/src/services.cpp +++ b/plugins/FavContacts/src/services.cpp @@ -52,7 +52,7 @@ int ProcessSrmmEvent(WPARAM, LPARAM lParam) WindowList_Add(hDialogsList, event->hwndWindow, event->hContact);
BYTE fav = db_get_b(event->hContact, "FavContacts", "IsFavourite", 0);
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = "FavContacts";
sid.flags = fav ? 0 : MBF_DISABLED;
Srmm_ModifyIcon(event->hContact, &sid);
@@ -92,7 +92,7 @@ int ProcessSrmmIconClick(WPARAM hContact, LPARAM lParam) db_set_b(hContact, "FavContacts", "IsFavourite", fav);
if (fav) CallService(MS_AV_GETAVATARBITMAP, hContact, 0);
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = "FavContacts";
sid.flags = fav ? 0 : MBF_DISABLED;
Srmm_ModifyIcon(hContact, &sid);
@@ -146,7 +146,7 @@ int ProcessModulesLoaded(WPARAM, LPARAM) {
HookEvent(ME_TTB_MODULELOADED, ProcessTBLoaded);
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = "FavContacts";
sid.szTooltip = LPGEN("Favorite Contacts");
sid.hIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib);
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index e3acda5536..1858cde76c 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -141,7 +141,7 @@ void RegisterIcons() static void SetSrmmIcon(MCONTACT hContact, LPTSTR ptszMirver) { - StatusIconData sid = { sizeof(sid) }; + StatusIconData sid = {}; sid.szModule = MODULENAME; sid.dwId = 1; sid.flags = MBF_UNICODE; @@ -889,7 +889,7 @@ static int OnSrmmWindowEvent(WPARAM, LPARAM lParam) return 0; MessageWindowEventData *event = (MessageWindowEventData *)lParam; - if (event == NULL || event->cbSize < sizeof(MessageWindowEventData)) + if (event == NULL) return 0; if (event->uType == MSG_WINDOW_EVT_OPEN) { @@ -928,7 +928,7 @@ int OnModulesLoaded(WPARAM, LPARAM) RegisterIcons(); if (db_get_b(NULL, MODULENAME, "StatusBarIcon", 1)) { - StatusIconData sid = { sizeof(sid) }; + StatusIconData sid = {}; sid.szModule = MODULENAME; sid.flags = MBF_HIDDEN; sid.dwId = 1; diff --git a/plugins/HistorySweeperLight/src/historysweeperlight.cpp b/plugins/HistorySweeperLight/src/historysweeperlight.cpp index e9b7316f25..87e42974f6 100644 --- a/plugins/HistorySweeperLight/src/historysweeperlight.cpp +++ b/plugins/HistorySweeperLight/src/historysweeperlight.cpp @@ -238,7 +238,6 @@ void SetSrmmIcon(MCONTACT hContact) int sweep = db_get_b(hContact, ModuleName, "SweepHistory", 0);
StatusIconData sid = { 0 };
- sid.cbSize = sizeof(sid);
sid.szModule = ModuleName;
for (int i = 0; i < 4; i++) {
diff --git a/plugins/HistorySweeperLight/src/main.cpp b/plugins/HistorySweeperLight/src/main.cpp index 990f957d9c..ade9f3e678 100644 --- a/plugins/HistorySweeperLight/src/main.cpp +++ b/plugins/HistorySweeperLight/src/main.cpp @@ -55,7 +55,7 @@ int OnIconPressed(WPARAM hContact, LPARAM lParam) if (!(sicd->flags & MBCF_RIGHTBUTTON) && !mir_strcmp(sicd->szModule, ModuleName) && db_get_b(NULL, ModuleName, "ChangeInMW", 0)) {
int nh = sicd->dwId;
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = ModuleName;
sid.dwId = nh;
sid.flags = MBF_HIDDEN;
@@ -75,7 +75,7 @@ int OnModulesLoaded(WPARAM, LPARAM) {
int sweep = db_get_b(NULL, ModuleName, "SweepHistory", 0);
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = ModuleName;
sid.hIcon = LoadIconEx("actG");
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index 36dcd48c01..d2b68c7a12 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -169,7 +169,6 @@ void SaveSettings(HWND hwndDlg) int st = db_get_b(NULL, ModuleName, "SweepHistory", 0);
StatusIconData sid = { 0 };
- sid.cbSize = sizeof(sid);
sid.szModule = ModuleName;
sid.dwId = 0;
sid.hIcon = LoadIconEx("actG");
diff --git a/plugins/MessageState/src/messagestate.cpp b/plugins/MessageState/src/messagestate.cpp index b9dee446e2..cace9a53ed 100644 --- a/plugins/MessageState/src/messagestate.cpp +++ b/plugins/MessageState/src/messagestate.cpp @@ -19,7 +19,7 @@ const wchar_t* Tooltips[] = void SetSRMMIcon(MCONTACT hContact, SRMM_ICON_TYPE type, time_t time)
{
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODULENAME;
sid.dwId = 1;
sid.flags = MBF_UNICODE;
@@ -101,7 +101,7 @@ int OnModulesLoaded(WPARAM, LPARAM) Icon_Register(g_hInst, MODULENAME, Icons, _countof(Icons));
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODULENAME;
sid.flags = MBF_HIDDEN;
sid.dwId = 1;
diff --git a/plugins/MirFox/src/MirandaUtils.cpp b/plugins/MirFox/src/MirandaUtils.cpp index c0bbeded82..c16eca6fe4 100644 --- a/plugins/MirFox/src/MirandaUtils.cpp +++ b/plugins/MirFox/src/MirandaUtils.cpp @@ -357,12 +357,10 @@ int MirandaUtils::on_hook_OpenMW(WPARAM wParam, LPARAM lParam) }
MessageWindowData mwd;
- mwd.cbSize = sizeof(MessageWindowData);
mwd.hContact = (UINT_PTR)param->targetHandle;
mwd.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
MessageWindowInputData mwid;
- mwid.cbSize = sizeof(MessageWindowInputData);
mwid.hContact = (UINT_PTR)param->targetHandle;
mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
diff --git a/plugins/MirLua/src/m_message.cpp b/plugins/MirLua/src/m_message.cpp index 05a064eedf..f9782b1945 100644 --- a/plugins/MirLua/src/m_message.cpp +++ b/plugins/MirLua/src/m_message.cpp @@ -72,7 +72,6 @@ LUAMOD_API int luaopen_m_message(lua_State *L) luaL_newlib(L, messageApi);
MT<MessageWindowEventData>(L, "MessageWindowEventData")
- .Field(&MessageWindowEventData::szModule, "Module", LUA_TSTRINGA)
.Field(&MessageWindowEventData::uType, "Type", LUA_TINTEGER)
.Field(&MessageWindowEventData::hContact, "hContact", LUA_TINTEGER)
.Field(&MessageWindowEventData::uFlags, "Flags", LUA_TINTEGER);
diff --git a/plugins/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/src/svcs_srmm.cpp index 882d0eaf70..785556dfcf 100644 --- a/plugins/MirOTR/src/svcs_srmm.cpp +++ b/plugins/MirOTR/src/svcs_srmm.cpp @@ -6,16 +6,14 @@ BBButton OTRButton; int SVC_IconPressed(WPARAM hContact, LPARAM lParam) { StatusIconClickData *sicd = (StatusIconClickData *)lParam; - if(sicd->cbSize < sizeof(StatusIconClickData)) - return 0; - if(mir_strcmp(sicd->szModule, MODULENAME) == 0) { + if (mir_strcmp(sicd->szModule, MODULENAME) == 0) { char *proto = GetContactProto(hContact); - if(proto && db_get_b(hContact, proto, "ChatRoom", 0)) + if (proto && db_get_b(hContact, proto, "ChatRoom", 0)) return 0; ShowOTRMenu(hContact, sicd->clickLocation); } - + return 0; } @@ -27,7 +25,7 @@ void SetEncryptionStatus(MCONTACT hContact, TrustLevel level) BBButton button = OTRButton; - StatusIconData sid = { sizeof(sid) }, sid2 = { sizeof(sid) }; + StatusIconData sid = {}, sid2 = {}; sid.szModule = MODULENAME; sid.dwId = 0; sid.flags = MBF_HIDDEN; @@ -117,7 +115,7 @@ void InitSRMM() hIconPrivate = IcoLib_GetIcon(ICON_PRIVATE, 0); hIconUnverified = IcoLib_GetIcon(ICON_UNVERIFIED, 0); - StatusIconData sid = { sizeof(sid) }; + StatusIconData sid = {}; sid.szModule = MODULENAME; sid.hIcon = hIconFinished; sid.hIconDisabled = hIconNotSecure; diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index bc1bf2957f..ad9bdc133b 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -789,12 +789,10 @@ MEVENT CAppletManager::SendMessageToContact(MCONTACT hContact, tstring strMessag bool CAppletManager::IsMessageWindowOpen(MCONTACT hContact) { MessageWindowInputData mwid; - mwid.cbSize = sizeof(MessageWindowInputData); mwid.hContact = hContact; mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH; MessageWindowData mwd; - mwd.cbSize = sizeof(MessageWindowData); CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd); if (mwd.uState & MSG_WINDOW_STATE_EXISTS) return true; diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp index 3752fad651..08adac9ee3 100644 --- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp +++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp @@ -85,12 +85,11 @@ void __cdecl AutoreplyDelayThread(void *_ad) int IsSRMsgWindowOpen(MCONTACT hContact, int DefaultRetVal)
{
if (ServiceExists(MS_MSG_GETWINDOWDATA)) {
- MessageWindowData mwd = { 0 };
- mwd.cbSize = sizeof(mwd);
- MessageWindowInputData mwid = { 0 };
- mwid.cbSize = sizeof(mwid);
+ MessageWindowInputData mwid = {};
mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
mwid.hContact = hContact;
+
+ MessageWindowData mwd = {};
return !CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd) && mwd.hwndWindow;
}
diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp index b9ef026ca1..5161e03586 100644 --- a/plugins/NewEventNotify/src/main.cpp +++ b/plugins/NewEventNotify/src/main.cpp @@ -170,12 +170,11 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) int CheckMsgWnd(MCONTACT hContact)
{
if (g_IsSrmmWindowAPI) {
- MessageWindowData mwd;
MessageWindowInputData mwid;
- mwid.cbSize = sizeof(MessageWindowInputData);
mwid.hContact = hContact;
mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
- mwd.cbSize = sizeof(MessageWindowData);
+
+ MessageWindowData mwd;
mwd.hContact = hContact;
if (!CallService(MS_MSG_GETWINDOWDATA, (WPARAM) &mwid, (LPARAM) &mwd))
if (mwd.hwndWindow != NULL && (mwd.uState & MSG_WINDOW_STATE_EXISTS))
diff --git a/plugins/NewXstatusNotify/src/utils.cpp b/plugins/NewXstatusNotify/src/utils.cpp index 88a457b780..e9f5cae71d 100644 --- a/plugins/NewXstatusNotify/src/utils.cpp +++ b/plugins/NewXstatusNotify/src/utils.cpp @@ -25,12 +25,10 @@ bool CheckMsgWnd(MCONTACT hContact)
{
MessageWindowInputData mwid;
- mwid.cbSize = sizeof(MessageWindowInputData);
mwid.hContact = hContact;
mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
MessageWindowData mwd;
- mwd.cbSize = sizeof(MessageWindowData);
mwd.hContact = hContact;
if (CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd) != NULL)
return false;
diff --git a/plugins/New_GPG/src/icons.cpp b/plugins/New_GPG/src/icons.cpp index d003b7da23..64c9208d97 100644 --- a/plugins/New_GPG/src/icons.cpp +++ b/plugins/New_GPG/src/icons.cpp @@ -51,7 +51,7 @@ void setSrmmIcon(MCONTACT h) bool enabled = isContactSecured(hContact);
MCONTACT hMC = db_mc_tryMeta(hContact);
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = szGPGModuleName;
sid.hIcon = IcoLib_GetIcon("secured");
sid.dwId = 1;
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index 6fb74f3807..79a68b4bba 100644 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -124,7 +124,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) if(!db_get_b(NULL, szGPGModuleName, "FirstRun", 1))
InitCheck();
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = szGPGModuleName;
sid.flags = MBF_HIDDEN;
sid.dwId = 0x00000001;
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index 3e735690ae..3d95c96dd8 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -165,7 +165,7 @@ INT_PTR ServiceToggle(WPARAM hContact, LPARAM) remove = !remove;
db_set_b(hContact, MODULE, DBSETTING_REMOVE, remove != 0);
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODULE;
for (int i = 0; i < 2; ++i) {
@@ -191,7 +191,7 @@ int WindowEvent(WPARAM, LPARAM lParam) bool chat_room = (proto && db_get_b(hContact, proto, "ChatRoom", 0) != 0);
int remove = db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) != 0;
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODULE;
for (int i=0; i < 2; ++i) {
sid.dwId = i;
@@ -206,7 +206,7 @@ int WindowEvent(WPARAM, LPARAM lParam) int IconPressed(WPARAM hContact, LPARAM lParam)
{
StatusIconClickData *sicd = (StatusIconClickData *)lParam;
- if (sicd->cbSize < sizeof(StatusIconClickData))
+ if (sicd == nullptr)
return 0;
if (sicd->flags & MBCF_RIGHTBUTTON) return 0; // ignore right-clicks
@@ -224,7 +224,7 @@ int IconPressed(WPARAM hContact, LPARAM lParam) // add icon to srmm status icons
void SrmmMenu_Load()
{
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODULE;
sid.dwId = 0;
diff --git a/plugins/Nudge/src/shake.cpp b/plugins/Nudge/src/shake.cpp index 2bce93d0e1..50982fdde2 100644 --- a/plugins/Nudge/src/shake.cpp +++ b/plugins/Nudge/src/shake.cpp @@ -41,13 +41,10 @@ INT_PTR ShakeChat(WPARAM wParam, LPARAM) //char srmmName[100];
MessageWindowData mwd;
- MessageWindowInputData mwid;
-
- mwd.cbSize = sizeof(MessageWindowData);
mwd.hContact = db_mc_tryMeta(wParam);
mwd.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
- mwid.cbSize = sizeof(MessageWindowInputData);
+ MessageWindowInputData mwid;
mwid.hContact = mwd.hContact;
mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd);
diff --git a/plugins/Popup/src/srmm_menu.cpp b/plugins/Popup/src/srmm_menu.cpp index b21f96f2d6..a13216a0f7 100644 --- a/plugins/Popup/src/srmm_menu.cpp +++ b/plugins/Popup/src/srmm_menu.cpp @@ -38,7 +38,7 @@ static void SrmmMenu_UpdateIcon(MCONTACT hContact) int mode = db_get_b(hContact, MODULNAME, "ShowMode", PU_SHOWMODE_AUTO);
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODULNAME;
for (int i = 0; i < 4; i++) {
@@ -104,7 +104,7 @@ static int SrmmMenu_ProcessIconClick(WPARAM hContact, LPARAM lParam) void SrmmMenu_Load()
{
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODULNAME;
sid.dwId = 0;
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index d2570e7a55..4148295222 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -483,17 +483,16 @@ BOOL SaveLastUsedTimeStamp(MCONTACT hContact) int OnMsgEvent(WPARAM, LPARAM lParam)
{
MessageWindowEventData *ed = (MessageWindowEventData *)lParam;
- if (ed->hContact == NULL)
- return 0;
-
- if (ed->uType == MSG_WINDOW_EVT_OPEN)
+ if (ed->hContact != 0 && ed->uType == MSG_WINDOW_EVT_OPEN)
SaveLastUsedTimeStamp(ed->hContact);
- else if (ed->uType == MSG_WINDOW_EVT_CUSTOM) {
- struct TABSRMM_SessionInfo *si = (struct TABSRMM_SessionInfo*) ed->local;
- if (si != NULL)
- if (si->evtCode == tabMSG_WINDOW_EVT_CUSTOM_BEFORESEND)
- SaveLastUsedTimeStamp(ed->hContact);
- }
+ return 0;
+}
+
+int OnProtoBroadcast(WPARAM, LPARAM lParam)
+{
+ ACKDATA *ack = (ACKDATA*)lParam;
+ if (ack->type == ACKTYPE_MESSAGE && ack->result == ACKRESULT_SUCCESS)
+ SaveLastUsedTimeStamp(ack->hContact);
return 0;
}
@@ -555,6 +554,7 @@ extern "C" __declspec(dllexport) int Load(void) HookEvent(ME_MSG_WINDOWEVENT, OnMsgEvent);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged );
HookEvent(ME_OPT_INITIALISE, onOptInitialise);
+ HookEvent(ME_PROTO_ACK, OnProtoBroadcast);
return 0;
}
diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp index 970d78429a..596828869b 100644 --- a/plugins/Scriver/src/chat_window.cpp +++ b/plugins/Scriver/src/chat_window.cpp @@ -536,7 +536,7 @@ void CChatRoomDlg::UpdateStatusBar() sbd.pszText = L"";
SendMessage(m_hwndParent, CM_UPDATESTATUSBAR, (WPARAM)&sbd, (LPARAM)m_hwnd);
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = SRMM_MODULE;
Srmm_ModifyIcon(m_hContact, &sid);
}
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index b01c9cc288..36cd2601c6 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -151,7 +151,7 @@ static int ackevent(WPARAM, LPARAM lParam) dbei.cbBlob = (int)mir_strlen(item->sendBuffer) + 1;
dbei.pBlob = (PBYTE)item->sendBuffer;
- MessageWindowEvent evt = { sizeof(evt), item->hSendId, hContact, &dbei };
+ MessageWindowEvent evt = { item->hSendId, hContact, &dbei };
NotifyEventHooks(hHookWinWrite, 0, (LPARAM)&evt);
item->sendBuffer = (char *)dbei.pBlob;
diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index 3ba984c959..0698cdf2d9 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -65,7 +65,6 @@ void InputAreaContextMenu(HWND hwnd, WPARAM, LPARAM lParam, MCONTACT hContact) // First notification
MessageWindowPopupData mwpd;
- mwpd.cbSize = sizeof(mwpd);
mwpd.uType = MSG_WINDOWPOPUP_SHOWING;
mwpd.uFlags = MSG_WINDOWPOPUP_INPUT;
mwpd.hContact = hContact;
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index a798d00868..82ec8e9851 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -773,7 +773,7 @@ void CSrmmWindow::UpdateStatusBar() SendMessage(m_hwndParent, CM_UPDATESTATUSBAR, (WPARAM)&sbd, (LPARAM)m_hwnd);
UpdateReadChars();
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = SRMM_MODULE;
sid.flags = MBF_DISABLED;
Srmm_ModifyIcon(m_hContact, &sid);
@@ -1304,7 +1304,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) case DM_SWITCHTYPING:
if (IsTypingNotificationSupported()) {
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = SRMM_MODULE;
sid.dwId = 1;
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index b6478dc16b..30776f7aa5 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -286,11 +286,11 @@ static void RestoreUnreadMessageAlerts(void) static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
{
MessageWindowInputData *mwid = (MessageWindowInputData*)wParam;
- if (mwid == nullptr || mwid->cbSize != sizeof(MessageWindowInputData) || mwid->hContact == 0 || mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH)
+ if (mwid == nullptr || mwid->hContact == 0 || mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH)
return 1;
MessageWindowData *mwd = (MessageWindowData*)lParam;
- if (mwd == nullptr || mwd->cbSize != sizeof(MessageWindowData))
+ if (mwd == nullptr)
return 1;
HWND hwnd = WindowList_Find(pci->hWindowList, mwid->hContact);
@@ -306,7 +306,7 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam) static INT_PTR SetStatusText(WPARAM hContact, LPARAM lParam)
{
StatusTextData *st = (StatusTextData*)lParam;
- if (st != nullptr && st->cbSize != sizeof(StatusTextData))
+ if (st == nullptr)
return 1;
HWND hwnd = WindowList_Find(pci->hWindowList, hContact);
@@ -431,7 +431,7 @@ void CScriverWindow::Reattach(HWND hwndContainer) static void RegisterStatusIcons()
{
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = SRMM_MODULE;
sid.dwId = 1;
sid.hIcon = GetCachedIcon("scriver_TYPING");
@@ -442,7 +442,7 @@ static void RegisterStatusIcons() void ChangeStatusIcons()
{
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = SRMM_MODULE;
sid.dwId = 1;
sid.hIcon = GetCachedIcon("scriver_TYPING");
diff --git a/plugins/SecureIM/src/crypt_icons.cpp b/plugins/SecureIM/src/crypt_icons.cpp index b636464e38..3d7a74ac46 100644 --- a/plugins/SecureIM/src/crypt_icons.cpp +++ b/plugins/SecureIM/src/crypt_icons.cpp @@ -79,7 +79,7 @@ void ShowStatusIcon(MCONTACT hContact, int mode) ExtraIcon_Clear(g_hCLIcon, hMC);
}
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = (char*)MODULENAME;
for (int i = MODE_NATIVE; i < MODE_CNT; i++) {
sid.dwId = i;
diff --git a/plugins/SecureIM/src/svcs_srmm.cpp b/plugins/SecureIM/src/svcs_srmm.cpp index e2583947d2..7977d0932e 100644 --- a/plugins/SecureIM/src/svcs_srmm.cpp +++ b/plugins/SecureIM/src/svcs_srmm.cpp @@ -31,7 +31,7 @@ int __cdecl onIconPressed(WPARAM hContact, LPARAM lParam) void InitSRMMIcons()
{
// add icon to srmm status icons
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODULENAME;
sid.flags = MBF_DISABLED | MBF_HIDDEN;
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index ba1cbaf64d..7a813390f3 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -41,7 +41,7 @@ bool g_bIncompletedSave; HWND g_hDlg;
HWND g_hSDlg;
bool DONT = false;
-bool StartUp, isLastTRUE = false, g_mode, bSC = false;
+bool StartUp, isLastTRUE = false, bSC = false;
MCONTACT session_list[255] = { 0 };
MCONTACT user_session_list[255] = { 0 };
@@ -394,25 +394,17 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) INT_PTR CloseCurrentSession(WPARAM, LPARAM)
{
- HWND hWnd;
MessageWindowInputData mwid;
MessageWindowData mwd;
while (session_list[0] != 0) {
- mwid.cbSize = sizeof(MessageWindowInputData);
mwid.hContact = session_list[0];
mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
- mwd.cbSize = sizeof(MessageWindowData);
mwd.hContact = mwid.hContact;
mwd.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
CallService(MS_MSG_GETWINDOWDATA, (WPARAM)&mwid, (LPARAM)&mwd);
-
- if (g_mode) {
- hWnd = GetAncestor(mwd.hwndWindow, GA_ROOT);
- SendMessage(hWnd, WM_CLOSE, 0, 1);
- }
- else SendMessage(mwd.hwndWindow, WM_CLOSE, 0, 0);
+ SendMessage(mwd.hwndWindow, WM_CLOSE, 0, 0);
}
memset(session_list, 0, sizeof(session_list));
return 0;
@@ -685,7 +677,6 @@ static int OnSrmmWindowEvent(WPARAM, LPARAM lParam) {
MessageWindowEventData *MWeventdata = (MessageWindowEventData*)lParam;
if (MWeventdata->uType == MSG_WINDOW_EVT_OPEN) {
- if (strstr(MWeventdata->szModule, "tabSRMsg")) g_mode = 1;
AddToCurSession(MWeventdata->hContact, 0);
if (g_bCrashRecovery)
db_set_b(MWeventdata->hContact, MODNAME, "wasInLastSession", 1);
diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp index 5fddca1ebe..9f8eab1afe 100644 --- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp +++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp @@ -190,7 +190,7 @@ static int MsgDlgHook(WPARAM, LPARAM lParam) const MessageWindowEventData *wndEvtData = (MessageWindowEventData*)lParam;
switch (wndEvtData->uType) {
case MSG_WINDOW_EVT_OPENING:
- if (wndEvtData->cbSize >= sizeof(MessageWindowEventData)) {
+ {
MsgWndData *msgwnd = new MsgWndData();
msgwnd->hwnd = wndEvtData->hwndWindow;
msgwnd->hContact = wndEvtData->hContact;
@@ -204,34 +204,31 @@ static int MsgDlgHook(WPARAM, LPARAM lParam) mir_subclassWindow(msgwnd->hwnd, MessageDlgSubclass);
msgwnd->CreateSmileyButton();
- {
- mir_cslock lck(csWndList);
- g_MsgWndList.insert(msgwnd);
- }
- SetRichOwnerCallback(wndEvtData->hwndWindow, wndEvtData->hwndInput, wndEvtData->hwndLog);
-
- if (wndEvtData->hwndLog)
- SetRichCallback(wndEvtData->hwndLog, wndEvtData->hContact, false, false);
- if (wndEvtData->hwndInput)
- SetRichCallback(wndEvtData->hwndInput, wndEvtData->hContact, false, false);
+ mir_cslock lck(csWndList);
+ g_MsgWndList.insert(msgwnd);
}
+
+ SetRichOwnerCallback(wndEvtData->hwndWindow, wndEvtData->hwndInput, wndEvtData->hwndLog);
+
+ if (wndEvtData->hwndLog)
+ SetRichCallback(wndEvtData->hwndLog, wndEvtData->hContact, false, false);
+ if (wndEvtData->hwndInput)
+ SetRichCallback(wndEvtData->hwndInput, wndEvtData->hContact, false, false);
break;
case MSG_WINDOW_EVT_OPEN:
- if (wndEvtData->cbSize >= sizeof(MessageWindowEventData)) {
- SetRichOwnerCallback(wndEvtData->hwndWindow, wndEvtData->hwndInput, wndEvtData->hwndLog);
- if (wndEvtData->hwndLog)
- SetRichCallback(wndEvtData->hwndLog, wndEvtData->hContact, true, true);
- if (wndEvtData->hwndInput) {
- SetRichCallback(wndEvtData->hwndInput, wndEvtData->hContact, true, true);
- SendMessage(wndEvtData->hwndInput, WM_REMAKERICH, 0, 0);
- }
+ SetRichOwnerCallback(wndEvtData->hwndWindow, wndEvtData->hwndInput, wndEvtData->hwndLog);
+ if (wndEvtData->hwndLog)
+ SetRichCallback(wndEvtData->hwndLog, wndEvtData->hContact, true, true);
+ if (wndEvtData->hwndInput) {
+ SetRichCallback(wndEvtData->hwndInput, wndEvtData->hContact, true, true);
+ SendMessage(wndEvtData->hwndInput, WM_REMAKERICH, 0, 0);
}
break;
case MSG_WINDOW_EVT_CLOSE:
- if (wndEvtData->cbSize >= sizeof(MessageWindowEventData) && wndEvtData->hwndLog) {
+ if (wndEvtData->hwndLog) {
CloseRichCallback(wndEvtData->hwndLog);
CloseRichOwnerCallback(wndEvtData->hwndWindow);
}
diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index 1706817874..63d7ab3304 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -71,7 +71,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) static int IconsChanged(WPARAM, LPARAM) { - StatusIconData sid = { sizeof(sid) }; + StatusIconData sid = {}; sid.szModule = MODULE_NAME; sid.hIconDisabled = IcoLib_GetIcon("spellchecker_disabled"); sid.flags = MBF_HIDDEN | MBF_UNICODE; @@ -196,7 +196,7 @@ static int ModulesLoaded(WPARAM, LPARAM) HookEvent(ME_MSG_WINDOWPOPUP, MsgWindowPopup); HookEvent(ME_MSG_ICONPRESSED, IconPressed); - StatusIconData sid = { sizeof(sid) }; + StatusIconData sid = {}; sid.szModule = MODULE_NAME; sid.hIconDisabled = IcoLib_GetIcon("spellchecker_disabled"); sid.flags = MBF_UNICODE | MBF_HIDDEN; diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index 3c5a4a65e8..6c1e6dd82c 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -844,7 +844,7 @@ void GetContactLanguage(Dialog *dlg) void ModifyIcon(Dialog *dlg)
{
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODULE_NAME;
for (int i = 0; i < languages.getCount(); i++) {
@@ -1280,7 +1280,7 @@ BOOL HandleMenuSelection(Dialog *dlg, unsigned selection) int MsgWindowPopup(WPARAM, LPARAM lParam)
{
MessageWindowPopupData *mwpd = (MessageWindowPopupData *)lParam;
- if (mwpd == NULL || mwpd->cbSize < sizeof(MessageWindowPopupData) || mwpd->uFlags != MSG_WINDOWPOPUP_INPUT)
+ if (mwpd == NULL || mwpd->uFlags != MSG_WINDOWPOPUP_INPUT)
return 0;
DialogMapType::iterator dlgit = dialogs.find(mwpd->hwnd);
@@ -1353,9 +1353,6 @@ int MsgWindowEvent(WPARAM, LPARAM lParam) if (event == NULL)
return 0;
- if (event->cbSize < sizeof(MessageWindowEventData))
- return 0;
-
if (event->uType == MSG_WINDOW_EVT_OPEN)
AddContactTextBox(event->hContact, event->hwndInput, "DefaultSRMM", TRUE, event->hwndWindow);
else if (event->uType == MSG_WINDOW_EVT_CLOSING)
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 8d4bc0ecbf..f507994631 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -1527,7 +1527,7 @@ void CTabBaseDlg::DM_ErrorDetected(int type, int flag) int SI_InitStatusIcons() { - StatusIconData sid = { sizeof(sid) }; + StatusIconData sid = {}; sid.szModule = MSG_ICON_MODULE; sid.dwId = MSG_ICON_SOUND; // Sounds Srmm_AddIcon(&sid); diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 8c856fbdc8..9646963098 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -103,7 +103,6 @@ void CTabBaseDlg::ShowPopupMenu(const CCtrlBase &pCtrl, POINT pt) MessageWindowPopupData mwpd;
// First notification
- mwpd.cbSize = sizeof(mwpd);
mwpd.uType = MSG_WINDOWPOPUP_SHOWING;
mwpd.uFlags = (pCtrl.GetCtrlId() == IDC_SRMM_LOG ? MSG_WINDOWPOPUP_LOG : MSG_WINDOWPOPUP_INPUT);
mwpd.hContact = m_hContact;
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index f9f02f9703..f0e8c76e7f 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -67,11 +67,11 @@ int SmileyAddOptionsChanged(WPARAM, LPARAM) static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
{
MessageWindowInputData *mwid = (MessageWindowInputData*)wParam;
- if (mwid == nullptr || (mwid->cbSize != sizeof(MessageWindowInputData)) || (mwid->hContact == 0) || (mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH))
+ if (mwid == nullptr || mwid->hContact == 0 || mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH)
return 1;
MessageWindowData *mwd = (MessageWindowData*)lParam;
- if (mwd == nullptr || (mwd->cbSize != sizeof(MessageWindowData)))
+ if (mwd == nullptr)
return 1;
HWND hwnd = M.FindWindow(mwid->hContact);
@@ -349,7 +349,7 @@ static void SetStatusTextWorker(CTabBaseDlg *dat, StatusTextData *st) dat->m_sbCustom = nullptr;
}
- if (st != nullptr && st->cbSize == sizeof(StatusTextData))
+ if (st != nullptr)
dat->m_sbCustom = new StatusTextData(*st);
dat->tabUpdateStatusBar();
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index 3af62c305b..afaa5a663e 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -499,7 +499,7 @@ int SendQueue::ackMessage(CTabBaseDlg *dat, WPARAM wParam, LPARAM lParam) dbei.flags |= DBEF_UTF; dbei.pBlob = (PBYTE)job.szSendBuffer; - MessageWindowEvent evt = { sizeof(evt), job.iSendId, job.hContact, &dbei }; + MessageWindowEvent evt = { job.iSendId, job.hContact, &dbei }; NotifyEventHooks(PluginConfig.m_event_WriteEvent, 0, (LPARAM)&evt); job.szSendBuffer = (char*)dbei.pBlob; diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index cbd8e04625..c538f898c1 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -39,8 +39,7 @@ static void TrayAnimThread(LPVOID) {
Thread_SetName("TabSRMM: TrayAnimThread");
- int iAnimMode = (PluginConfig.m_AnimTrayIcons[0] && PluginConfig.m_AnimTrayIcons[1] && PluginConfig.m_AnimTrayIcons[2] &&
- PluginConfig.m_AnimTrayIcons[3]);
+ int iAnimMode = (PluginConfig.m_AnimTrayIcons[0] && PluginConfig.m_AnimTrayIcons[1] && PluginConfig.m_AnimTrayIcons[2] && PluginConfig.m_AnimTrayIcons[3]);
DWORD dwElapsed = 0, dwAnimStep = 0;
HICON hIconDefault = iAnimMode ? PluginConfig.m_AnimTrayIcons[0] : PluginConfig.g_iconContainer;
DWORD idleTimer = 0;
@@ -101,10 +100,8 @@ void TSAPI CreateTrayMenus(int mode) PluginConfig.g_hMenuFavorites = CreatePopupMenu();
PluginConfig.g_hMenuRecent = CreatePopupMenu();
PluginConfig.g_hMenuTrayContext = GetSubMenu(PluginConfig.g_hMenuContext, 6);
- ModifyMenu(PluginConfig.g_hMenuTrayContext, 0, MF_BYPOSITION | MF_POPUP,
- (UINT_PTR)PluginConfig.g_hMenuFavorites, TranslateT("Favorites"));
- ModifyMenu(PluginConfig.g_hMenuTrayContext, 2, MF_BYPOSITION | MF_POPUP,
- (UINT_PTR)PluginConfig.g_hMenuRecent, TranslateT("Recent sessions"));
+ ModifyMenu(PluginConfig.g_hMenuTrayContext, 0, MF_BYPOSITION | MF_POPUP, (UINT_PTR)PluginConfig.g_hMenuFavorites, TranslateT("Favorites"));
+ ModifyMenu(PluginConfig.g_hMenuTrayContext, 2, MF_BYPOSITION | MF_POPUP, (UINT_PTR)PluginConfig.g_hMenuRecent, TranslateT("Recent sessions"));
LoadFavoritesAndRecent();
}
else {
@@ -135,7 +132,6 @@ void TSAPI CreateTrayMenus(int mode) void TSAPI CreateSystrayIcon(int create)
{
NOTIFYICONDATA nim;
-
nim.cbSize = sizeof(nim);
nim.hWnd = PluginConfig.g_hwndHotkeyHandler;
nim.uID = 100;
@@ -192,7 +188,7 @@ void TSAPI FlashTrayIcon(HICON hIcon) void TSAPI AddContactToFavorites(MCONTACT hContact, const wchar_t *szNickname, const char *szProto, wchar_t *szStatus, WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu)
{
wchar_t szMenuEntry[80];
- wchar_t szFinalNick[100];
+ wchar_t szFinalNick[100];
if (szNickname == nullptr)
wcsncpy_s(szFinalNick, pcli->pfnGetContactDisplayName(hContact, 0), _TRUNCATE);
@@ -201,15 +197,15 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const wchar_t *szNickname, c if (szProto == nullptr)
szProto = GetContactProto(hContact);
- if (szProto) {
- if (wStatus == 0)
- wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
- if (szStatus == nullptr)
- szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
- }
- else
+ if (szProto == nullptr)
return;
+ if (wStatus == 0)
+ wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+
+ if (szStatus == nullptr)
+ szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
+
if (hIcon == 0)
hIcon = Skin_LoadProtoIcon(szProto, wStatus);
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index 13b9fb893f..0960b61b54 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -97,7 +97,7 @@ MsgWndData::~MsgWndData() void MsgWndData::FlagsIconSet()
{
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODNAMEFLAGS;
if (!g_bShowStatusIconFlag)
sid.flags = MBF_HIDDEN;
@@ -112,7 +112,7 @@ void MsgWndData::FlagsIconSet() void UpdateStatusIcons()
{
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODNAMEFLAGS;
if (!g_bShowStatusIconFlag)
sid.flags = MBF_HIDDEN;
@@ -234,7 +234,7 @@ void SvcFlagsLoadModule() void SvcFlagsOnModulesLoaded()
{
/* Status Icon */
- StatusIconData sid = { sizeof(sid) };
+ StatusIconData sid = {};
sid.szModule = MODNAMEFLAGS;
if (!g_bShowStatusIconFlag)
sid.flags = MBF_HIDDEN;
diff --git a/plugins/Utils.pas/mircontacts.pas b/plugins/Utils.pas/mircontacts.pas index 8cc128ab2f..293b954174 100644 --- a/plugins/Utils.pas/mircontacts.pas +++ b/plugins/Utils.pas/mircontacts.pas @@ -414,18 +414,14 @@ var begin
wnd:=GetParent(wnd); //!!
hContact:=db_find_first();
- with mwid do
- begin
- cbSize:=SizeOf(mwid);
- uFlags:=MSG_WINDOW_UFLAG_MSG_BOTH;
- end;
- mwod.cbSize:=SizeOf(mwod);
+ mwid.uFlags:=MSG_WINDOW_UFLAG_MSG_BOTH;
+
while hContact<>0 do
begin
mwid.hContact:=hContact;
if CallService(MS_MSG_GETWINDOWDATA,wparam(@mwid),lparam(@mwod))=0 then
begin
- if {((mwod.uState and MSG_WINDOW_STATE_FOCUS)<>0) and} (mwod.hwndWindow=wnd) then
+ if mwod.hwndWindow=wnd then
begin
result:=mwid.hContact;
exit;
@@ -455,9 +451,6 @@ procedure ShowContactDialog(hContact:TMCONTACT;DblClk:boolean=true;anystatus:boo var
pc:array [0..127] of AnsiChar;
begin
-{
-CallService(MS_CLIST_CONTACTDOUBLECLICKED,hContact,0);
-}
if (hContact<>0) and (db_is_contact(hContact)<>0) then
begin
if StrCopy(pc,GetContactProto(hContact))<>nil then
diff --git a/plugins/WinterSpeak/src/SpeakAnnounce.cpp b/plugins/WinterSpeak/src/SpeakAnnounce.cpp index ebd0949832..a9070f595d 100644 --- a/plugins/WinterSpeak/src/SpeakAnnounce.cpp +++ b/plugins/WinterSpeak/src/SpeakAnnounce.cpp @@ -148,11 +148,10 @@ bool SpeakAnnounce::readMessage(MCONTACT contact) if (m_db.getEventFlag(AnnounceDatabase::EventFlag_DialogOpen) || m_db.getEventFlag(AnnounceDatabase::EventFlag_DialogFocused)) {
// Do not notify if window is already open
MessageWindowInputData mwid;
- mwid.cbSize = sizeof(MessageWindowInputData);
mwid.hContact = contact;
mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
+
MessageWindowData mwd;
- mwd.cbSize = sizeof(MessageWindowData);
mwd.hContact = contact;
//returns 0 on success and returns non-zero (1) on error or if no window data exists for that hcontact
if (CallService(MS_MSG_GETWINDOWDATA, (WPARAM) &mwid, (LPARAM) &mwd) == 0) {
|