summaryrefslogtreecommitdiff
path: root/plugins/Scriver
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Scriver')
-rw-r--r--plugins/Scriver/src/chat_manager.cpp3
-rw-r--r--plugins/Scriver/src/globals.cpp2
-rw-r--r--plugins/Scriver/src/input.cpp15
-rw-r--r--plugins/Scriver/src/msgdialog.cpp25
-rw-r--r--plugins/Scriver/src/msglog.cpp44
-rw-r--r--plugins/Scriver/src/msgoptions.cpp2
-rw-r--r--plugins/Scriver/src/msgs.cpp16
-rw-r--r--plugins/Scriver/src/msgs.h2
-rw-r--r--plugins/Scriver/src/msgutils.cpp12
-rw-r--r--plugins/Scriver/src/sendqueue.cpp40
-rw-r--r--plugins/Scriver/src/stdafx.cxx2
-rw-r--r--plugins/Scriver/src/version.h2
12 files changed, 71 insertions, 94 deletions
diff --git a/plugins/Scriver/src/chat_manager.cpp b/plugins/Scriver/src/chat_manager.cpp
index c4f3efa815..d56955d196 100644
--- a/plugins/Scriver/src/chat_manager.cpp
+++ b/plugins/Scriver/src/chat_manager.cpp
@@ -50,8 +50,7 @@ char SM_GetStatusIndicator(SESSION_INFO *si, USERINFO *ui)
if (!ui || !si)
return '\0';
- STATUSINFO *ti = g_chatApi.TM_FindStatus(si->pStatuses, g_chatApi.TM_WordToString(si->pStatuses, ui->Status));
- if (ti) {
+ if (auto *ti = Chat_GetStatus(si, ui)) {
switch (si->iStatusCount - ti->iIconIndex - 1) {
case 0: return '\0';
case 1: return '+';
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp
index 33d1f88998..1055ecf6fb 100644
--- a/plugins/Scriver/src/globals.cpp
+++ b/plugins/Scriver/src/globals.cpp
@@ -129,7 +129,7 @@ static int ackevent(WPARAM, LPARAM lParam)
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_UTF | DBEF_SENT | (item->flags & DBEF_RTL);
dbei.szModule = Proto_GetBaseAccountName(hContact);
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.cbBlob = (int)mir_strlen(item->sendBuffer) + 1;
dbei.pBlob = item->sendBuffer;
dbei.szId = (char *)pAck->lParam;
diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp
index 6c95b288bf..6e39cfb461 100644
--- a/plugins/Scriver/src/input.cpp
+++ b/plugins/Scriver/src/input.cpp
@@ -47,11 +47,12 @@ void InputAreaContextMenu(HWND hwnd, WPARAM, LPARAM lParam, MCONTACT hContact)
if (!SendMessage(hwnd, EM_CANREDO, 0, 0))
EnableMenuItem(hSubMenu, IDM_REDO, MF_BYCOMMAND | MF_GRAYED);
- if (!SendMessage(hwnd, EM_CANPASTE, 0, 0)) {
- EnableMenuItem(hSubMenu, IDM_PASTESEND, MF_BYCOMMAND | MF_GRAYED);
- if (!IsClipboardFormatAvailable(CF_HDROP) && !IsClipboardFormatAvailable(CF_BITMAP))
+ if (!SendMessage(hwnd, EM_CANPASTE, 0, 0))
+ if (!IsClipboardFormatAvailable(CF_HDROP) && !IsClipboardFormatAvailable(CF_BITMAP)) {
EnableMenuItem(hSubMenu, IDM_PASTE, MF_BYCOMMAND | MF_GRAYED);
- }
+ EnableMenuItem(hSubMenu, IDM_PASTESEND, MF_BYCOMMAND | MF_GRAYED);
+ }
+
if (lParam == 0xFFFFFFFF) {
SendMessage(hwnd, EM_POSFROMCHAR, (WPARAM)&pt, (LPARAM)sel.cpMax);
ClientToScreen(hwnd, &pt);
@@ -167,10 +168,8 @@ int CMsgDialog::InputAreaShortcuts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
PostMessage(m_hwnd, WM_COMMAND, IDC_QUOTE, 0);
return FALSE;
case KB_PASTESEND:
- if (SendMessage(hwnd, EM_CANPASTE, 0, 0)) {
- SendMessage(hwnd, EM_PASTESPECIAL, CF_UNICODETEXT, 0);
- PostMessage(m_hwnd, WM_COMMAND, IDOK, 0);
- }
+ SendMessage(hwnd, EM_PASTESPECIAL, CF_UNICODETEXT, 0);
+ PostMessage(m_hwnd, WM_COMMAND, IDOK, 0);
return FALSE;
}
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index 8e2132d2c3..8a21ea8ecd 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -75,7 +75,6 @@ CMsgDialog::CMsgDialog(MCONTACT hContact, bool bIncoming) :
m_btnQuote.OnClick = Callback(this, &CMsgDialog::onClick_Quote);
if (isChat()) {
- m_btnFilter.OnClick = Callback(this, &CMsgDialog::onClick_Filter);
m_btnNickList.OnClick = Callback(this, &CMsgDialog::onClick_ShowList);
m_splitterX.OnChange = Callback(this, &CMsgDialog::onChange_SplitterX);
@@ -187,8 +186,8 @@ bool CMsgDialog::OnInitDialog()
while (MEVENT hdbEvent = pCursor.FetchNext()) {
DBEVENTINFO dbei = {};
db_event_get(hdbEvent, &dbei);
- if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) {
- m_lastMessage = dbei.timestamp;
+ if (dbei.eventType == EVENTTYPE_MESSAGE && !dbei.bSent) {
+ m_lastMessage = dbei.getUnixtime();
break;
}
}
@@ -424,24 +423,6 @@ void CMsgDialog::onClick_ShowList(CCtrlButton *pButton)
Resize();
}
-void CMsgDialog::onClick_Filter(CCtrlButton *pButton)
-{
- if (!pButton->Enabled())
- return;
-
- m_bFilterEnabled = !m_bFilterEnabled;
- UpdateFilterButton();
-
- if (m_bFilterEnabled && !g_chatApi.bRightClickFilter)
- ShowFilterMenu();
- else {
- if (m_hwndFilter)
- SendMessage(m_hwndFilter, WM_CLOSE, 0, 0);
-
- RedrawLog();
- }
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
void CMsgDialog::onChange_SplitterX(CSplitter *pSplitter)
@@ -783,7 +764,7 @@ INT_PTR CMsgDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
m_hDbUnreadEventFirst = 0;
while (hDbEvent != 0) {
DB::EventInfo dbei(hDbEvent, false);
- if (!(dbei.flags & DBEF_SENT) && dbei.isSrmm())
+ if (!dbei.bSent && dbei.isSrmm())
Clist_RemoveEvent(-1, hDbEvent);
hDbEvent = db_event_next(m_hContact, hDbEvent);
}
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp
index 9cfc82d963..16b9533dd5 100644
--- a/plugins/Scriver/src/msglog.cpp
+++ b/plugins/Scriver/src/msglog.cpp
@@ -44,7 +44,7 @@ bool DbEventIsShown(const DB::EventInfo &dbei)
switch (dbei.eventType) {
case EVENTTYPE_JABBER_CHATSTATES:
case EVENTTYPE_JABBER_PRESENCE:
- return 0;
+ return false;
}
return dbei.isSrmm();
@@ -384,7 +384,7 @@ public:
if ((gdat->flags.bGroupMessages) && dbei.flags == LOWORD(m_lastEventType) &&
dbei.eventType == EVENTTYPE_MESSAGE && HIWORD(m_lastEventType) == EVENTTYPE_MESSAGE &&
- (isSameDate(dbei.timestamp, m_lastEventTime)) && ((((int)dbei.timestamp < m_startTime) == (m_lastEventTime < m_startTime)) || !(dbei.flags & DBEF_READ))) {
+ (isSameDate(dbei.getUnixtime(), m_lastEventTime)) && ((((int)dbei.getUnixtime() < m_startTime) == (m_lastEventTime < m_startTime)) || !dbei.bRead)) {
isGroupBreak = FALSE;
}
@@ -393,7 +393,7 @@ public:
// test contact
if (streamData->dbei == 0) {
- if (dbei.flags & DBEF_SENT)
+ if (dbei.bSent)
wszNick = Contact::GetInfo(CNF_DISPLAY, 0, m_pDlg.m_szProto);
else
wszNick = mir_wstrdup(Clist_GetContactDisplayName(m_pDlg.m_hContact));
@@ -401,7 +401,7 @@ public:
if (!m_pDlg.m_bUseRtl && Utils_IsRtl(wszText))
bIsRtl = true;
}
- else wszNick = mir_wstrdup((dbei.flags & DBEF_SENT) ? TranslateT("Me") : TranslateT("My contact"));
+ else wszNick = mir_wstrdup(dbei.bSent ? TranslateT("Me") : TranslateT("My contact"));
if (!streamData->isFirst && !m_isMixed) {
if (isGroupBreak || gdat->flags.bMarkFollowups)
@@ -419,7 +419,7 @@ public:
buf.Append(bIsRtl ? "\\rtlpar" : "\\ltrpar");
if (dbei.eventType == EVENTTYPE_MESSAGE)
- highlight = fontOptionsListSize + 2 + ((dbei.flags & DBEF_SENT) ? 1 : 0);
+ highlight = fontOptionsListSize + 2 + (dbei.bSent ? 1 : 0);
else
highlight = fontOptionsListSize + 1;
@@ -444,7 +444,7 @@ public:
case EVENTTYPE_MESSAGE:
if (dbei.flags & (DBEF_SECURE | DBEF_STRONG))
i = (dbei.flags & DBEF_SECURE) ? LOGICON_MSG_SECURE : LOGICON_MSG_STRONG;
- else if (dbei.flags & DBEF_SENT)
+ else if (dbei.bSent)
i = LOGICON_MSG_OUT;
else
i = LOGICON_MSG_IN;
@@ -466,29 +466,29 @@ public:
if (gdat->flags.bGroupMessages && dbei.eventType == EVENTTYPE_MESSAGE) {
if (isGroupBreak) {
if (!gdat->flags.bMarkFollowups)
- timestampString = TimestampToString(gdat->flags, dbei.timestamp, 0);
+ timestampString = TimestampToString(gdat->flags, dbei.getUnixtime(), 0);
else if (gdat->flags.bShowDate)
- timestampString = TimestampToString(gdat->flags, dbei.timestamp, 1);
+ timestampString = TimestampToString(gdat->flags, dbei.getUnixtime(), 1);
}
else if (gdat->flags.bMarkFollowups)
- timestampString = TimestampToString(gdat->flags, dbei.timestamp, 2);
+ timestampString = TimestampToString(gdat->flags, dbei.getUnixtime(), 2);
}
- else timestampString = TimestampToString(gdat->flags, dbei.timestamp, 0);
+ else timestampString = TimestampToString(gdat->flags, dbei.getUnixtime(), 0);
if (timestampString != nullptr) {
- buf.AppendFormat("%s ", SetToStyle(dbei.flags & DBEF_SENT ? MSGFONTID_MYTIME : MSGFONTID_YOURTIME));
+ buf.AppendFormat("%s ", SetToStyle(dbei.bSent ? MSGFONTID_MYTIME : MSGFONTID_YOURTIME));
AppendUnicodeToBuffer(buf, timestampString);
}
if (dbei.eventType != EVENTTYPE_MESSAGE)
- buf.AppendFormat("%s: ", SetToStyle(dbei.flags & DBEF_SENT ? MSGFONTID_MYCOLON : MSGFONTID_YOURCOLON));
+ buf.AppendFormat("%s: ", SetToStyle(dbei.bSent ? MSGFONTID_MYCOLON : MSGFONTID_YOURCOLON));
showColon = 1;
}
if ((!(gdat->flags.bHideNames) && dbei.eventType == EVENTTYPE_MESSAGE && isGroupBreak) || dbei.eventType == EVENTTYPE_JABBER_CHATSTATES || dbei.eventType == EVENTTYPE_JABBER_PRESENCE) {
if (dbei.eventType == EVENTTYPE_MESSAGE) {
if (showColon)
- buf.AppendFormat(" %s ", SetToStyle(dbei.flags & DBEF_SENT ? MSGFONTID_MYNAME : MSGFONTID_YOURNAME));
+ buf.AppendFormat(" %s ", SetToStyle(dbei.bSent ? MSGFONTID_MYNAME : MSGFONTID_YOURNAME));
else
- buf.AppendFormat("%s ", SetToStyle(dbei.flags & DBEF_SENT ? MSGFONTID_MYNAME : MSGFONTID_YOURNAME));
+ buf.AppendFormat("%s ", SetToStyle(dbei.bSent ? MSGFONTID_MYNAME : MSGFONTID_YOURNAME));
}
else buf.AppendFormat("%s ", SetToStyle(MSGFONTID_NOTICE));
@@ -505,15 +505,15 @@ public:
}
if (gdat->flags.bShowTime && gdat->flags.bGroupMessages && gdat->flags.bMarkFollowups && dbei.eventType == EVENTTYPE_MESSAGE && isGroupBreak) {
- buf.AppendFormat(" %s ", SetToStyle(dbei.flags & DBEF_SENT ? MSGFONTID_MYTIME : MSGFONTID_YOURTIME));
- AppendUnicodeToBuffer(buf, TimestampToString(gdat->flags, dbei.timestamp, 2));
+ buf.AppendFormat(" %s ", SetToStyle(dbei.bSent ? MSGFONTID_MYTIME : MSGFONTID_YOURTIME));
+ AppendUnicodeToBuffer(buf, TimestampToString(gdat->flags, dbei.getUnixtime(), 2));
showColon = 1;
}
if (showColon && dbei.eventType == EVENTTYPE_MESSAGE) {
if (bIsRtl)
- buf.AppendFormat("\\~%s: ", SetToStyle(dbei.flags & DBEF_SENT ? MSGFONTID_MYCOLON : MSGFONTID_YOURCOLON));
+ buf.AppendFormat("\\~%s: ", SetToStyle(dbei.bSent ? MSGFONTID_MYCOLON : MSGFONTID_YOURCOLON));
else
- buf.AppendFormat("%s: ", SetToStyle(dbei.flags & DBEF_SENT ? MSGFONTID_MYCOLON : MSGFONTID_YOURCOLON));
+ buf.AppendFormat("%s: ", SetToStyle(dbei.bSent ? MSGFONTID_MYCOLON : MSGFONTID_YOURCOLON));
}
switch (dbei.eventType) {
case EVENTTYPE_JABBER_CHATSTATES:
@@ -528,7 +528,7 @@ public:
break;
}
- if (dbei.flags & DBEF_SENT)
+ if (dbei.bSent)
AppendUnicodeToBuffer(buf, TranslateT("File sent"));
else
AppendUnicodeToBuffer(buf, TranslateT("File received"));
@@ -544,7 +544,7 @@ public:
if (gdat->flags.bMsgOnNewline && showColon)
buf.Append("\\line");
- style = dbei.flags & DBEF_SENT ? MSGFONTID_MYMSG : MSGFONTID_YOURMSG;
+ style = dbei.bSent ? MSGFONTID_MYMSG : MSGFONTID_YOURMSG;
AppendWithCustomLinks(dbei, style, buf);
break;
}
@@ -552,7 +552,7 @@ public:
if (m_isMixed)
buf.Append("\\par");
- m_lastEventTime = dbei.timestamp;
+ m_lastEventTime = dbei.getUnixtime();
m_lastEventType = MAKELONG(dbei.flags, dbei.eventType);
return true;
}
@@ -810,7 +810,7 @@ void StreamInTestEvents(CDlgBase *pDlg, GlobalMessageData *gdat)
DB::EventInfo dbei;
dbei.flags = DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.szModule = SRMM_MODULE;
auto *pLog = new CLogWindow(*(CMsgDialog*)pDlg);
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp
index 3be675019a..0f510eb963 100644
--- a/plugins/Scriver/src/msgoptions.cpp
+++ b/plugins/Scriver/src/msgoptions.cpp
@@ -777,7 +777,7 @@ public:
void onResetClist(CCtrlClc *)
{
- m_list.SetUseGroups(Clist::UseGroups);
+ m_list.SetUseGroups(Clist::bUseGroups);
m_list.SetHideEmptyGroups(true);
}
};
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index 505e3170db..298fe9c5b7 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -121,10 +121,10 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
if (!dbei)
return 0;
- if (dbei.eventType == EVENTTYPE_MESSAGE && (dbei.flags & DBEF_READ))
+ if (dbei.eventType == EVENTTYPE_MESSAGE && dbei.bRead)
return 0;
- if (dbei.flags & DBEF_SENT || !dbei.isSrmm())
+ if (dbei.bSent || !dbei.isSrmm())
return 0;
Utils_InvokeAsync(new CAutoPpopup(hContact, hDbEvent));
@@ -249,7 +249,7 @@ struct MSavedEvent
static void RestoreUnreadMessageAlerts(void)
{
- OBJLIST<MSavedEvent> arEvents(10, NumericKeySortT);
+ OBJLIST<MSavedEvent> events(10, NumericKeySortT);
for (auto &hContact : Contacts()) {
if (Contact::IsGroupChat(hContact) || !Proto_GetBaseAccountName(hContact))
@@ -259,7 +259,7 @@ static void RestoreUnreadMessageAlerts(void)
DB::EventInfo dbei(hDbEvent, false);
if (!dbei)
continue;
- if (dbei.markedRead() || !dbei.isSrmm() || !Proto_GetBaseAccountName(hContact))
+ if (dbei.bRead || !dbei.isSrmm() || !Proto_GetBaseAccountName(hContact))
continue;
int windowAlreadyExists = Srmm_FindWindow(hContact) != nullptr;
@@ -269,11 +269,11 @@ static void RestoreUnreadMessageAlerts(void)
if (IsAutoPopup(hContact) && !windowAlreadyExists)
(new CMsgDialog(hContact, true))->Show();
else
- arEvents.insert(new MSavedEvent(hContact, hDbEvent));
+ events.insert(new MSavedEvent(hContact, hDbEvent));
}
}
- for (auto &e : arEvents)
+ for (auto &e : events)
Srmm_AddEvent(e->hContact, e->hEvent);
}
@@ -428,14 +428,14 @@ int RegisterToolbarIcons(WPARAM, LPARAM)
bbd.dwDefPos = 30;
bbd.hIcon = g_plugin.getIconHandle(IDI_COLOR);
bbd.pwszText = LPGENW("&Color");
- bbd.pwszTooltip = LPGENW("Select a foreground color for the text");
+ bbd.pwszTooltip = LPGENW("Select text color");
g_plugin.addButton(&bbd);
bbd.dwButtonID = IDC_SRMM_BKGCOLOR;
bbd.dwDefPos = 35;
bbd.hIcon = g_plugin.getIconHandle(IDI_BKGCOLOR);
bbd.pwszText = LPGENW("&Background color");
- bbd.pwszTooltip = LPGENW("Select a background color for the text");
+ bbd.pwszTooltip = LPGENW("Select background color");
g_plugin.addButton(&bbd);
// chat buttons
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h
index 1b6e3572d9..caf2a9bffa 100644
--- a/plugins/Scriver/src/msgs.h
+++ b/plugins/Scriver/src/msgs.h
@@ -111,7 +111,6 @@ public:
void onClick_Ok(CCtrlButton *);
void onClick_Add(CCtrlButton *);
- void onClick_Filter(CCtrlButton *);
void onClick_Details(CCtrlButton *);
void onClick_Quote(CCtrlButton *);
void onClick_UserMenu(CCtrlButton *);
@@ -166,7 +165,6 @@ public:
}
wchar_t *m_wszInitialText;
- MWindow m_hwndFilter;
void Reattach(HWND hwndContainer);
};
diff --git a/plugins/Scriver/src/msgutils.cpp b/plugins/Scriver/src/msgutils.cpp
index 05159ea6ba..89a5b817d2 100644
--- a/plugins/Scriver/src/msgutils.cpp
+++ b/plugins/Scriver/src/msgutils.cpp
@@ -84,7 +84,7 @@ void CMsgDialog::EventAdded(MEVENT hDbEvent, const DB::EventInfo &dbei)
/* store the event when the container is hidden so that clist notifications can be removed */
if (!IsWindowVisible(m_hwndParent) && m_hDbUnreadEventFirst == 0)
m_hDbUnreadEventFirst = hDbEvent;
- m_lastMessage = dbei.timestamp;
+ m_lastMessage = dbei.getUnixtime();
UpdateStatusBar();
if (bIsActive)
Skin_PlaySound("RecvMsgActive");
@@ -101,7 +101,7 @@ void CMsgDialog::EventAdded(MEVENT hDbEvent, const DB::EventInfo &dbei)
else
RemakeLog();
- if (!(dbei.flags & DBEF_SENT) && !dbei.isCustom(DETF_MSGWINDOW)) {
+ if (!dbei.bSent && !dbei.isCustom(DETF_MSGWINDOW)) {
if (!bIsActive) {
m_iShowUnread = 1;
UpdateIcon();
@@ -122,7 +122,7 @@ bool CMsgDialog::GetFirstEvent()
m_hDbEventFirst = db_event_firstUnread(m_hContact);
if (m_hDbEventFirst != 0) {
DB::EventInfo dbei(m_hDbEventFirst, false);
- if (dbei.isSrmm() && !(dbei.flags & DBEF_READ) && !(dbei.flags & DBEF_SENT))
+ if (dbei.isSrmm() && !dbei.bRead && !dbei.bSent)
notifyUnread = true;
}
@@ -147,11 +147,11 @@ bool CMsgDialog::GetFirstEvent()
case LOADHISTORY_TIME:
if (m_hDbEventFirst == 0)
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
else
db_event_get(m_hDbEventFirst, &dbei);
- uint32_t firstTime = dbei.timestamp - 60 * g_plugin.iLoadTime;
+ uint32_t firstTime = dbei.getUnixtime() - 60 * g_plugin.iLoadTime;
for (;;) {
hPrevEvent = pCursor.FetchNext();
if (hPrevEvent == 0)
@@ -159,7 +159,7 @@ bool CMsgDialog::GetFirstEvent()
dbei.cbBlob = 0;
db_event_get(hPrevEvent, &dbei);
- if (dbei.timestamp < firstTime)
+ if (dbei.getUnixtime() < firstTime)
break;
if (DbEventIsShown(dbei))
m_hDbEventFirst = hPrevEvent;
diff --git a/plugins/Scriver/src/sendqueue.cpp b/plugins/Scriver/src/sendqueue.cpp
index a450e2f280..54c663bdb4 100644
--- a/plugins/Scriver/src/sendqueue.cpp
+++ b/plugins/Scriver/src/sendqueue.cpp
@@ -25,23 +25,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
using namespace SendQueue;
-static OBJLIST<Item> arQueue(1, PtrKeySortT);
-static mir_cs queueMutex;
+static OBJLIST<Item> g_arQueue(1, PtrKeySortT);
+static mir_cs g_csQueue;
Item* SendQueue::CreateItem(CMsgDialog *pDlg)
{
Item *item = new Item();
item->pDlg = pDlg;
- mir_cslock lck(queueMutex);
- arQueue.insert(item);
+ mir_cslock lck(g_csQueue);
+ g_arQueue.insert(item);
return item;
}
Item* SendQueue::FindOldestPendingItem(CMsgDialog *pDlg, MCONTACT hContact)
{
- mir_cslock lck(queueMutex);
- for (auto &it : arQueue)
+ mir_cslock lck(g_csQueue);
+ for (auto &it : g_arQueue)
if (it->pDlg == pDlg && it->hContact == hContact && it->hwndErrorDlg == nullptr)
return it;
@@ -50,8 +50,8 @@ Item* SendQueue::FindOldestPendingItem(CMsgDialog *pDlg, MCONTACT hContact)
Item* SendQueue::FindItem(MCONTACT hContact, HANDLE hSendId)
{
- mir_cslock lock(queueMutex);
- for (auto &it : arQueue)
+ mir_cslock lock(g_csQueue);
+ for (auto &it : g_arQueue)
if (it->hContact == hContact && HANDLE(it->hSendId) == hSendId)
return it;
@@ -62,11 +62,11 @@ bool SendQueue::RemoveItem(Item *item)
{
auto *pDlg = item->pDlg;
{
- mir_cslock lock(queueMutex);
- arQueue.remove(item);
+ mir_cslock lock(g_csQueue);
+ g_arQueue.remove(item);
}
- for (auto &it : arQueue)
+ for (auto &it : g_arQueue)
if (it->pDlg == pDlg)
return false;
@@ -77,9 +77,9 @@ void SendQueue::ReportTimeouts(CMsgDialog *pDlg)
{
int timeout = g_plugin.iMsgTimeout * 1000;
- mir_cslock lock(queueMutex);
+ mir_cslock lock(g_csQueue);
- for (auto &it : arQueue.rev_iter()) {
+ for (auto &it : g_arQueue.rev_iter()) {
if (it->timeout >= timeout)
continue;
@@ -91,15 +91,15 @@ void SendQueue::ReportTimeouts(CMsgDialog *pDlg)
pDlg->StopMessageSending();
pDlg->ShowError(TranslateT("The message send timed out."), it);
}
- else arQueue.removeItem(&it);
+ else g_arQueue.removeItem(&it);
}
}
void SendQueue::ReleaseItems(CMsgDialog *pDlg)
{
- mir_cslock lock(queueMutex);
+ mir_cslock lock(g_csQueue);
- for (auto &it : arQueue) {
+ for (auto &it : g_arQueue) {
if (it->pDlg != pDlg)
continue;
@@ -115,9 +115,9 @@ int SendQueue::ReattachItems(CMsgDialog *pDlg, MCONTACT hContact)
{
int count = 0;
- mir_cslock lock(queueMutex);
+ mir_cslock lock(g_csQueue);
- for (auto &it : arQueue) {
+ for (auto &it : g_arQueue) {
if (it->hContact == hContact && it->pDlg == nullptr) {
it->pDlg = pDlg;
it->timeout = 0;
@@ -129,8 +129,8 @@ int SendQueue::ReattachItems(CMsgDialog *pDlg, MCONTACT hContact)
void SendQueue::RemoveAllItems()
{
- mir_cslock lock(queueMutex);
- arQueue.destroy();
+ mir_cslock lock(g_csQueue);
+ g_arQueue.destroy();
}
void SendQueue::SendItem(Item *item)
diff --git a/plugins/Scriver/src/stdafx.cxx b/plugins/Scriver/src/stdafx.cxx
index 13f28e1314..f111565f38 100644
--- a/plugins/Scriver/src/stdafx.cxx
+++ b/plugins/Scriver/src/stdafx.cxx
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2012-24 Miranda NG team (https://miranda-ng.org)
+Copyright (C) 2012-25 Miranda NG team (https://miranda-ng.org)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
diff --git a/plugins/Scriver/src/version.h b/plugins/Scriver/src/version.h
index c3a1fab64e..96926ea2ba 100644
--- a/plugins/Scriver/src/version.h
+++ b/plugins/Scriver/src/version.h
@@ -10,4 +10,4 @@
#define __DESCRIPTION "Scriver - send and receive instant messages."
#define __AUTHOR "Miranda NG team"
#define __AUTHORWEB "https://miranda-ng.org/p/Scriver"
-#define __COPYRIGHT "© 2000-2012 Miranda IM project, 2012-24 Miranda NG team"
+#define __COPYRIGHT "© 2000-2012 Miranda IM project, 2012-25 Miranda NG team"