summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r--plugins/TabSRMM/src/eventpopups.cpp4
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp2
-rw-r--r--plugins/TabSRMM/src/globals.cpp4
-rw-r--r--plugins/TabSRMM/src/mim.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp6
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp4
-rw-r--r--plugins/TabSRMM/src/msglog.cpp3
-rw-r--r--plugins/TabSRMM/src/sendlater.cpp2
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp7
-rw-r--r--plugins/TabSRMM/src/templates.cpp3
10 files changed, 17 insertions, 20 deletions
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp
index bdace029f2..dca01dc9c6 100644
--- a/plugins/TabSRMM/src/eventpopups.cpp
+++ b/plugins/TabSRMM/src/eventpopups.cpp
@@ -504,7 +504,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent)
else
szHeader[0] = 0;
- DBEVENTINFO dbe = { sizeof(dbe) };
+ DBEVENTINFO dbe = {};
if (pdata->pluginOptions->bPreview && hContact) {
dbe.cbBlob = db_event_getBlobSize(hEvent);
dbe.pBlob = (PBYTE)mir_alloc(dbe.cbBlob);
@@ -569,7 +569,7 @@ static int PopupShowT(NEN_OPTIONS *pluginOptions, MCONTACT hContact, MEVENT hEve
if (!PluginConfig.g_bPopupAvail)
return 0;
- DBEVENTINFO dbe = { sizeof(dbe) };
+ DBEVENTINFO dbe = {};
// fix for a crash
if (hEvent && (pluginOptions->bPreview || hContact == 0)) {
dbe.cbBlob = db_event_getBlobSize(hEvent);
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index 446dec3455..1df30b4efd 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -1474,7 +1474,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam)
HWND hwndDlg = dat->hwnd, hwndContainer = pContainer->hwnd, hwndTab = GetParent(dat->hwnd);
MEVENT hDbEvent = (MEVENT)lParam;
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
db_event_get(hDbEvent, &dbei);
if (dat->hDbEventFirst == NULL)
dat->hDbEventFirst = hDbEvent;
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 217061eea3..5706e0d843 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -524,7 +524,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void)
sendLater->addContact(hContact);
for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
db_event_get(hDbEvent, &dbei);
if (!dbei.markedRead() && dbei.eventType == EVENTTYPE_MESSAGE) {
if (M.FindWindow(hContact) != NULL)
@@ -588,7 +588,7 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c)
text.Format(TranslateT("changed status from %s to %s."), szOldStatus, szNewStatus);
T2Utf szMsg(text);
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.pBlob = (PBYTE)(char*)szMsg;
dbei.cbBlob = (int)mir_strlen(szMsg) + 1;
dbei.flags = DBEF_UTF | DBEF_READ;
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index 968e72ba61..c5999eee9f 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -406,7 +406,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
{
wchar_t szName[CONTAINER_NAMELEN + 1];
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
db_event_get(hDbEvent, &dbei);
HWND hwnd = M.FindWindow(hContact);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 0c979772c5..40cfee8e07 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -1361,7 +1361,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
}
for (MEVENT hdbEvent = db_event_last(dat->hContact); hdbEvent; hdbEvent = db_event_prev(dat->hContact, hdbEvent)) {
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
db_event_get(hdbEvent, &dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) {
dat->lastMessage = dbei.timestamp;
@@ -1421,7 +1421,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
// show a popup if wanted...
if (newData->bWantPopup) {
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
newData->bWantPopup = FALSE;
db_event_get(newData->hdbEvent, &dbei);
tabSRMM_ShowPopup(dat->hContact, newData->hdbEvent, dbei.eventType, 0, 0, hwndDlg, dat->cache->getActiveProto());
@@ -2738,7 +2738,7 @@ quote_from_last:
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXGETSEL, 0, (LPARAM)&sel);
if (sel.cpMin == sel.cpMax) {
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.cbBlob = db_event_getBlobSize(hDBEvent);
wchar_t *szText = (wchar_t*)mir_alloc((dbei.cbBlob + 1) * sizeof(wchar_t)); //URLs are made one char bigger for crlf
dbei.pBlob = (BYTE*)szText;
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index d655767595..b34c26cd99 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -1120,7 +1120,7 @@ void TSAPI FindFirstEvent(TWindowData *dat)
int i;
MEVENT hPrevEvent;
{
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
// ability to load only current session's history
if (dat->bActualHistory)
i = dat->cache->getSessionMsgCount();
@@ -1144,7 +1144,7 @@ void TSAPI FindFirstEvent(TWindowData *dat)
break;
case LOADHISTORY_TIME:
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
if (dat->hDbEventFirst == NULL)
dbei.timestamp = time(NULL);
else
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index 23be946173..f87e1e4c40 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -455,7 +455,6 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
if (streamData->dbei != 0)
dbei = *(streamData->dbei);
else {
- dbei.cbSize = sizeof(dbei);
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
if (dbei.cbBlob == -1)
return NULL;
@@ -1350,7 +1349,7 @@ void TSAPI StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAp
if (streamData.dbei != 0)
isSent = (streamData.dbei->flags & DBEF_SENT) != 0;
else {
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
db_event_get(hDbEventFirst, &dbei);
isSent = (dbei.flags & DBEF_SENT) != 0;
}
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp
index 7dd855c5f2..8887fd1123 100644
--- a/plugins/TabSRMM/src/sendlater.cpp
+++ b/plugins/TabSRMM/src/sendlater.cpp
@@ -437,7 +437,7 @@ HANDLE CSendLater::processAck(const ACKDATA *ack)
CSendLaterJob *p = m_sendLaterJobList[i];
if (p->hProcess == ack->hProcess && p->hTargetContact == ack->hContact && !(p->fSuccess || p->fFailed)) {
if (!p->fSuccess) {
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT;
dbei.szModule = GetContactProto((p->hContact));
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index f63fa6d90a..dcabc6bc29 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -346,7 +346,7 @@ void SendQueue::logError(const TWindowData *dat, int iSendJobIndex, const wchar_
return;
size_t iMsgLen;
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.eventType = EVENTTYPE_ERRMSG;
if (iSendJobIndex >= 0) {
dbei.pBlob = (BYTE *)m_jobs[iSendJobIndex].szSendBuffer;
@@ -553,7 +553,7 @@ int SendQueue::ackMessage(TWindowData *dat, WPARAM wParam, LPARAM lParam)
return 0;
}
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT;
dbei.szModule = GetContactProto(job.hContact);
@@ -644,8 +644,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b
szNote = TranslateT("The send later feature is not available on this protocol.");
T2Utf utfText(szNote);
- DBEVENTINFO dbei;
- dbei.cbSize = sizeof(dbei);
+ DBEVENTINFO dbei = {};
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.szModule = GetContactProto(dat->hContact);
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp
index 073ac365f5..ea0458703b 100644
--- a/plugins/TabSRMM/src/templates.cpp
+++ b/plugins/TabSRMM/src/templates.cpp
@@ -341,14 +341,13 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
GetDlgItemText(hwndDlg, IDC_EDITTEMPLATE, tSet->szTemplates[teInfo->inEdit], TEMPLATE_LENGTH);
}
- DBEVENTINFO dbei = { 0 };
+ DBEVENTINFO dbei = {};
dbei.szModule = dat->szProto;
dbei.timestamp = time(NULL);
dbei.eventType = (iIndex == 6) ? EVENTTYPE_STATUSCHANGE : EVENTTYPE_MESSAGE;
dbei.eventType = (iIndex == 7) ? EVENTTYPE_ERRMSG : dbei.eventType;
if (dbei.eventType == EVENTTYPE_ERRMSG)
dbei.szModule = (char *)L"Sample error message";
- dbei.cbSize = sizeof(dbei);
dbei.pBlob = (iIndex == 6) ? (BYTE *)"is now offline (was online)" : (BYTE *)"The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.";
dbei.cbBlob = (int)mir_strlen((char *)dbei.pBlob) + 1;
dbei.flags = (iIndex == 1 || iIndex == 3 || iIndex == 5) ? DBEF_SENT : 0;