summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Scriver/src/globals.cpp11
-rw-r--r--plugins/Scriver/src/sendqueue.h26
-rw-r--r--plugins/Scriver/src/utils.cpp6
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp20
4 files changed, 31 insertions, 32 deletions
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp
index d9486bba85..493f55256c 100644
--- a/plugins/Scriver/src/globals.cpp
+++ b/plugins/Scriver/src/globals.cpp
@@ -441,18 +441,17 @@ static int ackevent(WPARAM wParam, LPARAM lParam)
return 0;
}
- DBEVENTINFO dbei = { 0 };
- dbei.cbSize = sizeof(dbei);
+ DBEVENTINFO dbei = { sizeof(dbei) };
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.flags = DBEF_SENT | (( item->flags & PREF_RTL) ? DBEF_RTL : 0 );
- if ( item->flags & PREF_UTF )
+ dbei.flags = DBEF_SENT | ((item->flags & PREF_RTL) ? DBEF_RTL : 0);
+ if (item->flags & PREF_UTF)
dbei.flags |= DBEF_UTF;
dbei.szModule = GetContactProto(item->hContact);
dbei.timestamp = time(NULL);
dbei.cbBlob = lstrlenA(item->sendBuffer) + 1;
- if ( !( item->flags & PREF_UTF ))
+ if ( !( item->flags & PREF_UTF))
dbei.cbBlob *= sizeof(TCHAR) + 1;
- dbei.pBlob = (PBYTE) item->sendBuffer;
+ dbei.pBlob = (PBYTE)item->sendBuffer;
MessageWindowEvent evt = { sizeof(evt), (int)item->hSendId, item->hContact, &dbei };
NotifyEventHooks(hHookWinWrite, 0, (LPARAM)&evt);
diff --git a/plugins/Scriver/src/sendqueue.h b/plugins/Scriver/src/sendqueue.h
index b2d89f5caf..b340a78362 100644
--- a/plugins/Scriver/src/sendqueue.h
+++ b/plugins/Scriver/src/sendqueue.h
@@ -24,21 +24,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef SRMM_SENDQUEUE_H
#define SRMM_SENDQUEUE_H
-typedef struct MessageSendQueueItemStruct
+struct MessageSendQueueItem
{
HWND hwndSender;
- HANDLE hContact;
- char * proto;
- HANDLE hSendId;
- int timeout;
- char * sendBuffer;
- int sendBufferSize;
- int codepage;
- int flags;
- HWND hwndErrorDlg;
- struct MessageSendQueueItemStruct *prev;
- struct MessageSendQueueItemStruct *next;
-}MessageSendQueueItem;
+ HANDLE hContact;
+ char *proto;
+ HANDLE hSendId;
+ int timeout;
+ char *sendBuffer;
+ int sendBufferSize;
+ int codepage;
+ int flags;
+ HWND hwndErrorDlg;
+
+ MessageSendQueueItem *prev, *next;
+};
void InitSendQueue();
void DestroySendQueue();
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp
index d445914a4f..a29c003844 100644
--- a/plugins/Scriver/src/utils.cpp
+++ b/plugins/Scriver/src/utils.cpp
@@ -292,8 +292,8 @@ TCHAR *GetRichTextWord(HWND hwnd, POINTL *ptl)
static DWORD CALLBACK StreamOutCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG * pcb)
{
- MessageSendQueueItem * msi = (MessageSendQueueItem *) dwCookie;
- msi->sendBuffer = (char *)mir_realloc(msi->sendBuffer, msi->sendBufferSize + cb + 2);
+ MessageSendQueueItem *msi = (MessageSendQueueItem *) dwCookie;
+ msi->sendBuffer = (char*)mir_realloc(msi->sendBuffer, msi->sendBufferSize + cb + 2);
memcpy (msi->sendBuffer + msi->sendBufferSize, pbBuff, cb);
msi->sendBufferSize += cb;
*((TCHAR *)(msi->sendBuffer+msi->sendBufferSize)) = '\0';
@@ -316,7 +316,7 @@ TCHAR *GetRichEditSelection(HWND hwnd)
msi.sendBuffer = NULL;
msi.sendBufferSize = 0;
SendMessage(hwnd, EM_STREAMOUT, (WPARAM)dwFlags, (LPARAM)& stream);
- return (TCHAR *)msi.sendBuffer;
+ return (TCHAR*)msi.sendBuffer;
}
return NULL;
}
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index 0c378c9bdf..03732b2b1b 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -808,8 +808,9 @@ inform_and_discard:
LRESULT SendQueue::WarnPendingJobs(unsigned int uNrMessages)
{
- return(MessageBox(0, TranslateT("There are unsent messages waiting for confirmation.\nWhen you close the window now, Miranda will try to send them but may be unable to inform you about possible delivery errors.\nDo you really want to close the Window(s)?"),
- TranslateT("Message window warning"), MB_YESNO | MB_ICONHAND));
+ return MessageBox(0,
+ TranslateT("There are unsent messages waiting for confirmation.\nWhen you close the window now, Miranda will try to send them but may be unable to inform you about possible delivery errors.\nDo you really want to close the Window(s)?"),
+ TranslateT("Message window warning"), MB_YESNO | MB_ICONHAND);
}
/**
@@ -862,19 +863,18 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HANDLE hContact, boo
if (iJobIndex >= 0 && iJobIndex < NR_SENDJOBS) {
SendJob* job = &m_jobs[iJobIndex];
- char szKeyName[20];
- TCHAR tszTimestamp[30], tszHeader[150];
- time_t now = time(0);
+ char szKeyName[20];
+ TCHAR tszHeader[150];
if (fIsSendLater) {
- TCHAR *formatTime = _T("%Y.%m.%d - %H:%M");
- _tcsftime(tszTimestamp, 30, formatTime, _localtime32((__time32_t *)&now));
+ time_t now = time(0);
+ TCHAR tszTimestamp[30];
+ _tcsftime(tszTimestamp, SIZEOF(tszTimestamp), _T("%Y.%m.%d - %H:%M"), _localtime32((__time32_t *)&now));
tszTimestamp[29] = 0;
mir_snprintf(szKeyName, 20, "S%d", now);
mir_sntprintf(tszHeader, SIZEOF(tszHeader), TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp);
}
- else
- mir_sntprintf(tszHeader, SIZEOF(tszHeader), _T("M%d|"), time(0));
+ else mir_sntprintf(tszHeader, SIZEOF(tszHeader), _T("M%d|"), time(0));
if (job->dwFlags & PREF_UTF || !(job->dwFlags & PREF_UNICODE)) {
char *utf_header = mir_utf8encodeT(tszHeader);
@@ -919,5 +919,5 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HANDLE hContact, boo
}
return(iJobIndex);
}
- return(-1);
+ return -1;
}