diff options
Diffstat (limited to 'plugins/Scriver/src/chat')
-rw-r--r-- | plugins/Scriver/src/chat/manager.cpp | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/chat/options.cpp | 12 | ||||
-rw-r--r-- | plugins/Scriver/src/chat/tools.cpp | 10 | ||||
-rw-r--r-- | plugins/Scriver/src/chat/window.cpp | 56 |
4 files changed, 40 insertions, 40 deletions
diff --git a/plugins/Scriver/src/chat/manager.cpp b/plugins/Scriver/src/chat/manager.cpp index e71eecc249..1d4e61c90a 100644 --- a/plugins/Scriver/src/chat/manager.cpp +++ b/plugins/Scriver/src/chat/manager.cpp @@ -48,7 +48,7 @@ SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* cu while (pTemp != NULL) {
if (pTemp != currSession && !mir_strcmpi(pszModule, pTemp->pszModule)) {
if (my_strstri(pTemp->ptszName, pszOriginal) == pTemp->ptszName) {
- if (prevSession != pTemp && mir_tstrcmpi(pTemp->ptszName, pszCurrent) > 0 && (!pszName || mir_tstrcmpi(pTemp->ptszName, pszName) < 0)) {
+ if (prevSession != pTemp && mir_wstrcmpi(pTemp->ptszName, pszCurrent) > 0 && (!pszName || mir_wstrcmpi(pTemp->ptszName, pszName) < 0)) {
pResult = pTemp;
pszName = pTemp->ptszName;
}
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp index 6f83994009..985077fde9 100644 --- a/plugins/Scriver/src/chat/options.cpp +++ b/plugins/Scriver/src/chat/options.cpp @@ -226,10 +226,10 @@ static void InitSetting(wchar_t **ppPointer, char *pszSetting, wchar_t *pszDefau {
DBVARIANT dbv;
if ( !db_get_ts(NULL, CHAT_MODULE, pszSetting, &dbv )) {
- replaceStrT(*ppPointer, dbv.ptszVal);
+ replaceStrW(*ppPointer, dbv.ptszVal);
db_free(&dbv);
}
- else replaceStrT(*ppPointer, pszDefault);
+ else replaceStrW(*ppPointer, pszDefault);
}
#define OPT_FIXHEADINGS (WM_USER+1)
@@ -365,7 +365,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa wchar_t tszTooltipText[2048];
RECT rect;
- mir_sntprintf(tszTooltipText,
+ mir_snwprintf(tszTooltipText,
L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n"
L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n"
L"%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s",
@@ -464,9 +464,9 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa LPITEMIDLIST idList = SHBrowseForFolder(&bi);
if (idList) {
SHGetPathFromIDList(idList, tszDirectory);
- mir_tstrcat(tszDirectory, L"\\");
+ mir_wstrcat(tszDirectory, L"\\");
PathToRelativeT(tszDirectory, tszTemp);
- SetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, mir_tstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
+ SetDlgItemText(hwndDlg, IDC_CHAT_LOGDIRECTORY, mir_wstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
}
psMalloc->Free(idList);
psMalloc->Release();
@@ -543,7 +543,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa free(pszText1);
}
else {
- mir_tstrncpy(g_Settings.pszLogDir, DEFLOGFILENAME, MAX_PATH);
+ mir_wstrncpy(g_Settings.pszLogDir, DEFLOGFILENAME, MAX_PATH);
db_unset(NULL, CHAT_MODULE, "LogDirectory");
}
pci->SM_InvalidateLogDirectories();
diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp index eebd6fdd00..3b9c78291c 100644 --- a/plugins/Scriver/src/chat/tools.cpp +++ b/plugins/Scriver/src/chat/tools.cpp @@ -53,7 +53,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s if (pszWordText && pszWordText[0]) {
wchar_t szMenuText[4096];
- mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
+ mir_snwprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
SetSearchEngineIcons(*hMenu, g_dat.hSearchEngineIconList);
}
@@ -63,12 +63,12 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s else if (iIndex == 0) {
wchar_t szTemp[50];
if (pszWordText)
- mir_sntprintf(szTemp, TranslateT("&Message %s"), pszWordText);
+ mir_snwprintf(szTemp, TranslateT("&Message %s"), pszWordText);
else
- mir_tstrncpy(szTemp, TranslateT("&Message"), _countof(szTemp) - 1);
+ mir_wstrncpy(szTemp, TranslateT("&Message"), _countof(szTemp) - 1);
- if (mir_tstrlen(szTemp) > 40)
- mir_tstrncpy(szTemp + 40, L"...", 4);
+ if (mir_wstrlen(szTemp) > 40)
+ mir_wstrncpy(szTemp + 40, L"...", 4);
ModifyMenu(*hMenu, ID_MESS, MF_STRING | MF_BYCOMMAND, ID_MESS, szTemp);
gcmi.Type = MENU_ON_NICKLIST;
}
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index 9e5d799407..0be7880de0 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -217,7 +217,7 @@ static void TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si) start -= 2;
if (dat->szSearchResult != NULL) {
- int cbResult = (int)mir_tstrlen(dat->szSearchResult);
+ int cbResult = (int)mir_wstrlen(dat->szSearchResult);
if (start >= cbResult && !wcsnicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) {
start -= cbResult;
goto LBL_SkipEnd;
@@ -243,8 +243,8 @@ LBL_SkipEnd: if (dat->szSearchQuery == NULL) {
dat->szSearchQuery = (wchar_t*)mir_alloc(sizeof(wchar_t)*(end - start + 1));
- mir_tstrncpy(dat->szSearchQuery, pszText + start, end - start + 1);
- dat->szSearchResult = mir_tstrdup(dat->szSearchQuery);
+ mir_wstrncpy(dat->szSearchQuery, pszText + start, end - start + 1);
+ dat->szSearchResult = mir_wstrdup(dat->szSearchQuery);
dat->lastSession = NULL;
}
@@ -258,23 +258,23 @@ LBL_SkipEnd: else pszName = pci->UM_FindUserAutoComplete(si->pUsers, dat->szSearchQuery, dat->szSearchResult);
mir_free(pszText);
- replaceStrT(dat->szSearchResult, NULL);
+ replaceStrW(dat->szSearchResult, NULL);
if (pszName == NULL) {
if (end != start) {
SendMessage(hwnd, EM_SETSEL, start, end);
SendMessage(hwnd, EM_REPLACESEL, FALSE, (LPARAM)dat->szSearchQuery);
}
- replaceStrT(dat->szSearchQuery, NULL);
+ replaceStrW(dat->szSearchQuery, NULL);
}
else {
- dat->szSearchResult = mir_tstrdup(pszName);
+ dat->szSearchResult = mir_wstrdup(pszName);
if (end != start) {
- ptrT szReplace;
+ ptrW szReplace;
if (!isRoom && !isTopic && g_Settings.bAddColonToAutoComplete && start == 0) {
- szReplace = (wchar_t*)mir_alloc((mir_tstrlen(pszName) + 4) * sizeof(wchar_t));
- mir_tstrcpy(szReplace, pszName);
- mir_tstrcat(szReplace, L": ");
+ szReplace = (wchar_t*)mir_alloc((mir_wstrlen(pszName) + 4) * sizeof(wchar_t));
+ mir_wstrcpy(szReplace, pszName);
+ mir_wstrcat(szReplace, L": ");
pszName = szReplace;
}
SendMessage(hwnd, EM_SETSEL, start, end);
@@ -684,7 +684,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR ptl.y = (LONG)pt.y;
ScreenToClient(hwnd, (LPPOINT)&ptl);
{
- ptrT pszWord(GetRichTextWord(hwnd, &ptl));
+ ptrW pszWord(GetRichTextWord(hwnd, &ptl));
inMenu = TRUE;
CHARRANGE all = { 0, -1 };
@@ -795,7 +795,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO * p }
if (tszBuf[0] == 0)
- mir_sntprintf(tszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s",
+ mir_snwprintf(tszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s",
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status));
@@ -956,18 +956,18 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, break;
}
else if (wParam == '\b' && si->szSearch[0]) // backspace
- si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0';
+ si->szSearch[mir_wstrlen(si->szSearch) - 1] = '\0';
else if (wParam < ' ')
break;
else {
wchar_t szNew[2];
szNew[0] = (wchar_t)wParam;
szNew[1] = '\0';
- if (mir_tstrlen(si->szSearch) >= _countof(si->szSearch) - 2) {
+ if (mir_wstrlen(si->szSearch) >= _countof(si->szSearch) - 2) {
MessageBeep(MB_OK);
break;
}
- mir_tstrcat(si->szSearch, szNew);
+ mir_wstrcat(si->szSearch, szNew);
}
if (si->szSearch[0]) {
// iterate over the (sorted) list of nicknames and search for the
@@ -976,7 +976,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, for (int i = 0; i < iItems; i++) {
USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, i);
if (ui) {
- if (!wcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) {
+ if (!wcsnicmp(ui->pszNick, si->szSearch, mir_wstrlen(si->szSearch))) {
SendMessage(hwnd, LB_SETCURSEL, i, 0);
InvalidateRect(hwnd, NULL, FALSE);
return 0;
@@ -985,7 +985,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, }
MessageBeep(MB_OK);
- si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0';
+ si->szSearch[mir_wstrlen(si->szSearch) - 1] = '\0';
return 0;
}
break;
@@ -1177,17 +1177,17 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR switch (si->iType) {
case GCW_CHATROOM:
- mir_sntprintf(szTemp,
+ mir_snwprintf(szTemp,
(si->nUsersInNicklist == 1) ? TranslateT("%s: chat room (%u user)") : TranslateT("%s: chat room (%u users)"),
si->ptszName, si->nUsersInNicklist);
break;
case GCW_PRIVMESS:
- mir_sntprintf(szTemp,
+ mir_snwprintf(szTemp,
(si->nUsersInNicklist == 1) ? TranslateT("%s: message session") : TranslateT("%s: message session (%u users)"),
si->ptszName, si->nUsersInNicklist);
break;
case GCW_SERVER:
- mir_sntprintf(szTemp, L"%s: Server", si->ptszName);
+ mir_snwprintf(szTemp, L"%s: Server", si->ptszName);
break;
}
tbd.iFlags = TBDF_TEXT | TBDF_ICON;
@@ -1200,7 +1200,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR {
MODULEINFO *mi = pci->MM_FindModule(si->pszModule);
hIcon = si->wStatus == ID_STATUS_ONLINE ? mi->hOnlineIcon : mi->hOfflineIcon;
- mir_sntprintf(szTemp, L"%s : %s", mi->ptszModDispName, si->ptszStatusbarText ? si->ptszStatusbarText : L"");
+ mir_snwprintf(szTemp, L"%s : %s", mi->ptszModDispName, si->ptszStatusbarText ? si->ptszStatusbarText : L"");
StatusBarData sbd;
sbd.iItem = 0;
@@ -1411,7 +1411,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR }
SetTextColor(dis->hDC, ui->iStatusEx == 0 ? g_Settings.crUserListColor : g_Settings.crUserListHeadingsColor);
- TextOut(dis->hDC, dis->rcItem.left + x_offset, dis->rcItem.top, ui->pszNick, (int)mir_tstrlen(ui->pszNick));
+ TextOut(dis->hDC, dis->rcItem.left + x_offset, dis->rcItem.top, ui->pszNick, (int)mir_wstrlen(ui->pszNick));
SelectObject(dis->hDC, hOldFont);
}
return TRUE;
@@ -1428,7 +1428,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR char szIndicator = SM_GetStatusIndicator(si, ui);
if (szIndicator > '\0') {
static wchar_t ptszBuf[128];
- mir_sntprintf(ptszBuf, L"%c%s", szIndicator, ui->pszNick);
+ mir_snwprintf(ptszBuf, L"%c%s", szIndicator, ui->pszNick);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ptszBuf);
}
else SendDlgItemMessage(hwndDlg, IDC_CHAT_LIST, LB_ADDSTRING, 0, (LPARAM)ui->pszNick);
@@ -1637,7 +1637,7 @@ LABEL_SHOWWINDOW: USERINFO *ui = pci->SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item);
if (ui != NULL) {
static wchar_t ptszBuf[1024];
- mir_sntprintf(ptszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s",
+ mir_snwprintf(ptszBuf, L"%s: %s\r\n%s: %s\r\n%s: %s",
TranslateT("Nickname"), ui->pszNick,
TranslateT("Unique ID"), ui->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui->Status));
@@ -1667,12 +1667,12 @@ LABEL_SHOWWINDOW: if (GetKeyState(VK_SHIFT) & 0x8000) {
LRESULT lResult = (LRESULT)SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_GETSEL, 0, 0);
int start = LOWORD(lResult);
- size_t dwNameLenMax = (mir_tstrlen(ui->pszUID) + 4);
+ size_t dwNameLenMax = (mir_wstrlen(ui->pszUID) + 4);
wchar_t* pszName = (wchar_t*)alloca(sizeof(wchar_t) * dwNameLenMax);
if (start == 0)
- mir_sntprintf(pszName, dwNameLenMax, L"%s: ", ui->pszUID);
+ mir_snwprintf(pszName, dwNameLenMax, L"%s: ", ui->pszUID);
else
- mir_sntprintf(pszName, dwNameLenMax, L"%s ", ui->pszUID);
+ mir_snwprintf(pszName, dwNameLenMax, L"%s ", ui->pszUID);
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)pszName);
PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0);
@@ -1706,7 +1706,7 @@ LABEL_SHOWWINDOW: // takes pszRtf to a queue, no leak here
si->cmdList = tcmdlist_append(si->cmdList, pszRtf, 20, FALSE);
- CMString ptszText(ptrT(mir_utf8decodeT(pszRtf)));
+ CMString ptszText(ptrW(mir_utf8decodeW(pszRtf)));
pci->DoRtfToTags(ptszText, mi->nColorCount, mi->crColors);
ptszText.Trim();
ptszText.Replace(L"%", L"%%");
|