summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp1
-rw-r--r--plugins/TabSRMM/src/msgs.cpp6
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp2
-rw-r--r--plugins/TabSRMM/src/trayicon.cpp26
5 files changed, 16 insertions, 21 deletions
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);