summaryrefslogtreecommitdiff
path: root/plugins/YAMN/src/browser/mailbrowser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/YAMN/src/browser/mailbrowser.cpp')
-rw-r--r--plugins/YAMN/src/browser/mailbrowser.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp
index 5aeb0eda6c..1e4ba0ea3d 100644
--- a/plugins/YAMN/src/browser/mailbrowser.cpp
+++ b/plugins/YAMN/src/browser/mailbrowser.cpp
@@ -583,7 +583,7 @@ int AddNewMailsToListView(HWND hListView, HACCOUNT ActualAccount, struct CMailNu
SendMessageW(hListView, LVM_SETITEMTEXTW, (WPARAM)item.iItem, (LPARAM)&item);
item.iSubItem = 2;
- mir_sntprintf(SizeStr, SIZEOF(SizeStr), L"%d kB", msgq->MailData->Size / 1024);
+ mir_sntprintf(SizeStr, _countof(SizeStr), L"%d kB", msgq->MailData->Size / 1024);
item.pszText = SizeStr;
SendMessageW(hListView, LVM_SETITEMTEXTW, (WPARAM)item.iItem, (LPARAM)&item);
@@ -601,8 +601,8 @@ int AddNewMailsToListView(HWND hListView, HACCOUNT ActualAccount, struct CMailNu
}
if ((nflags & YAMN_ACC_POP) && (ActualAccount->Flags & YAMN_ACC_POPN) && (msgq->Flags & YAMN_MSG_POPUP) && (msgq->Flags & YAMN_MSG_NEW)) {
- mir_tstrncpy(NewMailPopup.lptzContactName, FromStr, SIZEOF(NewMailPopup.lptzContactName));
- mir_tstrncpy(NewMailPopup.lptzText, UnicodeHeader.Subject, SIZEOF(NewMailPopup.lptzText));
+ mir_tstrncpy(NewMailPopup.lptzContactName, FromStr, _countof(NewMailPopup.lptzContactName));
+ mir_tstrncpy(NewMailPopup.lptzText, UnicodeHeader.Subject, _countof(NewMailPopup.lptzText));
PYAMN_MAILSHOWPARAM MailParam = (PYAMN_MAILSHOWPARAM)malloc(sizeof(YAMN_MAILSHOWPARAM));
if (MailParam) {
@@ -654,7 +654,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D
if ((nflags & YAMN_ACC_CONT) && (MN->Real.PopupRun + MN->Virtual.PopupRun))
{
char sMsg[250];
- mir_snprintf(sMsg, SIZEOF(sMsg), Translate("%s : %d new mail message(s), %d total"), ActualAccount->Name, MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC);
+ mir_snprintf(sMsg, _countof(sMsg), Translate("%s : %d new mail message(s), %d total"), ActualAccount->Name, MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC);
if (!(nflags & YAMN_ACC_CONTNOEVENT)) {
CLISTEVENT cEvent;
cEvent.cbSize = sizeof(CLISTEVENT);
@@ -690,8 +690,8 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D
NewMailPopup.PluginWindowProc = NewMailPopupProc;
NewMailPopup.PluginData = (void *)0; //multiple popups
- mir_tstrncpy(NewMailPopup.lptzContactName, _A2T(ActualAccount->Name), SIZEOF(NewMailPopup.lptzContactName));
- mir_sntprintf(NewMailPopup.lptzText, SIZEOF(NewMailPopup.lptzText), TranslateT("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC);
+ mir_tstrncpy(NewMailPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(NewMailPopup.lptzContactName));
+ mir_sntprintf(NewMailPopup.lptzText, _countof(NewMailPopup.lptzText), TranslateT("%d new mail message(s), %d total"), MN->Real.PopupNC + MN->Virtual.PopupNC, MN->Real.PopupTC + MN->Virtual.PopupTC);
PUAddPopupT(&NewMailPopup);
}
@@ -793,11 +793,11 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D
NoNewMailPopup.PluginWindowProc = NoNewMailPopupProc;
NoNewMailPopup.PluginData = (void *)0; //it's not new mail popup
- mir_tstrncpy(NoNewMailPopup.lptzContactName, _A2T(ActualAccount->Name), SIZEOF(NoNewMailPopup.lptzContactName));
+ mir_tstrncpy(NoNewMailPopup.lptzContactName, _A2T(ActualAccount->Name), _countof(NoNewMailPopup.lptzContactName));
if (MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC)
- mir_sntprintf(NoNewMailPopup.lptzText, SIZEOF(NoNewMailPopup.lptzText), TranslateT("No new mail message, %d spam(s)"), MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC);
+ mir_sntprintf(NoNewMailPopup.lptzText, _countof(NoNewMailPopup.lptzText), TranslateT("No new mail message, %d spam(s)"), MN->Real.PopupSL2NC + MN->Virtual.PopupSL2NC);
else
- mir_tstrncpy(NoNewMailPopup.lptzText, TranslateT("No new mail message"), SIZEOF(NoNewMailPopup.lptzText));
+ mir_tstrncpy(NoNewMailPopup.lptzText, TranslateT("No new mail message"), _countof(NoNewMailPopup.lptzText));
PUAddPopupT(&NoNewMailPopup);
}
@@ -1616,8 +1616,8 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR
TCHAR headname[64] = { 0 }, headvalue[256] = { 0 };
for (courRow = 0; courRow < numRows; courRow++) {
if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue;
- ListView_GetItemText(hList, courRow, 0, headname, SIZEOF(headname));
- ListView_GetItemText(hList, courRow, 1, headvalue, SIZEOF(headvalue));
+ ListView_GetItemText(hList, courRow, 0, headname, _countof(headname));
+ ListView_GetItemText(hList, courRow, 1, headvalue, _countof(headvalue));
size_t headnamelen = mir_tstrlen(headname);
if (headnamelen) sizeNeeded += 1 + headnamelen;
sizeNeeded += 3 + mir_tstrlen(headvalue);
@@ -1629,8 +1629,8 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR
int courPos = 0;
for (courRow = 0; courRow < numRows; courRow++) {
if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue;
- ListView_GetItemText(hList, courRow, 0, headname, SIZEOF(headname));
- ListView_GetItemText(hList, courRow, 1, headvalue, SIZEOF(headvalue));
+ ListView_GetItemText(hList, courRow, 0, headname, _countof(headname));
+ ListView_GetItemText(hList, courRow, 1, headvalue, _countof(headvalue));
if (mir_tstrlen(headname)) courPos += mir_sntprintf(&buff[courPos], sizeNeeded + 1, _T("%s:\t%s\r\n"), headname, headvalue);
else courPos += mir_sntprintf(&buff[courPos], sizeNeeded + 1, _T("\t%s\r\n"), headvalue);
}
@@ -2162,7 +2162,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
{
TCHAR DeleteMsg[1024];
- mir_sntprintf(DeleteMsg, SIZEOF(DeleteMsg), TranslateT("Do you really want to delete %d selected mails?"), Total);
+ mir_sntprintf(DeleteMsg, _countof(DeleteMsg), TranslateT("Do you really want to delete %d selected mails?"), Total);
if (IDOK == MessageBox(hDlg, DeleteMsg, TranslateT("Delete confirmation"), MB_OKCANCEL | MB_ICONWARNING))
{
struct DeleteParam ParamToDeleteMails = { YAMN_DELETEVERSION, ThreadRunningEV, ActualAccount, NULL };
@@ -2401,10 +2401,10 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
TCHAR from[128] = { 0 }, subject[256] = { 0 }, size[16] = { 0 }, date[64] = { 0 };
for (courRow = 0; courRow < numRows; courRow++) {
if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue;
- ListView_GetItemText(hList, courRow, 0, from, SIZEOF(from));
- ListView_GetItemText(hList, courRow, 1, subject, SIZEOF(subject));
- ListView_GetItemText(hList, courRow, 2, size, SIZEOF(size));
- ListView_GetItemText(hList, courRow, 3, date, SIZEOF(date));
+ ListView_GetItemText(hList, courRow, 0, from, _countof(from));
+ ListView_GetItemText(hList, courRow, 1, subject, _countof(subject));
+ ListView_GetItemText(hList, courRow, 2, size, _countof(size));
+ ListView_GetItemText(hList, courRow, 3, date, _countof(date));
sizeNeeded += 5 + mir_tstrlen(from) + mir_tstrlen(subject) + mir_tstrlen(size) + mir_tstrlen(date);
}
if (sizeNeeded && OpenClipboard(hDlg)) {
@@ -2414,10 +2414,10 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
int courPos = 0;
for (courRow = 0; courRow < numRows; courRow++) {
if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue;
- ListView_GetItemText(hList, courRow, 0, from, SIZEOF(from));
- ListView_GetItemText(hList, courRow, 1, subject, SIZEOF(subject));
- ListView_GetItemText(hList, courRow, 2, size, SIZEOF(size));
- ListView_GetItemText(hList, courRow, 3, date, SIZEOF(date));
+ ListView_GetItemText(hList, courRow, 0, from, _countof(from));
+ ListView_GetItemText(hList, courRow, 1, subject, _countof(subject));
+ ListView_GetItemText(hList, courRow, 2, size, _countof(size));
+ ListView_GetItemText(hList, courRow, 3, date, _countof(date));
courPos += mir_sntprintf(&buff[courPos], sizeNeeded + 1, _T("%s\t%s\t%s\t%s\r\n"), from, subject, size, date);
}
GlobalUnlock(hData);