summaryrefslogtreecommitdiff
path: root/protocols/IRCG/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/IRCG/src')
-rw-r--r--protocols/IRCG/src/clist.cpp4
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp348
-rw-r--r--protocols/IRCG/src/input.cpp232
-rw-r--r--protocols/IRCG/src/irclib.cpp38
-rw-r--r--protocols/IRCG/src/ircproto.cpp48
-rw-r--r--protocols/IRCG/src/options.cpp46
-rw-r--r--protocols/IRCG/src/output.cpp46
-rw-r--r--protocols/IRCG/src/scripting.cpp8
-rw-r--r--protocols/IRCG/src/services.cpp176
-rw-r--r--protocols/IRCG/src/stdafx.h10
-rw-r--r--protocols/IRCG/src/tools.cpp60
-rw-r--r--protocols/IRCG/src/userinfo.cpp4
-rw-r--r--protocols/IRCG/src/windows.cpp180
13 files changed, 600 insertions, 600 deletions
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp
index 22be4d9471..6a15e93456 100644
--- a/protocols/IRCG/src/clist.cpp
+++ b/protocols/IRCG/src/clist.cpp
@@ -59,7 +59,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask,
AddDCCSession(hContact, dcc);
dcc->Connect();
if (getByte("MirVerAutoRequest", 1))
- PostIrcMessage(_T("/PRIVMSG %s \001VERSION\001"), name.c_str());
+ PostIrcMessage(L"/PRIVMSG %s \001VERSION\001", name.c_str());
}
else {
CLISTEVENT cle = {};
@@ -110,7 +110,7 @@ MCONTACT CIrcProto::CList_AddContact(CONTACT *user, bool InList, bool SetOnline)
setTString(hContact, "Default", user->name);
setWord(hContact, "Status", SetOnline ? ID_STATUS_ONLINE : ID_STATUS_OFFLINE);
if (!InList && getByte("MirVerAutoRequestTemp", 0))
- PostIrcMessage(_T("/PRIVMSG %s \001VERSION\001"), user->name);
+ PostIrcMessage(L"/PRIVMSG %s \001VERSION\001", user->name);
return hContact;
}
return false;
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index fb7e734547..f72796fde8 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -52,10 +52,10 @@ VOID CALLBACK TimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
return;
if (ppro->m_forceVisible)
- ppro->PostIrcMessage(_T("/MODE %s -i"), ppro->m_info.sNick.c_str());
+ ppro->PostIrcMessage(L"/MODE %s -i", ppro->m_info.sNick.c_str());
if (mir_strlen(ppro->m_myHost) == 0 && ppro->IsConnected())
- ppro->DoUserhostWithReason(2, (_T("S") + ppro->m_info.sNick).c_str(), true, _T("%s"), ppro->m_info.sNick.c_str());
+ ppro->DoUserhostWithReason(2, (L"S" + ppro->m_info.sNick).c_str(), true, L"%s", ppro->m_info.sNick.c_str());
}
VOID CALLBACK KeepAliveTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
@@ -71,9 +71,9 @@ VOID CALLBACK KeepAliveTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
TCHAR temp2[270];
if (!ppro->m_info.sServerName.IsEmpty())
- mir_sntprintf(temp2, _T("PING %s"), ppro->m_info.sServerName.c_str());
+ mir_sntprintf(temp2, L"PING %s", ppro->m_info.sServerName.c_str());
else
- mir_sntprintf(temp2, _T("PING %u"), time(0));
+ mir_sntprintf(temp2, L"PING %u", time(0));
if (ppro->IsConnected())
ppro->SendIrcMessage(temp2, false);
@@ -89,13 +89,13 @@ VOID CALLBACK OnlineNotifTimerProc3(HWND, UINT, UINT_PTR idEvent, DWORD)
ppro->m_iStatus == ID_STATUS_OFFLINE || ppro->m_iStatus == ID_STATUS_CONNECTING ||
(!ppro->m_autoOnlineNotification && !ppro->bTempForceCheck) || ppro->bTempDisableCheck) {
ppro->KillChatTimer(ppro->OnlineNotifTimer3);
- ppro->m_channelsToWho = _T("");
+ ppro->m_channelsToWho = L"";
return;
}
CMString name = GetWord(ppro->m_channelsToWho.c_str(), 0);
if (name.IsEmpty()) {
- ppro->m_channelsToWho = _T("");
+ ppro->m_channelsToWho = L"";
int count = (int)CallServiceSync(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)ppro->m_szModuleName);
for (int i = 0; i < count; i++) {
GC_INFO gci = { 0 };
@@ -104,7 +104,7 @@ VOID CALLBACK OnlineNotifTimerProc3(HWND, UINT, UINT_PTR idEvent, DWORD)
gci.pszModule = ppro->m_szModuleName;
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci) && gci.iType == GCW_CHATROOM)
if (gci.iCount <= ppro->m_onlineNotificationLimit)
- ppro->m_channelsToWho += CMString(gci.pszName) + _T(" ");
+ ppro->m_channelsToWho += CMString(gci.pszName) + L" ";
}
}
@@ -114,7 +114,7 @@ VOID CALLBACK OnlineNotifTimerProc3(HWND, UINT, UINT_PTR idEvent, DWORD)
}
name = GetWord(ppro->m_channelsToWho.c_str(), 0);
- ppro->DoUserhostWithReason(2, _T("S") + name, true, _T("%s"), name.c_str());
+ ppro->DoUserhostWithReason(2, L"S" + name, true, L"%s", name.c_str());
CMString temp = GetWordAddress(ppro->m_channelsToWho.c_str(), 1);
ppro->m_channelsToWho = temp;
if (ppro->m_iTempCheckTime)
@@ -132,7 +132,7 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
if (ppro->m_iStatus == ID_STATUS_OFFLINE || ppro->m_iStatus == ID_STATUS_CONNECTING ||
(!ppro->m_autoOnlineNotification && !ppro->bTempForceCheck) || ppro->bTempDisableCheck) {
ppro->KillChatTimer(ppro->OnlineNotifTimer);
- ppro->m_namesToWho = _T("");
+ ppro->m_namesToWho = L"";
return;
}
@@ -156,7 +156,7 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
if (!bAdvanced) {
db_free(&dbv);
if (!ppro->getTString(hContact, "Nick", &dbv)) {
- ppro->m_namesToUserhost += CMString(dbv.ptszVal) + _T(" ");
+ ppro->m_namesToUserhost += CMString(dbv.ptszVal) + L" ";
db_free(&dbv);
}
}
@@ -172,9 +172,9 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
DBWildcard = dbv2.ptszVal;
if (DBNick && (!DBWildcard || !WCCmp(CharLower(DBWildcard), CharLower(DBNick))))
- ppro->m_namesToWho += CMString(DBNick) + _T(" ");
+ ppro->m_namesToWho += CMString(DBNick) + L" ";
else if (DBWildcard)
- ppro->m_namesToWho += CMString(DBWildcard) + _T(" ");
+ ppro->m_namesToWho += CMString(DBWildcard) + L" ";
if (DBNick) db_free(&dbv);
if (DBWildcard) db_free(&dbv2);
@@ -191,7 +191,7 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
name2 = GetWord(ppro->m_namesToUserhost.c_str(), 0);
CMString temp;
if (!name.IsEmpty()) {
- ppro->DoUserhostWithReason(2, _T("S") + name, true, _T("%s"), name.c_str());
+ ppro->DoUserhostWithReason(2, L"S" + name, true, L"%s", name.c_str());
temp = GetWordAddress(ppro->m_namesToWho.c_str(), 1);
ppro->m_namesToWho = temp;
}
@@ -199,12 +199,12 @@ VOID CALLBACK OnlineNotifTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD)
if (!name2.IsEmpty()) {
CMString params;
for (int i = 0; i < 3; i++) {
- params = _T("");
+ params = L"";
for (int j = 0; j < 5; j++)
- params += GetWord(ppro->m_namesToUserhost, i * 5 + j) + _T(" ");
+ params += GetWord(ppro->m_namesToUserhost, i * 5 + j) + L" ";
if (params[0] != ' ')
- ppro->DoUserhostWithReason(1, CMString(_T("S")) + params, true, params);
+ ppro->DoUserhostWithReason(1, CMString(L"S") + params, true, params);
}
temp = GetWordAddress(ppro->m_namesToUserhost.c_str(), 15);
ppro->m_namesToUserhost = temp;
@@ -261,7 +261,7 @@ void __cdecl CIrcProto::ResolveIPThread(LPVOID di)
bool CIrcProto::OnIrc_PING(const CIrcMessage* pmsg)
{
TCHAR szResponse[100];
- mir_sntprintf(szResponse, _T("PONG %s"), pmsg->parameters[0].c_str());
+ mir_sntprintf(szResponse, L"PONG %s", pmsg->parameters[0].c_str());
SendIrcMessage(szResponse);
return false;
}
@@ -357,8 +357,8 @@ bool CIrcProto::OnIrc_SETAWAY(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_JOIN(const CIrcMessage* pmsg)
{
if (pmsg->parameters.getCount() > 0 && pmsg->m_bIncoming && pmsg->prefix.sNick != m_info.sNick) {
- CMString host = pmsg->prefix.sUser + _T("@") + pmsg->prefix.sHost;
- DoEvent(GC_EVENT_JOIN, pmsg->parameters[0].c_str(), pmsg->prefix.sNick.c_str(), NULL, _T("Normal"), host.c_str(), NULL, true, false);
+ CMString host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
+ DoEvent(GC_EVENT_JOIN, pmsg->parameters[0].c_str(), pmsg->prefix.sNick.c_str(), NULL, L"Normal", host.c_str(), NULL, true, false);
DoEvent(GC_EVENT_SETCONTACTSTATUS, pmsg->parameters[0].c_str(), pmsg->prefix.sNick.c_str(), NULL, NULL, NULL, ID_STATUS_ONLINE, FALSE, FALSE);
}
else ShowMessage(pmsg);
@@ -369,7 +369,7 @@ bool CIrcProto::OnIrc_JOIN(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_QUIT(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming) {
- CMString host = pmsg->prefix.sUser + _T("@") + pmsg->prefix.sHost;
+ CMString host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
DoEvent(GC_EVENT_QUIT, NULL, pmsg->prefix.sNick.c_str(), pmsg->parameters.getCount() > 0 ? pmsg->parameters[0].c_str() : NULL, NULL, host.c_str(), NULL, true, false);
struct CONTACT user = { (LPTSTR)pmsg->prefix.sNick.c_str(), (LPTSTR)pmsg->prefix.sUser.c_str(), (LPTSTR)pmsg->prefix.sHost.c_str(), false, false, false };
CList_SetOffline(&user);
@@ -387,7 +387,7 @@ bool CIrcProto::OnIrc_QUIT(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_PART(const CIrcMessage* pmsg)
{
if (pmsg->parameters.getCount() > 0 && pmsg->m_bIncoming) {
- CMString host = pmsg->prefix.sUser + _T("@") + pmsg->prefix.sHost;
+ CMString host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
DoEvent(GC_EVENT_PART, pmsg->parameters[0].c_str(), pmsg->prefix.sNick.c_str(), pmsg->parameters.getCount() > 1 ? pmsg->parameters[1].c_str() : NULL, NULL, host.c_str(), NULL, true, false);
if (pmsg->prefix.sNick == m_info.sNick) {
CMString S = MakeWndID(pmsg->parameters[0].c_str());
@@ -417,9 +417,9 @@ bool CIrcProto::OnIrc_KICK(const CIrcMessage* pmsg)
if (m_rejoinIfKicked) {
CHANNELINFO *wi = (CHANNELINFO *)DoEvent(GC_EVENT_GETITEMDATA, pmsg->parameters[0].c_str(), NULL, NULL, NULL, NULL, NULL, FALSE, FALSE, 0);
if (wi && wi->pszPassword)
- PostIrcMessage(_T("/JOIN %s %s"), pmsg->parameters[0].c_str(), wi->pszPassword);
+ PostIrcMessage(L"/JOIN %s %s", pmsg->parameters[0].c_str(), wi->pszPassword);
else
- PostIrcMessage(_T("/JOIN %s"), pmsg->parameters[0].c_str());
+ PostIrcMessage(L"/JOIN %s", pmsg->parameters[0].c_str());
}
}
@@ -429,8 +429,8 @@ bool CIrcProto::OnIrc_KICK(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_MODEQUERY(const CIrcMessage* pmsg)
{
if (pmsg->parameters.getCount() > 2 && pmsg->m_bIncoming && IsChannel(pmsg->parameters[1])) {
- CMString sPassword = _T("");
- CMString sLimit = _T("");
+ CMString sPassword = L"";
+ CMString sLimit = L"";
bool bAdd = false;
int iParametercount = 3;
@@ -464,8 +464,8 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
{
bool flag = false;
bool bContainsValidModes = false;
- CMString sModes = _T("");
- CMString sParams = _T("");
+ CMString sModes = L"";
+ CMString sParams = L"";
if (pmsg->parameters.getCount() > 1 && pmsg->m_bIncoming) {
if (IsChannel(pmsg->parameters[0])) {
@@ -476,22 +476,22 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
while (*p1 != '\0') {
if (*p1 == '+') {
bAdd = true;
- sModes += _T("+");
+ sModes += L"+";
}
if (*p1 == '-') {
bAdd = false;
- sModes += _T("-");
+ sModes += L"-";
}
if (*p1 == 'l' && bAdd && iParametercount < (int)pmsg->parameters.getCount()) {
bContainsValidModes = true;
- sModes += _T("l");
- sParams += _T(" ") + pmsg->parameters[iParametercount];
+ sModes += L"l";
+ sParams += L" " + pmsg->parameters[iParametercount];
iParametercount++;
}
if (*p1 == 'b' || *p1 == 'k' && iParametercount < (int)pmsg->parameters.getCount()) {
bContainsValidModes = true;
sModes += *p1;
- sParams += _T(" ") + pmsg->parameters[iParametercount];
+ sParams += L" " + pmsg->parameters[iParametercount];
iParametercount++;
}
if (strchr(sUserModes.c_str(), (char)*p1)) {
@@ -537,13 +537,13 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
CMString sMessage = temp;
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++)
- sMessage += _T(" ") + pmsg->parameters[i];
+ sMessage += L" " + pmsg->parameters[i];
DoEvent(GC_EVENT_INFORMATION, pmsg->parameters[0].c_str(), pmsg->prefix.sNick.c_str(), sMessage.c_str(), NULL, NULL, NULL, true, false);
}
else if (bContainsValidModes) {
for (int i = iParametercount; i < (int)pmsg->parameters.getCount(); i++)
- sParams += _T(" ") + pmsg->parameters[i];
+ sParams += L" " + pmsg->parameters[i];
TCHAR temp[4000];
mir_sntprintf(temp, TranslateT("%s sets mode %s%s"), pmsg->prefix.sNick.c_str(), sModes.c_str(), sParams.c_str());
@@ -551,7 +551,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
}
if (flag)
- PostIrcMessage(_T("/MODE %s"), pmsg->parameters[0].c_str());
+ PostIrcMessage(L"/MODE %s", pmsg->parameters[0].c_str());
}
else {
TCHAR temp[256];
@@ -559,7 +559,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
CMString sMessage = temp;
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++)
- sMessage += _T(" ") + pmsg->parameters[i];
+ sMessage += L" " + pmsg->parameters[i];
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, pmsg->prefix.sNick.c_str(), sMessage.c_str(), NULL, NULL, NULL, true, false);
}
@@ -579,7 +579,7 @@ bool CIrcProto::OnIrc_NICK(const CIrcMessage* pmsg)
setTString("Nick", m_info.sNick.c_str());
}
- CMString host = pmsg->prefix.sUser + _T("@") + pmsg->prefix.sHost;
+ CMString host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
DoEvent(GC_EVENT_NICK, NULL, pmsg->prefix.sNick.c_str(), pmsg->parameters[0].c_str(), NULL, host.c_str(), NULL, true, bIsMe);
DoEvent(GC_EVENT_CHUID, NULL, pmsg->prefix.sNick.c_str(), pmsg->parameters[0].c_str(), NULL, NULL, NULL, true, false);
@@ -629,9 +629,9 @@ bool CIrcProto::OnIrc_NOTICE(const CIrcMessage* pmsg)
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci) && gci.iType == GCW_CHATROOM)
S2 = GetWord(gci.pszID, 0);
else
- S2 = _T("");
+ S2 = L"";
}
- else S2 = _T("");
+ else S2 = L"";
}
DoEvent(GC_EVENT_NOTICE, S2.IsEmpty() ? 0 : S2.c_str(), S.c_str(), pmsg->parameters[1].c_str(), NULL, S3.c_str(), NULL, true, false);
}
@@ -644,7 +644,7 @@ bool CIrcProto::OnIrc_NOTICE(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_YOURHOST(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming) {
- static const TCHAR* lpszFmt = _T("Your host is %99[^ \x5b,], running version %99s");
+ static const TCHAR* lpszFmt = L"Your host is %99[^ \x5b,], running version %99s";
TCHAR szHostName[100], szVersion[100];
if (_stscanf(pmsg->parameters[1].c_str(), lpszFmt, &szHostName, &szVersion) > 0)
m_info.sServerName = szHostName;
@@ -662,7 +662,7 @@ bool CIrcProto::OnIrc_INVITE(const CIrcMessage* pmsg)
return true;
if (pmsg->m_bIncoming && m_joinOnInvite && pmsg->parameters.getCount() > 1 && mir_tstrcmpi(pmsg->parameters[0].c_str(), m_info.sNick.c_str()) == 0)
- PostIrcMessage(_T("/JOIN %s"), pmsg->parameters[1].c_str());
+ PostIrcMessage(L"/JOIN %s", pmsg->parameters[1].c_str());
ShowMessage(pmsg);
return true;
@@ -670,9 +670,9 @@ bool CIrcProto::OnIrc_INVITE(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_PINGPONG(const CIrcMessage* pmsg)
{
- if (pmsg->m_bIncoming && pmsg->sCommand == _T("PING")) {
+ if (pmsg->m_bIncoming && pmsg->sCommand == L"PING") {
TCHAR szResponse[100];
- mir_sntprintf(szResponse, _T("PONG %s"), pmsg->parameters[0].c_str());
+ mir_sntprintf(szResponse, L"PONG %s", pmsg->parameters[0].c_str());
SendIrcMessage(szResponse);
}
@@ -718,7 +718,7 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage* pmsg)
if (bIsChannel) {
if (!(pmsg->m_bIncoming && m_ignore && IsIgnored(pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, 'm'))) {
if (!pmsg->m_bIncoming)
- mess.Replace(_T("%%"), _T("%"));
+ mess.Replace(L"%%", L"%");
DoEvent(GC_EVENT_MESSAGE, pmsg->parameters[0].c_str(), pmsg->m_bIncoming ? pmsg->prefix.sNick.c_str() : m_info.sNick.c_str(), mess.c_str(), NULL, NULL, NULL, true, pmsg->m_bIncoming ? false : true);
}
return true;
@@ -741,7 +741,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
mess.Delete(mess.GetLength() - 1, 1);
// exploit???
- if (mess.Find(1) != -1 || mess.Find(_T("%newl")) != -1) {
+ if (mess.Find(1) != -1 || mess.Find(L"%newl") != -1) {
TCHAR temp[4096];
mir_sntprintf(temp, TranslateT("CTCP ERROR: Malformed CTCP command received from %s!%s@%s. Possible attempt to take control of your IRC client registered"), pmsg->prefix.sNick.c_str(), pmsg->prefix.sUser.c_str(), pmsg->prefix.sHost.c_str());
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
@@ -756,15 +756,15 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
// should it be ignored?
if (m_ignore) {
if (IsChannel(pmsg->parameters[0])) {
- if (command == _T("action") && IsIgnored(pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, 'm'))
+ if (command == L"action" && IsIgnored(pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, 'm'))
return true;
}
else {
- if (command == _T("action")) {
+ if (command == L"action") {
if (IsIgnored(pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, 'q'))
return true;
}
- else if (command == _T("dcc")) {
+ else if (command == L"dcc") {
if (IsIgnored(pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, 'd'))
return true;
}
@@ -773,32 +773,32 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
}
}
- if (pmsg->sCommand == _T("PRIVMSG")) {
+ if (pmsg->sCommand == L"PRIVMSG") {
// incoming ACTION
- if (command == _T("action")) {
+ if (command == L"action") {
mess.Delete(0, 6);
if (IsChannel(pmsg->parameters[0])) {
if (mess.GetLength() > 1) {
mess.Delete(0, 1);
if (!pmsg->m_bIncoming)
- mess.Replace(_T("%%"), _T("%"));
+ mess.Replace(L"%%", L"%");
DoEvent(GC_EVENT_ACTION, pmsg->parameters[0].c_str(), pmsg->m_bIncoming ? pmsg->prefix.sNick.c_str() : m_info.sNick.c_str(), mess.c_str(), NULL, NULL, NULL, true, pmsg->m_bIncoming ? false : true);
}
}
else if (pmsg->m_bIncoming) {
mess.Insert(0, pmsg->prefix.sNick.c_str());
- mess.Insert(0, _T("* "));
- mess.Insert(mess.GetLength(), _T(" *"));
+ mess.Insert(0, L"* ");
+ mess.Insert(mess.GetLength(), L" *");
CIrcMessage msg = *pmsg;
msg.parameters[1] = mess;
OnIrc_PRIVMSG(&msg);
}
}
// incoming FINGER
- else if (pmsg->m_bIncoming && command == _T("finger")) {
- PostIrcMessage(_T("/NOTICE %s \001FINGER %s (%s)\001"), pmsg->prefix.sNick.c_str(), m_name, m_userID);
+ else if (pmsg->m_bIncoming && command == L"finger") {
+ PostIrcMessage(L"/NOTICE %s \001FINGER %s (%s)\001", pmsg->prefix.sNick.c_str(), m_name, m_userID);
TCHAR temp[300];
mir_sntprintf(temp, TranslateT("CTCP FINGER requested by %s"), pmsg->prefix.sNick.c_str());
@@ -806,8 +806,8 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
}
// incoming VERSION
- else if (pmsg->m_bIncoming && command == _T("version")) {
- PostIrcMessage(_T("/NOTICE %s \001VERSION Miranda NG %%mirver (IRC v.%%version)") _T(", ") _T(__COPYRIGHT) _T("\001"), pmsg->prefix.sNick.c_str());
+ else if (pmsg->m_bIncoming && command == L"version") {
+ PostIrcMessage(L"/NOTICE %s \001VERSION Miranda NG %%mirver (IRC v.%%version)" L", " _T(__COPYRIGHT) L"\001", pmsg->prefix.sNick.c_str());
TCHAR temp[300];
mir_sntprintf(temp, TranslateT("CTCP VERSION requested by %s"), pmsg->prefix.sNick.c_str());
@@ -815,8 +815,8 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
}
// incoming SOURCE
- else if (pmsg->m_bIncoming && command == _T("source")) {
- PostIrcMessage(_T("/NOTICE %s \001SOURCE Get Miranda IRC here: http://miranda-ng.org/ \001"), pmsg->prefix.sNick.c_str());
+ else if (pmsg->m_bIncoming && command == L"source") {
+ PostIrcMessage(L"/NOTICE %s \001SOURCE Get Miranda IRC here: http://miranda-ng.org/ \001", pmsg->prefix.sNick.c_str());
TCHAR temp[300];
mir_sntprintf(temp, TranslateT("CTCP SOURCE requested by %s"), pmsg->prefix.sNick.c_str());
@@ -824,8 +824,8 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
}
// incoming USERINFO
- else if (pmsg->m_bIncoming && command == _T("userinfo")) {
- PostIrcMessage(_T("/NOTICE %s \001USERINFO %s\001"), pmsg->prefix.sNick.c_str(), m_userInfo);
+ else if (pmsg->m_bIncoming && command == L"userinfo") {
+ PostIrcMessage(L"/NOTICE %s \001USERINFO %s\001", pmsg->prefix.sNick.c_str(), m_userInfo);
TCHAR temp[300];
mir_sntprintf(temp, TranslateT("CTCP USERINFO requested by %s"), pmsg->prefix.sNick.c_str());
@@ -833,8 +833,8 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
}
// incoming PING
- else if (pmsg->m_bIncoming && command == _T("ping")) {
- PostIrcMessage(_T("/NOTICE %s \001%s\001"), pmsg->prefix.sNick.c_str(), mess.c_str());
+ else if (pmsg->m_bIncoming && command == L"ping") {
+ PostIrcMessage(L"/NOTICE %s \001%s\001", pmsg->prefix.sNick.c_str(), mess.c_str());
TCHAR temp[300];
mir_sntprintf(temp, TranslateT("CTCP PING requested by %s"), pmsg->prefix.sNick.c_str());
@@ -842,31 +842,31 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
}
// incoming TIME
- else if (pmsg->m_bIncoming && command == _T("time")) {
+ else if (pmsg->m_bIncoming && command == L"time") {
TCHAR temp[300];
time_t tim = time(NULL);
mir_tstrncpy(temp, _tctime(&tim), 25);
- PostIrcMessage(_T("/NOTICE %s \001TIME %s\001"), pmsg->prefix.sNick.c_str(), temp);
+ PostIrcMessage(L"/NOTICE %s \001TIME %s\001", pmsg->prefix.sNick.c_str(), temp);
mir_sntprintf(temp, TranslateT("CTCP TIME requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
// incoming DCC request... lots of stuff happening here...
- else if (pmsg->m_bIncoming && command == _T("dcc")) {
+ else if (pmsg->m_bIncoming && command == L"dcc") {
CMString type = GetWord(mess.c_str(), 1);
type.MakeLower();
// components of a dcc message
- CMString sFile = _T("");
+ CMString sFile = L"";
DWORD dwAdr = 0;
int iPort = 0;
unsigned __int64 dwSize = 0;
- CMString sToken = _T("");
- bool bIsChat = (type == _T("chat"));
+ CMString sToken = L"";
+ bool bIsChat = (type == L"chat");
// 1. separate the dcc command into the correct pieces
- if (bIsChat || type == _T("send")) {
+ if (bIsChat || type == L"send") {
// if the filename is surrounded by quotes, do this
if (GetWord(mess.c_str(), 2)[0] == '\"') {
int end = 0;
@@ -896,7 +896,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
while (!bFlag && !GetWord(mess.c_str(), index).IsEmpty()) {
CMString sTemp;
- if (type == _T("chat"))
+ if (type == L"chat")
sTemp = GetWord(mess.c_str(), index - 1) + GetWord(mess.c_str(), index);
else
sTemp = GetWord(mess.c_str(), index - 2) + GetWord(mess.c_str(), index - 1) + GetWord(mess.c_str(), index);
@@ -918,7 +918,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
TCHAR* p1 = _tcsdup(GetWordAddress(mess.c_str(), 2));
TCHAR* p2 = (TCHAR*)GetWordAddress(p1, index - 5);
- if (type == _T("send")) {
+ if (type == L"send") {
if (p2 > p1) {
p2--;
while (p2 != p1 && *p2 == ' ') {
@@ -928,7 +928,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
sFile = p1;
}
}
- else sFile = _T("chat");
+ else sFile = L"chat";
free(p1);
@@ -939,7 +939,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
}
}
}
- else if (type == _T("accept") || type == _T("resume")) {
+ else if (type == L"accept" || type == L"resume") {
// if the filename is surrounded by quotes, do this
if (GetWord(mess.c_str(), 2)[0] == '\"') {
int end = 0;
@@ -1005,7 +1005,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
// end separating dcc commands
// 2. Check for malformed dcc commands or other errors
- if (bIsChat || type == _T("send")) {
+ if (bIsChat || type == L"send") {
TCHAR szTemp[256];
szTemp[0] = '\0';
@@ -1018,10 +1018,10 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
if (bIsChat && !m_DCCChatEnabled)
mir_sntprintf(szTemp, TranslateT("DCC: Chat request from %s denied"), pmsg->prefix.sNick.c_str());
- else if (type == _T("send") && !m_DCCFileEnabled)
+ else if (type == L"send" && !m_DCCFileEnabled)
mir_sntprintf(szTemp, TranslateT("DCC: File transfer request from %s denied"), pmsg->prefix.sNick.c_str());
- else if (type == _T("send") && !iPort && ulAdr == 0)
+ else if (type == L"send" && !iPort && ulAdr == 0)
mir_sntprintf(szTemp, TranslateT("DCC: Reverse file transfer request from %s denied [No local IP]"), pmsg->prefix.sNick.c_str());
if (sFile.IsEmpty() || dwAdr == 0 || dwSize == 0 || iPort == 0 && sToken.IsEmpty())
@@ -1039,11 +1039,11 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
sFileCorrected = sFile.Mid(i + 1);
sFile = sFileCorrected;
}
- else if (type == _T("accept") || type == _T("resume")) {
+ else if (type == L"accept" || type == L"resume") {
TCHAR szTemp[256];
szTemp[0] = '\0';
- if (type == _T("resume") && !m_DCCFileEnabled)
+ if (type == L"resume" && !m_DCCFileEnabled)
mir_sntprintf(szTemp, TranslateT("DCC: File transfer resume request from %s denied"), pmsg->prefix.sNick.c_str());
if (sToken.IsEmpty() && iPort == 0 || sFile.IsEmpty())
@@ -1074,7 +1074,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
m_DCCChatIgnore == 2 && hContact &&
db_get_b(hContact, "CList", "NotOnList", 0) == 0 &&
db_get_b(hContact, "CList", "Hidden", 0) == 0) {
- CMString host = pmsg->prefix.sUser + _T("@") + pmsg->prefix.sHost;
+ CMString host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
CList_AddDCCChat(pmsg->prefix.sNick, host, dwAdr, iPort); // add a CHAT event to the clist
}
else {
@@ -1085,7 +1085,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
}
// remote requested that the file should be resumed
- if (type == _T("resume")) {
+ if (type == L"resume") {
CDccSession* dcc;
if (sToken.IsEmpty())
dcc = FindDCCSendByPort(iPort);
@@ -1095,12 +1095,12 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
if (dcc) {
InterlockedExchange(&dcc->dwWhatNeedsDoing, (long)FILERESUME_RESUME);
dcc->dwResumePos = dwSize; // dwSize is the resume position
- PostIrcMessage(_T("/PRIVMSG %s \001DCC ACCEPT %s\001"), pmsg->prefix.sNick.c_str(), GetWordAddress(mess.c_str(), 2));
+ PostIrcMessage(L"/PRIVMSG %s \001DCC ACCEPT %s\001", pmsg->prefix.sNick.c_str(), GetWordAddress(mess.c_str(), 2));
}
}
// remote accepted your request for a file resume
- if (type == _T("accept")) {
+ if (type == L"accept") {
CDccSession* dcc;
if (sToken.IsEmpty())
dcc = FindDCCRecvByPortAndName(iPort, pmsg->prefix.sNick.c_str());
@@ -1114,7 +1114,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
}
}
- if (type == _T("send")) {
+ if (type == L"send") {
CMString sTokenBackup = sToken;
bool bTurbo = false; // TDCC indicator
@@ -1182,12 +1182,12 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
}
// handle incoming ctcp in notices. This technique is used for replying to CTCP queries
- else if (pmsg->sCommand == _T("NOTICE")) {
+ else if (pmsg->sCommand == L"NOTICE") {
TCHAR szTemp[300];
szTemp[0] = '\0';
//if we got incoming CTCP Version for contact in CList - then write its as MirVer for that contact!
- if (pmsg->m_bIncoming && command == _T("version")) {
+ if (pmsg->m_bIncoming && command == L"version") {
struct CONTACT user = { (TCHAR*)pmsg->prefix.sNick.c_str(), (TCHAR*)pmsg->prefix.sUser.c_str(), (TCHAR*)pmsg->prefix.sHost.c_str(), false, false, false };
MCONTACT hContact = CList_FindContact(&user);
if (hContact)
@@ -1198,12 +1198,12 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
if (m_whoisDlg && IsWindowVisible(m_whoisDlg->GetHwnd())) {
m_whoisDlg->m_InfoNick.GetText(szTemp, _countof(szTemp));
if (mir_tstrcmpi(szTemp, pmsg->prefix.sNick.c_str()) == 0) {
- if (pmsg->m_bIncoming && (command == _T("version") || command == _T("userinfo") || command == _T("time"))) {
+ if (pmsg->m_bIncoming && (command == L"version" || command == L"userinfo" || command == L"time")) {
SetActiveWindow(m_whoisDlg->GetHwnd());
m_whoisDlg->m_Reply.SetText(DoColorCodes(GetWordAddress(mess.c_str(), 1), TRUE, FALSE));
return true;
}
- if (pmsg->m_bIncoming && command == _T("ping")) {
+ if (pmsg->m_bIncoming && command == L"ping") {
SetActiveWindow(m_whoisDlg->GetHwnd());
int s = (int)time(0) - (int)_ttol(GetWordAddress(mess.c_str(), 1));
TCHAR szTmp[30];
@@ -1219,7 +1219,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
}
//... else show the reply in the current window
- if (pmsg->m_bIncoming && command == _T("ping")) {
+ if (pmsg->m_bIncoming && command == L"ping") {
int s = (int)time(0) - (int)_ttol(GetWordAddress(mess.c_str(), 1));
mir_sntprintf(szTemp, TranslateT("CTCP PING reply from %s: %u sec(s)"), pmsg->prefix.sNick.c_str(), s);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
@@ -1236,7 +1236,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_NAMES(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 3)
- sNamesList += pmsg->parameters[3] + _T(" ");
+ sNamesList += pmsg->parameters[3] + L" ";
ShowMessage(pmsg);
return true;
}
@@ -1244,7 +1244,7 @@ bool CIrcProto::OnIrc_NAMES(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1) {
- CMString name = _T("a");
+ CMString name = L"a";
int i = 0;
BOOL bFlag = false;
@@ -1283,20 +1283,20 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
GCDEST gcd = { m_szModuleName, sID.c_str(), GC_EVENT_ADDGROUP };
GCEVENT gce = { sizeof(gce), &gcd };
- PostIrcMessage(_T("/MODE %s"), sChanName);
+ PostIrcMessage(L"/MODE %s", sChanName);
// register the statuses
- gce.ptszStatus = _T("Owner");
+ gce.ptszStatus = L"Owner";
CallChatEvent(0, (LPARAM)&gce);
- gce.ptszStatus = _T("Admin");
+ gce.ptszStatus = L"Admin";
CallChatEvent(0, (LPARAM)&gce);
- gce.ptszStatus = _T("Op");
+ gce.ptszStatus = L"Op";
CallChatEvent(0, (LPARAM)&gce);
- gce.ptszStatus = _T("Halfop");
+ gce.ptszStatus = L"Halfop";
CallChatEvent(0, (LPARAM)&gce);
- gce.ptszStatus = _T("Voice");
+ gce.ptszStatus = L"Voice";
CallChatEvent(0, (LPARAM)&gce);
- gce.ptszStatus = _T("Normal");
+ gce.ptszStatus = L"Normal";
CallChatEvent(0, (LPARAM)&gce);
{
int k = 0;
@@ -1309,7 +1309,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
sStat = PrefixToStatus(sTemp[0]);
// fix for networks like freshirc where they allow more than one prefix
- while (PrefixToStatus(sTemp[0]) != _T("Normal"))
+ while (PrefixToStatus(sTemp[0]) != L"Normal")
sTemp.Delete(0, 1);
gcd.iType = GC_EVENT_JOIN;
@@ -1336,11 +1336,11 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
CallChatEvent(0, (LPARAM)&gce);
DoEvent(GC_EVENT_SETCONTACTSTATUS, sChanName, sTemp.c_str(), NULL, NULL, NULL, ID_STATUS_ONLINE, FALSE, FALSE);
// fix for networks like freshirc where they allow more than one prefix
- if (PrefixToStatus(sTemp2[0]) != _T("Normal")) {
+ if (PrefixToStatus(sTemp2[0]) != L"Normal") {
sTemp2.Delete(0, 1);
sStat = PrefixToStatus(sTemp2[0]);
- while (sStat != _T("Normal")) {
- DoEvent(GC_EVENT_ADDSTATUS, sID.c_str(), sTemp.c_str(), _T("system"), sStat.c_str(), NULL, NULL, false, false, 0);
+ while (sStat != L"Normal") {
+ DoEvent(GC_EVENT_ADDSTATUS, sID.c_str(), sTemp.c_str(), L"system", sStat.c_str(), NULL, NULL, false, false, 0);
sTemp2.Delete(0, 1);
sStat = PrefixToStatus(sTemp2[0]);
}
@@ -1367,9 +1367,9 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
if (!sTopic.IsEmpty() && !mir_tstrcmpi(GetWord(sTopic.c_str(), 0).c_str(), sChanName)) {
DoEvent(GC_EVENT_TOPIC, sChanName, sTopicName.IsEmpty() ? NULL : sTopicName.c_str(), GetWordAddress(sTopic.c_str(), 1), NULL, sTopicTime.IsEmpty() ? NULL : sTopicTime.c_str(), NULL, true, false);
AddWindowItemData(sChanName, 0, 0, 0, GetWordAddress(sTopic.c_str(), 1));
- sTopic = _T("");
- sTopicName = _T("");
- sTopicTime = _T("");
+ sTopic = L"";
+ sTopicName = L"";
+ sTopicTime = L"";
} }
gcd.ptszID = (TCHAR*)sID.c_str();
@@ -1387,8 +1387,8 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
gce.pDest = &gcd;
if (!getTString("JTemp", &dbv)) {
- CMString command = _T("a");
- CMString save = _T("");
+ CMString command = L"a";
+ CMString save = L"";
int k = 0;
while (!command.IsEmpty()) {
@@ -1399,7 +1399,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
if (!mir_tstrcmpi(sChanName, S))
break;
- save += command + _T(" ");
+ save += command + L" ";
}
}
@@ -1434,7 +1434,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
}
}
- sNamesList = _T("");
+ sNamesList = L"";
ShowMessage(pmsg);
return true;
}
@@ -1443,9 +1443,9 @@ bool CIrcProto::OnIrc_INITIALTOPIC(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 2) {
AddWindowItemData(pmsg->parameters[1].c_str(), 0, 0, 0, pmsg->parameters[2].c_str());
- sTopic = pmsg->parameters[1] + _T(" ") + pmsg->parameters[2];
- sTopicName = _T("");
- sTopicTime = _T("");
+ sTopic = pmsg->parameters[1] + L" " + pmsg->parameters[2];
+ sTopicName = L"";
+ sTopicTime = L"";
}
ShowMessage(pmsg);
return true;
@@ -1458,7 +1458,7 @@ bool CIrcProto::OnIrc_INITIALTOPICNAME(const CIrcMessage* pmsg)
time_t ttTopicTime;
sTopicName = pmsg->parameters[2];
ttTopicTime = _tcstol(pmsg->parameters[3].c_str(), &tStopStr, 10);
- _tcsftime(tTimeBuf, 128, _T("%#c"), localtime(&ttTopicTime));
+ _tcsftime(tTimeBuf, 128, L"%#c", localtime(&ttTopicTime));
sTopicTime = tTimeBuf;
}
ShowMessage(pmsg);
@@ -1515,11 +1515,11 @@ bool CIrcProto::OnIrc_LIST(const CIrcMessage* pmsg)
ListView_SetItem(hListView, &lvItem);
TCHAR* temp = mir_tstrdup(pmsg->parameters[pmsg->parameters.getCount() - 1]);
- TCHAR* find = _tcsstr(temp, _T("[+"));
- TCHAR* find2 = _tcsstr(temp, _T("]"));
+ TCHAR* find = _tcsstr(temp, L"[+");
+ TCHAR* find2 = _tcsstr(temp, L"]");
TCHAR* save = temp;
if (find == temp && find2 != NULL && find + 8 >= find2) {
- temp = _tcsstr(temp, _T("]"));
+ temp = _tcsstr(temp, L"]");
if (mir_tstrlen(temp) > 1) {
temp++;
temp[0] = '\0';
@@ -1570,7 +1570,7 @@ bool CIrcProto::OnIrc_LISTEND(const CIrcMessage* pmsg)
if (m_noOfChannels > 0)
percent = (int)(m_channelNumber * 100) / m_noOfChannels;
if (percent < 70) {
- mir_tstrcat(text, _T(" "));
+ mir_tstrcat(text, L" ");
mir_tstrcat(text, TranslateT("(probably truncated by server)"));
}
SetDlgItemText(m_listDlg->GetHwnd(), IDC_TEXT, text);
@@ -1583,20 +1583,20 @@ bool CIrcProto::OnIrc_BANLIST(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 2) {
if (m_managerDlg->GetHwnd() && (
- m_managerDlg->m_radio1.GetState() && pmsg->sCommand == _T("367") ||
- m_managerDlg->m_radio2.GetState() && pmsg->sCommand == _T("346") ||
- m_managerDlg->m_radio3.GetState() && pmsg->sCommand == _T("348")) &&
+ m_managerDlg->m_radio1.GetState() && pmsg->sCommand == L"367" ||
+ m_managerDlg->m_radio2.GetState() && pmsg->sCommand == L"346" ||
+ m_managerDlg->m_radio3.GetState() && pmsg->sCommand == L"348") &&
!m_managerDlg->m_radio1.Enabled() && !m_managerDlg->m_radio2.Enabled() && !m_managerDlg->m_radio3.Enabled()) {
CMString S = pmsg->parameters[2];
if (pmsg->parameters.getCount() > 3) {
- S += _T(" - ");
+ S += L" - ";
S += pmsg->parameters[3];
if (pmsg->parameters.getCount() > 4) {
- S += _T(" - ( ");
+ S += L" - ( ";
time_t time = _ttoi(pmsg->parameters[4].c_str());
S += _tctime(&time);
- S.Replace(_T("\n"), _T(" "));
- S += _T(")");
+ S.Replace(L"\n", L" ");
+ S += L")";
}
}
@@ -1612,9 +1612,9 @@ bool CIrcProto::OnIrc_BANLISTEND(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1) {
if (m_managerDlg->GetHwnd() &&
- (m_managerDlg->m_radio1.GetState() && pmsg->sCommand == _T("368")
- || m_managerDlg->m_radio2.GetState() && pmsg->sCommand == _T("347")
- || m_managerDlg->m_radio3.GetState() && pmsg->sCommand == _T("349")) &&
+ (m_managerDlg->m_radio1.GetState() && pmsg->sCommand == L"368"
+ || m_managerDlg->m_radio2.GetState() && pmsg->sCommand == L"347"
+ || m_managerDlg->m_radio3.GetState() && pmsg->sCommand == L"349") &&
!m_managerDlg->m_radio1.Enabled() && !m_managerDlg->m_radio2.Enabled() && !m_managerDlg->m_radio3.Enabled()) {
if (strchr(sChannelModes.c_str(), 'b'))
m_managerDlg->m_radio1.Enable();
@@ -1678,7 +1678,7 @@ bool CIrcProto::OnIrc_WHOIS_OTHER(const CIrcMessage* pmsg)
if (pmsg->m_bIncoming && m_whoisDlg && pmsg->parameters.getCount() > 2 && m_manualWhoisCount > 0) {
TCHAR temp[1024], temp2[1024];
m_whoisDlg->m_InfoOther.GetText(temp, 1000);
- mir_tstrcat(temp, _T("%s\r\n"));
+ mir_tstrcat(temp, L"%s\r\n");
mir_sntprintf(temp2, temp, pmsg->parameters[2].c_str());
m_whoisDlg->m_InfoOther.SetText(temp2);
}
@@ -1728,7 +1728,7 @@ bool CIrcProto::OnIrc_WHOIS_IDLE(const CIrcMessage* pmsg)
TCHAR temp3[256];
TCHAR tTimeBuf[128], *tStopStr;
time_t ttTime = _tcstol(pmsg->parameters[3].c_str(), &tStopStr, 10);
- _tcsftime(tTimeBuf, 128, _T("%c"), localtime(&ttTime));
+ _tcsftime(tTimeBuf, 128, L"%c", localtime(&ttTime));
mir_sntprintf(temp3, TranslateT("online since %s, idle %s"), tTimeBuf, temp);
m_whoisDlg->m_AwayTime.SetText(temp3);
}
@@ -1747,9 +1747,9 @@ bool CIrcProto::OnIrc_WHOIS_SERVER(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_WHOIS_AUTH(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && m_whoisDlg && pmsg->parameters.getCount() > 2 && m_manualWhoisCount > 0) {
- if (pmsg->sCommand == _T("330"))
+ if (pmsg->sCommand == L"330")
m_whoisDlg->m_InfoAuth.SetText(pmsg->parameters[2].c_str());
- else if (pmsg->parameters[2] == _T("is an identified user") || pmsg->parameters[2] == _T("is a registered nick"))
+ else if (pmsg->parameters[2] == L"is an identified user" || pmsg->parameters[2] == L"is a registered nick")
m_whoisDlg->m_InfoAuth.SetText(pmsg->parameters[2].c_str());
else
OnIrc_WHOIS_OTHER(pmsg);
@@ -1767,7 +1767,7 @@ bool CIrcProto::OnIrc_WHOIS_NO_USER(const CIrcMessage* pmsg)
CONTACT user = { (TCHAR*)pmsg->parameters[1].c_str(), NULL, NULL, false, false, false };
MCONTACT hContact = CList_FindContact(&user);
if (hContact) {
- AddOutgoingMessageToDB(hContact, (TCHAR*)((CMString)_T("> ") + pmsg->parameters[2] + (CMString)_T(": ") + pmsg->parameters[1]).c_str());
+ AddOutgoingMessageToDB(hContact, (TCHAR*)((CMString)L"> " + pmsg->parameters[2] + (CMString)L": " + pmsg->parameters[1]).c_str());
DBVARIANT dbv;
if (!getTString(hContact, "Default", &dbv)) {
@@ -1775,13 +1775,13 @@ bool CIrcProto::OnIrc_WHOIS_NO_USER(const CIrcMessage* pmsg)
DBVARIANT dbv2;
if (getByte(hContact, "AdvancedMode", 0) == 0)
- DoUserhostWithReason(1, ((CMString)_T("S") + dbv.ptszVal).c_str(), true, dbv.ptszVal);
+ DoUserhostWithReason(1, ((CMString)L"S" + dbv.ptszVal).c_str(), true, dbv.ptszVal);
else {
if (!getTString(hContact, "UWildcard", &dbv2)) {
- DoUserhostWithReason(2, ((CMString)_T("S") + dbv2.ptszVal).c_str(), true, dbv2.ptszVal);
+ DoUserhostWithReason(2, ((CMString)L"S" + dbv2.ptszVal).c_str(), true, dbv2.ptszVal);
db_free(&dbv2);
}
- else DoUserhostWithReason(2, ((CMString)_T("S") + dbv.ptszVal).c_str(), true, dbv.ptszVal);
+ else DoUserhostWithReason(2, ((CMString)L"S" + dbv.ptszVal).c_str(), true, dbv.ptszVal);
}
setString(hContact, "User", "");
setString(hContact, "Host", "");
@@ -1804,7 +1804,7 @@ static void __stdcall sttShowNickWnd(void* param)
}
SetEvent(ppro->m_evWndCreate);
SetDlgItemText(ppro->m_nickDlg->GetHwnd(), IDC_CAPTION, TranslateT("Change nickname"));
- SetDlgItemText(ppro->m_nickDlg->GetHwnd(), IDC_TEXT, pmsg->parameters.getCount() > 2 ? pmsg->parameters[2].c_str() : _T(""));
+ SetDlgItemText(ppro->m_nickDlg->GetHwnd(), IDC_TEXT, pmsg->parameters.getCount() > 2 ? pmsg->parameters[2].c_str() : L"");
ppro->m_nickDlg->m_Enick.SetText(pmsg->parameters[1].c_str());
ppro->m_nickDlg->m_Enick.SendMsg(CB_SETEDITSEL, 0, MAKELPARAM(0, -1));
delete pmsg;
@@ -1815,7 +1815,7 @@ bool CIrcProto::OnIrc_NICK_ERR(const CIrcMessage* pmsg)
if (pmsg->m_bIncoming) {
if (nickflag && ((m_alternativeNick[0] != 0)) && (pmsg->parameters.getCount() > 2 && mir_tstrcmp(pmsg->parameters[1].c_str(), m_alternativeNick))) {
TCHAR m[200];
- mir_sntprintf(m, _T("NICK %s"), m_alternativeNick);
+ mir_sntprintf(m, L"NICK %s", m_alternativeNick);
if (IsConnected())
SendIrcMessage(m);
}
@@ -1834,8 +1834,8 @@ bool CIrcProto::OnIrc_JOINERROR(const CIrcMessage* pmsg)
if (pmsg->m_bIncoming) {
DBVARIANT dbv;
if (!getTString("JTemp", &dbv)) {
- CMString command = _T("a");
- CMString save = _T("");
+ CMString command = L"a";
+ CMString save = L"";
int i = 0;
while (!command.IsEmpty()) {
@@ -1843,7 +1843,7 @@ bool CIrcProto::OnIrc_JOINERROR(const CIrcMessage* pmsg)
i++;
if (!command.IsEmpty() && pmsg->parameters[0] == command.Mid(1))
- save += command + _T(" ");
+ save += command + L" ";
}
db_free(&dbv);
@@ -1862,9 +1862,9 @@ bool CIrcProto::OnIrc_JOINERROR(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_UNKNOWN(const CIrcMessage* pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 0) {
- if (pmsg->parameters[0] == _T("WHO") && GetNextUserhostReason(2) != _T("U"))
+ if (pmsg->parameters[0] == L"WHO" && GetNextUserhostReason(2) != L"U")
return true;
- if (pmsg->parameters[0] == _T("USERHOST") && GetNextUserhostReason(1) != _T("U"))
+ if (pmsg->parameters[0] == L"USERHOST" && GetNextUserhostReason(1) != L"U")
return true;
}
ShowMessage(pmsg);
@@ -1926,7 +1926,7 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg)
while (!User.IsEmpty()) {
if (GetWord(m_whoReply.c_str(), 3)[0] == 'G') {
S += User;
- S += _T("\t");
+ S += L"\t";
DoEvent(GC_EVENT_SETCONTACTSTATUS, pmsg->parameters[1].c_str(), User.c_str(), NULL, NULL, NULL, ID_STATUS_AWAY, FALSE, FALSE);
}
else DoEvent(GC_EVENT_SETCONTACTSTATUS, pmsg->parameters[1].c_str(), User.c_str(), NULL, NULL, NULL, ID_STATUS_ONLINE, FALSE, FALSE);
@@ -1945,7 +1945,7 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg)
/// if it is not a channel
ptrT UserList(mir_tstrdup(m_whoReply.c_str()));
const TCHAR* p1 = UserList;
- m_whoReply = _T("");
+ m_whoReply = L"";
CONTACT ccUser = { (TCHAR*)pmsg->parameters[1].c_str(), NULL, NULL, false, true, false };
MCONTACT hContact = CList_FindContact(&ccUser);
@@ -1991,7 +1991,7 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg)
if (DBWildcard && DBNick && !WCCmp(CharLower(DBWildcard), CharLower(DBNick))) {
setTString(hContact, "Nick", DBDefault);
- DoUserhostWithReason(2, ((CMString)_T("S") + DBWildcard).c_str(), true, (TCHAR*)DBWildcard);
+ DoUserhostWithReason(2, ((CMString)L"S" + DBWildcard).c_str(), true, (TCHAR*)DBWildcard);
setString(hContact, "User", "");
setString(hContact, "Host", "");
@@ -2015,7 +2015,7 @@ bool CIrcProto::OnIrc_WHO_REPLY(const CIrcMessage* pmsg)
{
CMString command = PeekAtReasons(2);
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 6 && command[0] == 'S') {
- m_whoReply.AppendFormat(_T("%s %s %s %s "), pmsg->parameters[5].c_str(), pmsg->parameters[2].c_str(), pmsg->parameters[3].c_str(), pmsg->parameters[6].c_str());
+ m_whoReply.AppendFormat(L"%s %s %s %s ", pmsg->parameters[5].c_str(), pmsg->parameters[2].c_str(), pmsg->parameters[3].c_str(), pmsg->parameters[6].c_str());
if (mir_tstrcmpi(pmsg->parameters[5].c_str(), m_info.sNick.c_str()) == 0) {
TCHAR host[1024];
mir_tstrncpy(host, pmsg->parameters[3].c_str(), 1024);
@@ -2030,12 +2030,12 @@ bool CIrcProto::OnIrc_WHO_REPLY(const CIrcMessage* pmsg)
bool CIrcProto::OnIrc_TRYAGAIN(const CIrcMessage* pmsg)
{
- CMString command = _T("");
+ CMString command = L"";
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1) {
- if (pmsg->parameters[1] == _T("WHO"))
+ if (pmsg->parameters[1] == L"WHO")
command = GetNextUserhostReason(2);
- if (pmsg->parameters[1] == _T("USERHOST"))
+ if (pmsg->parameters[1] == L"USERHOST")
command = GetNextUserhostReason(1);
}
if (command[0] == 'U')
@@ -2048,7 +2048,7 @@ bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg)
CMString command;
if (pmsg->m_bIncoming) {
command = GetNextUserhostReason(1);
- if (!command.IsEmpty() && command != _T("U") && pmsg->parameters.getCount() > 1) {
+ if (!command.IsEmpty() && command != L"U" && pmsg->parameters.getCount() > 1) {
CONTACT finduser = { NULL, NULL, NULL, false, false, false };
int awaystatus = 0;
CMString sTemp;
@@ -2096,8 +2096,8 @@ bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg)
user = p2;
nick = p1;
}
- mess = _T("");
- mask = nick + _T("!") + user + _T("@") + host;
+ mess = L"";
+ mask = nick + L"!" + user + L"@" + host;
if (host.IsEmpty() || user.IsEmpty() || nick.IsEmpty()) {
mir_free(p1);
continue;
@@ -2126,32 +2126,32 @@ bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg)
break;
case 'I': // m_ignore
- mess = _T("/IGNORE %question=\"");
+ mess = L"/IGNORE %question=\"";
mess += TranslateT("Please enter the hostmask (nick!user@host)\nNOTE! Contacts on your contact list are never ignored");
- mess += (CMString)_T("\",\"") + TranslateT("Ignore") + _T("\",\"*!*@") + host + _T("\"");
+ mess += (CMString)L"\",\"" + TranslateT("Ignore") + L"\",\"*!*@" + host + L"\"";
if (m_ignoreChannelDefault)
- mess += _T(" +qnidcm");
+ mess += L" +qnidcm";
else
- mess += _T(" +qnidc");
+ mess += L" +qnidc";
break;
case 'J': // Unignore
- mess = _T("/UNIGNORE *!*@") + host;
+ mess = L"/UNIGNORE *!*@" + host;
break;
case 'B': // Ban
channel = (command.c_str() + 1);
- mess = _T("/MODE ") + channel + _T(" +b *!*@") + host;
+ mess = L"/MODE " + channel + L" +b *!*@" + host;
break;
case 'K': // Ban & Kick
channel = (command.c_str() + 1);
- mess.Format(_T("/MODE %s +b *!*@%s%%newl/KICK %s %s"), channel.c_str(), host.c_str(), channel.c_str(), nick.c_str());
+ mess.Format(L"/MODE %s +b *!*@%s%%newl/KICK %s %s", channel.c_str(), host.c_str(), channel.c_str(), nick.c_str());
break;
case 'L': // Ban & Kick with reason
channel = (command.c_str() + 1);
- mess.Format(_T("/MODE %s +b *!*@%s%%newl/KICK %s %s %%question=\"%s\",\"%s\",\"%s\""),
+ mess.Format(L"/MODE %s +b *!*@%s%%newl/KICK %s %s %%question=\"%s\",\"%s\",\"%s\"",
channel.c_str(), host.c_str(), channel.c_str(), nick.c_str(),
TranslateT("Please enter the reason"), TranslateT("Ban'n Kick"), TranslateT("Jerk"));
break;
@@ -2177,14 +2177,14 @@ bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg)
}
}
- if (!pmsg->m_bIncoming || command == _T("U"))
+ if (!pmsg->m_bIncoming || command == L"U")
ShowMessage(pmsg);
return true;
}
bool CIrcProto::OnIrc_SUPPORT(const CIrcMessage* pmsg)
{
- static const TCHAR *lpszFmt = _T("Try server %99[^ ,], port %19s");
+ static const TCHAR *lpszFmt = L"Try server %99[^ ,], port %19s";
TCHAR szAltServer[100];
TCHAR szAltPort[20];
if (pmsg->parameters.getCount() > 1 && _stscanf(pmsg->parameters[1].c_str(), lpszFmt, &szAltServer, &szAltPort) == 2) {
@@ -2204,19 +2204,19 @@ bool CIrcProto::OnIrc_SUPPORT(const CIrcMessage* pmsg)
CMString S;
for (int i = 0; i < pmsg->parameters.getCount(); i++) {
TCHAR* temp = mir_tstrdup(pmsg->parameters[i].c_str());
- if (_tcsstr(temp, _T("CHANTYPES="))) {
+ if (_tcsstr(temp, L"CHANTYPES=")) {
TCHAR* p1 = _tcschr(temp, '=');
p1++;
if (mir_tstrlen(p1) > 0)
sChannelPrefixes = p1;
}
- if (_tcsstr(temp, _T("CHANMODES="))) {
+ if (_tcsstr(temp, L"CHANMODES=")) {
TCHAR* p1 = _tcschr(temp, '=');
p1++;
if (mir_tstrlen(p1) > 0)
sChannelModes = (char*)_T2A(p1);
}
- if (_tcsstr(temp, _T("PREFIX="))) {
+ if (_tcsstr(temp, L"PREFIX=")) {
TCHAR* p1 = _tcschr(temp, '(');
TCHAR* p2 = _tcschr(temp, ')');
if (p1 && p2) {
@@ -2268,7 +2268,7 @@ void CIrcProto::OnIrcDefault(const CIrcMessage* pmsg)
void CIrcProto::OnIrcDisconnected()
{
- m_statusMessage = _T("");
+ m_statusMessage = L"";
db_unset(NULL, m_szModuleName, "JTemp");
bTempDisableCheck = false;
bTempForceCheck = false;
@@ -2286,7 +2286,7 @@ void CIrcProto::OnIrcDisconnected()
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)Temp, ID_STATUS_OFFLINE);
- CMString sDisconn = _T("\035\002");
+ CMString sDisconn = L"\035\002";
sDisconn += TranslateT("*Disconnected*");
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, sDisconn.c_str(), NULL, NULL, NULL, true, false);
@@ -2339,7 +2339,7 @@ bool CIrcProto::DoOnConnect(const CIrcMessage*)
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)Temp, m_iStatus);
if (m_iDesiredStatus == ID_STATUS_AWAY)
- PostIrcMessage(_T("/AWAY %s"), m_statusMessage.Mid(0, 450));
+ PostIrcMessage(L"/AWAY %s", m_statusMessage.Mid(0, 450));
if (m_perform) {
DoPerform("ALL NETWORKS");
@@ -2362,14 +2362,14 @@ bool CIrcProto::DoOnConnect(const CIrcMessage*)
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci) && gci.iType == GCW_CHATROOM) {
CHANNELINFO *wi = (CHANNELINFO*)gci.dwItemData;
if (wi && wi->pszPassword)
- PostIrcMessage(_T("/JOIN %s %s"), gci.pszName, wi->pszPassword);
+ PostIrcMessage(L"/JOIN %s %s", gci.pszName, wi->pszPassword);
else
- PostIrcMessage(_T("/JOIN %s"), gci.pszName);
+ PostIrcMessage(L"/JOIN %s", gci.pszName);
}
}
}
- DoEvent(GC_EVENT_ADDGROUP, SERVERWINDOW, NULL, NULL, _T("Normal"), NULL, NULL, FALSE, TRUE);
+ DoEvent(GC_EVENT_ADDGROUP, SERVERWINDOW, NULL, NULL, L"Normal", NULL, NULL, FALSE, TRUE);
{
GCDEST gcd = { m_szModuleName, SERVERWINDOW, GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
@@ -2394,7 +2394,7 @@ int CIrcProto::DoPerform(const char* event)
DBVARIANT dbv;
if (!getTString(sSetting.c_str(), &dbv)) {
- if (!my_strstri(dbv.ptszVal, _T("/away")))
+ if (!my_strstri(dbv.ptszVal, L"/away"))
PostIrcMessageWnd(NULL, NULL, dbv.ptszVal);
else
mir_forkthread(AwayWarningThread, NULL);
@@ -2406,7 +2406,7 @@ int CIrcProto::DoPerform(const char* event)
int CIrcProto::IsIgnored(const CMString& nick, const CMString& address, const CMString& host, char type)
{
- return IsIgnored(nick + _T("!") + address + _T("@") + host, type);
+ return IsIgnored(nick + L"!" + address + L"@" + host, type);
}
int CIrcProto::IsIgnored(CMString user, char type)
@@ -2440,7 +2440,7 @@ int CIrcProto::IsIgnored(CMString user, char type)
bool CIrcProto::AddIgnore(const TCHAR* mask, const TCHAR* flags, const TCHAR* network)
{
RemoveIgnore(mask);
- m_ignoreItems.insert(new CIrcIgnoreItem(mask, (_T("+") + CMString(flags)).c_str(), network));
+ m_ignoreItems.insert(new CIrcIgnoreItem(mask, (L"+" + CMString(flags)).c_str(), network));
RewriteIgnoreSettings();
if (m_ignoreDlg)
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp
index ef2611db39..d8204e63dc 100644
--- a/protocols/IRCG/src/input.cpp
+++ b/protocols/IRCG/src/input.cpp
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
#include "version.h"
-#define NICKSUBSTITUTE _T("!_nick_!")
+#define NICKSUBSTITUTE L"!_nick_!"
void CIrcProto::FormatMsg(CMString& text)
{
@@ -30,25 +30,25 @@ void CIrcProto::FormatMsg(CMString& text)
mir_tstrncpy(temp, GetWord(text.c_str(), 0).c_str(), 29);
CharLower(temp);
CMString command = temp;
- CMString S = _T("");
- if (command == _T("/quit") || command == _T("/away"))
- S = GetWord(text.c_str(), 0) + _T(" :") + GetWordAddress(text.c_str(), 1);
- else if (command == _T("/privmsg") || command == _T("/part") || command == _T("/topic") || command == _T("/notice")) {
- S = GetWord(text.c_str(), 0) + _T(" ") + GetWord(text.c_str(), 1) + _T(" :");
+ CMString S = L"";
+ if (command == L"/quit" || command == L"/away")
+ S = GetWord(text.c_str(), 0) + L" :" + GetWordAddress(text.c_str(), 1);
+ else if (command == L"/privmsg" || command == L"/part" || command == L"/topic" || command == L"/notice") {
+ S = GetWord(text.c_str(), 0) + L" " + GetWord(text.c_str(), 1) + L" :";
if (!GetWord(text.c_str(), 2).IsEmpty())
S += CMString(GetWordAddress(text.c_str(), 2));
}
- else if (command == _T("/kick")) {
- S = GetWord(text.c_str(), 0) + _T(" ") + GetWord(text.c_str(), 1) + _T(" ") + GetWord(text.c_str(), 2) + _T(" :") + GetWordAddress(text.c_str(), 3);
+ else if (command == L"/kick") {
+ S = GetWord(text.c_str(), 0) + L" " + GetWord(text.c_str(), 1) + L" " + GetWord(text.c_str(), 2) + L" :" + GetWordAddress(text.c_str(), 3);
}
- else if (command == _T("/nick")) {
+ else if (command == L"/nick") {
if (!_tcsstr(GetWord(text.c_str(), 1).c_str(), NICKSUBSTITUTE)) {
sNick4Perform = GetWord(text.c_str(), 1);
S = GetWordAddress(text.c_str(), 0);
}
else {
CMString sNewNick = GetWord(text.c_str(), 1);
- if (sNick4Perform == _T("")) {
+ if (sNick4Perform == L"") {
DBVARIANT dbv;
if (!getTString("PNick", &dbv)) {
sNick4Perform = dbv.ptszVal;
@@ -57,7 +57,7 @@ void CIrcProto::FormatMsg(CMString& text)
}
sNewNick.Replace(NICKSUBSTITUTE, sNick4Perform.c_str());
- S = GetWord(text.c_str(), 0) + _T(" ") + sNewNick;
+ S = GetWord(text.c_str(), 0) + L" " + sNewNick;
}
}
else S = GetWordAddress(text.c_str(), 0);
@@ -68,17 +68,17 @@ void CIrcProto::FormatMsg(CMString& text)
static void AddCR(CMString& text)
{
- text.Replace(_T("\n"), _T("\r\n"));
- text.Replace(_T("\r\r"), _T("\r"));
+ text.Replace(L"\n", L"\r\n");
+ text.Replace(L"\r\r", L"\r");
}
CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window)
{
- CMString Messageout = _T("");
+ CMString Messageout = L"";
const TCHAR* p1 = text;
const TCHAR* p2 = text;
bool LinebreakFlag = false, hasAlias = false;
- p2 = _tcsstr(p1, _T("\r\n"));
+ p2 = _tcsstr(p1, L"\r\n");
if (!p2)
p2 = _tcschr(p1, '\0');
if (p1 == p2)
@@ -86,7 +86,7 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window)
do {
if (LinebreakFlag)
- Messageout += _T("\r\n");
+ Messageout += L"\r\n";
TCHAR* line = new TCHAR[p2 - p1 + 1];
mir_tstrncpy(line, p1, p2 - p1 + 1);
@@ -100,42 +100,42 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window)
line = new TCHAR[S.GetLength() + 2];
mir_tstrncpy(line, S.c_str(), S.GetLength() + 1);
CMString alias(m_alias);
- const TCHAR* p3 = _tcsstr(alias.c_str(), (GetWord(line, 0) + _T(" ")).c_str());
+ const TCHAR* p3 = _tcsstr(alias.c_str(), (GetWord(line, 0) + L" ").c_str());
if (p3 != alias.c_str()) {
- CMString str = _T("\r\n");
- str += GetWord(line, 0) + _T(" ");
+ CMString str = L"\r\n";
+ str += GetWord(line, 0) + L" ";
p3 = _tcsstr(alias.c_str(), str.c_str());
if (p3)
p3 += 2;
}
if (p3 != NULL) {
hasAlias = true;
- const TCHAR* p4 = _tcsstr(p3, _T("\r\n"));
+ const TCHAR* p4 = _tcsstr(p3, L"\r\n");
if (!p4)
p4 = _tcschr(p3, '\0');
*(TCHAR*)p4 = 0;
CMString str = p3;
- str.Replace(_T("##"), window);
- str.Replace(_T("$?"), _T("%question"));
+ str.Replace(L"##", window);
+ str.Replace(L"$?", L"%question");
TCHAR buf[5];
for (int index = 1; index < 8; index++) {
- mir_sntprintf(buf, _T("#$%u"), index);
+ mir_sntprintf(buf, L"#$%u", index);
if (!GetWord(line, index).IsEmpty() && IsChannel(GetWord(line, index)))
str.Replace(buf, GetWord(line, index).c_str());
else {
- CMString S1 = _T("#");
+ CMString S1 = L"#";
S1 += GetWord(line, index);
str.Replace(buf, S1.c_str());
}
}
for (int index2 = 1; index2 < 8; index2++) {
- mir_sntprintf(buf, _T("$%u-"), index2);
+ mir_sntprintf(buf, L"$%u-", index2);
str.Replace(buf, GetWordAddress(line, index2));
}
for (int index3 = 1; index3 < 8; index3++) {
- mir_sntprintf(buf, _T("$%u"), index3);
+ mir_sntprintf(buf, L"$%u", index3);
str.Replace(buf, GetWord(line, index3).c_str());
}
Messageout += GetWordAddress(str.c_str(), 1);
@@ -147,7 +147,7 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window)
p1 = p2;
if (*p1 == '\r')
p1 += 2;
- p2 = _tcsstr(p1, _T("\r\n"));
+ p2 = _tcsstr(p1, L"\r\n");
if (!p2)
p2 = _tcschr(p1, '\0');
delete[] line;
@@ -164,32 +164,32 @@ CMString CIrcProto::DoIdentifiers(CMString text, const TCHAR*)
TCHAR str[2];
GetLocalTime(&time);
- text.Replace(_T("%mnick"), m_nick);
- text.Replace(_T("%anick"), m_alternativeNick);
- text.Replace(_T("%awaymsg"), m_statusMessage.c_str());
- text.Replace(_T("%module"), _A2T(m_szModuleName));
- text.Replace(_T("%name"), m_name);
- text.Replace(_T("%newl"), _T("\r\n"));
- text.Replace(_T("%network"), m_info.sNetwork.c_str());
- text.Replace(_T("%me"), m_info.sNick.c_str());
+ text.Replace(L"%mnick", m_nick);
+ text.Replace(L"%anick", m_alternativeNick);
+ text.Replace(L"%awaymsg", m_statusMessage.c_str());
+ text.Replace(L"%module", _A2T(m_szModuleName));
+ text.Replace(L"%name", m_name);
+ text.Replace(L"%newl", L"\r\n");
+ text.Replace(L"%network", m_info.sNetwork.c_str());
+ text.Replace(L"%me", m_info.sNick.c_str());
char mirver[100];
CallService(MS_SYSTEM_GETVERSIONTEXT, _countof(mirver), LPARAM(mirver));
- text.Replace(_T("%mirver"), _A2T(mirver));
+ text.Replace(L"%mirver", _A2T(mirver));
- text.Replace(_T("%version"), _T(__VERSION_STRING_DOTS));
+ text.Replace(L"%version", _T(__VERSION_STRING_DOTS));
str[0] = 3; str[1] = '\0';
- text.Replace(_T("%color"), str);
+ text.Replace(L"%color", str);
str[0] = 2;
- text.Replace(_T("%bold"), str);
+ text.Replace(L"%bold", str);
str[0] = 31;
- text.Replace(_T("%underline"), str);
+ text.Replace(L"%underline", str);
str[0] = 22;
- text.Replace(_T("%italics"), str);
+ text.Replace(L"%italics", str);
return text;
}
@@ -218,19 +218,19 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
CMString three = GetWord(text, 3);
CMString therest = GetWordAddress(text, 4);
- if (command == _T("/servershow") || command == _T("/serverhide")) {
+ if (command == L"/servershow" || command == L"/serverhide") {
if (m_useServer) {
GCDEST gcd = { m_szModuleName, SERVERWINDOW, GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
- CallChatEvent(command == _T("/servershow") ? WINDOW_VISIBLE : WINDOW_HIDDEN, (LPARAM)&gce);
+ CallChatEvent(command == L"/servershow" ? WINDOW_VISIBLE : WINDOW_HIDDEN, (LPARAM)&gce);
}
return true;
}
- else if (command == _T("/sleep") || command == _T("/wait")) {
+ else if (command == L"/sleep" || command == L"/wait") {
if (!one.IsEmpty()) {
int ms;
- if (_stscanf(one.c_str(), _T("%d"), &ms) == 1 && ms > 0 && ms <= 4000)
+ if (_stscanf(one.c_str(), L"%d", &ms) == 1 && ms > 0 && ms <= 4000)
Sleep(ms);
else
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Incorrect parameters. Usage: /sleep [ms], ms should be greater than 0 and less than 4000."), NULL, NULL, NULL, true, false);
@@ -238,10 +238,10 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
return true;
}
- if (command == _T("/clear")) {
+ if (command == L"/clear") {
CMString S;
if (!one.IsEmpty()) {
- if (one == _T("server"))
+ if (one == L"server")
S = SERVERWINDOW;
else
S = MakeWndID(one.c_str());
@@ -257,7 +257,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
return true;
}
- if (command == _T("/ignore")) {
+ if (command == L"/ignore") {
if (IsConnected()) {
CMString IgnoreFlags;
TCHAR temp[500];
@@ -268,18 +268,18 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Ignore system is disabled"), NULL, NULL, NULL, true, false);
return true;
}
- if (!mir_tstrcmpi(one.c_str(), _T("on"))) {
+ if (!mir_tstrcmpi(one.c_str(), L"on")) {
m_ignore = 1;
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Ignore system is enabled"), NULL, NULL, NULL, true, false);
return true;
}
- if (!mir_tstrcmpi(one.c_str(), _T("off"))) {
+ if (!mir_tstrcmpi(one.c_str(), L"off")) {
m_ignore = 0;
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Ignore system is disabled"), NULL, NULL, NULL, true, false);
return true;
}
if (!_tcschr(one.c_str(), '!') && !_tcschr(one.c_str(), '@'))
- one += _T("!*@*");
+ one += L"!*@*";
if (!two.IsEmpty() && two[0] == '+') {
if (_tcschr(two.c_str(), 'q'))
@@ -295,7 +295,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
if (_tcschr(two.c_str(), 'm'))
IgnoreFlags += 'm';
}
- else IgnoreFlags = _T("qnidc");
+ else IgnoreFlags = L"qnidc";
CMString szNetwork;
if (three.IsEmpty())
@@ -311,9 +311,9 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
return true;
}
- if (command == _T("/unignore")) {
+ if (command == L"/unignore") {
if (!_tcschr(one.c_str(), '!') && !_tcschr(one.c_str(), '@'))
- one += _T("!*@*");
+ one += L"!*@*";
TCHAR temp[500];
if (RemoveIgnore(one.c_str()))
@@ -324,15 +324,15 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
return true;
}
- if (command == _T("/userhost")) {
+ if (command == L"/userhost") {
if (one.IsEmpty())
return true;
- DoUserhostWithReason(1, _T("U"), false, command);
+ DoUserhostWithReason(1, L"U", false, command);
return false;
}
- if (command == _T("/joinx")) {
+ if (command == L"/joinx") {
if (!one.IsEmpty()) {
for (int i = 1;; i++) {
CMString tmp = GetWord(text, i);
@@ -342,12 +342,12 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
AddToJTemp('X', tmp);
}
- PostIrcMessage(_T("/JOIN %s"), GetWordAddress(text, 1));
+ PostIrcMessage(L"/JOIN %s", GetWordAddress(text, 1));
}
return true;
}
- if (command == _T("/joinm")) {
+ if (command == L"/joinm") {
if (!one.IsEmpty()) {
for (int i = 1;; i++) {
CMString tmp = GetWord(text, i);
@@ -357,12 +357,12 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
AddToJTemp('M', tmp);
}
- PostIrcMessage(_T("/JOIN %s"), GetWordAddress(text, 1));
+ PostIrcMessage(L"/JOIN %s", GetWordAddress(text, 1));
}
return true;
}
- if (command == _T("/nusers")) {
+ if (command == L"/nusers") {
TCHAR szTemp[40];
CMString S = MakeWndID(window);
GC_INFO gci = { 0 };
@@ -370,22 +370,22 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
gci.pszModule = m_szModuleName;
gci.pszID = S.c_str();
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci))
- mir_sntprintf(szTemp, _T("users: %u"), gci.iCount);
+ mir_sntprintf(szTemp, L"users: %u", gci.iCount);
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
return true;
}
- if (command == _T("/echo")) {
+ if (command == L"/echo") {
if (one.IsEmpty())
return true;
- if (!mir_tstrcmpi(one.c_str(), _T("on"))) {
+ if (!mir_tstrcmpi(one.c_str(), L"on")) {
bEcho = TRUE;
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Outgoing commands are shown"), NULL, NULL, NULL, true, false);
}
- if (!mir_tstrcmpi(one.c_str(), _T("off"))) {
+ if (!mir_tstrcmpi(one.c_str(), L"off")) {
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("Outgoing commands are not shown"), NULL, NULL, NULL, true, false);
bEcho = FALSE;
}
@@ -393,7 +393,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
return true;
}
- if (command == _T("/buddycheck")) {
+ if (command == L"/buddycheck") {
if (one.IsEmpty()) {
if ((m_autoOnlineNotification && !bTempDisableCheck) || bTempForceCheck)
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("The buddy check function is enabled"), NULL, NULL, NULL, true, false);
@@ -401,17 +401,17 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("The buddy check function is disabled"), NULL, NULL, NULL, true, false);
return true;
}
- if (!mir_tstrcmpi(one.c_str(), _T("on"))) {
+ if (!mir_tstrcmpi(one.c_str(), L"on")) {
bTempForceCheck = true;
bTempDisableCheck = false;
CallFunctionAsync(sttSetTimerOn, this);
}
- if (!mir_tstrcmpi(one.c_str(), _T("off"))) {
+ if (!mir_tstrcmpi(one.c_str(), L"off")) {
bTempForceCheck = false;
bTempDisableCheck = true;
CallFunctionAsync(sttSetTimerOff, this);
}
- if (!mir_tstrcmpi(one.c_str(), _T("time")) && !two.IsEmpty()) {
+ if (!mir_tstrcmpi(one.c_str(), L"time") && !two.IsEmpty()) {
m_iTempCheckTime = _ttoi(two.c_str());
if (m_iTempCheckTime < 10 && m_iTempCheckTime != 0)
m_iTempCheckTime = 10;
@@ -427,14 +427,14 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
return true;
}
- if (command == _T("/whois")) {
+ if (command == L"/whois") {
if (one.IsEmpty())
return false;
m_manualWhoisCount++;
return false;
}
- if (command == _T("/channelmanager")) {
+ if (command == L"/channelmanager") {
if (window && !hContact && IsChannel(window)) {
if (IsConnected()) {
if (m_managerDlg != NULL) {
@@ -452,26 +452,26 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
return true;
}
- if (command == _T("/who")) {
+ if (command == L"/who") {
if (one.IsEmpty())
return true;
- DoUserhostWithReason(2, _T("U"), false, _T("%s"), one.c_str());
+ DoUserhostWithReason(2, L"U", false, L"%s", one.c_str());
return false;
}
- if (command == _T("/hop")) {
+ if (command == L"/hop") {
if (!IsChannel(window))
return true;
- PostIrcMessage(_T("/PART %s"), window);
+ PostIrcMessage(L"/PART %s", window);
if ((one.IsEmpty() || !IsChannel(one))) {
CHANNELINFO *wi = (CHANNELINFO *)DoEvent(GC_EVENT_GETITEMDATA, window, NULL, NULL, NULL, NULL, NULL, FALSE, FALSE, 0);
if (wi && wi->pszPassword)
- PostIrcMessage(_T("/JOIN %s %s"), window, wi->pszPassword);
+ PostIrcMessage(L"/JOIN %s %s", window, wi->pszPassword);
else
- PostIrcMessage(_T("/JOIN %s"), window);
+ PostIrcMessage(L"/JOIN %s", window);
return true;
}
@@ -480,11 +480,11 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
GCEVENT gce = { sizeof(gce), &gcd };
CallChatEvent(SESSION_TERMINATE, (LPARAM)&gce);
- PostIrcMessage(_T("/JOIN %s"), GetWordAddress(text, 1));
+ PostIrcMessage(L"/JOIN %s", GetWordAddress(text, 1));
return true;
}
- if (command == _T("/list")) {
+ if (command == L"/list") {
if (m_listDlg == NULL) {
m_listDlg = new CListDlg(this);
m_listDlg->Show();
@@ -496,55 +496,55 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
CMString szMsg(FORMAT, TranslateT("This command is not recommended on a network of this size!\r\nIt will probably cause high CPU usage and/or high bandwidth\r\nusage for around %u to %u minute(s).\r\n\r\nDo you want to continue?"), minutes2, minutes);
if (m_noOfChannels < 4000 || (m_noOfChannels >= 4000 && MessageBox(NULL, szMsg, TranslateT("IRC warning"), MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) == IDYES)) {
ListView_DeleteAllItems(GetDlgItem(m_listDlg->GetHwnd(), IDC_INFO_LISTVIEW));
- PostIrcMessage(_T("/lusers"));
+ PostIrcMessage(L"/lusers");
return false;
}
m_listDlg->m_status.SetText(TranslateT("Aborted"));
return true;
}
- if (command == _T("/me")) {
+ if (command == L"/me") {
if (one.IsEmpty())
return true;
TCHAR szTemp[4000];
- mir_sntprintf(szTemp, _T("\001ACTION %s\001"), GetWordAddress(text.c_str(), 1));
+ mir_sntprintf(szTemp, L"\001ACTION %s\001", GetWordAddress(text.c_str(), 1));
PostIrcMessageWnd(window, hContact, szTemp);
return true;
}
- if (command == _T("/ame")) {
+ if (command == L"/ame") {
if (one.IsEmpty())
return true;
- CMString S = _T("/ME ") + DoIdentifiers(GetWordAddress(text.c_str(), 1), window);
- S.Replace(_T("%"), _T("%%"));
+ CMString S = L"/ME " + DoIdentifiers(GetWordAddress(text.c_str(), 1), window);
+ S.Replace(L"%", L"%%");
DoEvent(GC_EVENT_SENDMESSAGE, NULL, NULL, S.c_str(), NULL, NULL, NULL, FALSE, FALSE);
return true;
}
- if (command == _T("/amsg")) {
+ if (command == L"/amsg") {
if (one.IsEmpty())
return true;
CMString S = DoIdentifiers(GetWordAddress(text.c_str(), 1), window);
- S.Replace(_T("%"), _T("%%"));
+ S.Replace(L"%", L"%%");
DoEvent(GC_EVENT_SENDMESSAGE, NULL, NULL, S.c_str(), NULL, NULL, NULL, FALSE, FALSE);
return true;
}
- if (command == _T("/msg")) {
+ if (command == L"/msg") {
if (one.IsEmpty() || two.IsEmpty())
return true;
TCHAR szTemp[4000];
- mir_sntprintf(szTemp, _T("/PRIVMSG %s"), GetWordAddress(text.c_str(), 1));
+ mir_sntprintf(szTemp, L"/PRIVMSG %s", GetWordAddress(text.c_str(), 1));
PostIrcMessageWnd(window, hContact, szTemp);
return true;
}
- if (command == _T("/query")) {
+ if (command == L"/query") {
if (one.IsEmpty() || IsChannel(one.c_str()))
return true;
@@ -552,17 +552,17 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
MCONTACT hContact2 = CList_AddContact(&user, false, false);
if (hContact2) {
if (getByte(hContact, "AdvancedMode", 0) == 0)
- DoUserhostWithReason(1, (_T("S") + one).c_str(), true, one.c_str());
+ DoUserhostWithReason(1, (L"S" + one).c_str(), true, one.c_str());
else {
DBVARIANT dbv1;
if (!getTString(hContact, "UWildcard", &dbv1)) {
- CMString S = _T("S");
+ CMString S = L"S";
S += dbv1.ptszVal;
DoUserhostWithReason(2, S.c_str(), true, dbv1.ptszVal);
db_free(&dbv1);
}
else {
- CMString S = _T("S");
+ CMString S = L"S";
S += one;
DoUserhostWithReason(2, S.c_str(), true, one.c_str());
}
@@ -573,13 +573,13 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
if (!two.IsEmpty()) {
TCHAR szTemp[4000];
- mir_sntprintf(szTemp, _T("/PRIVMSG %s"), GetWordAddress(text.c_str(), 1));
+ mir_sntprintf(szTemp, L"/PRIVMSG %s", GetWordAddress(text.c_str(), 1));
PostIrcMessageWnd(window, hContact, szTemp);
}
return true;
}
- if (command == _T("/ctcp")) {
+ if (command == L"/ctcp") {
if (one.IsEmpty() || two.IsEmpty())
return true;
@@ -591,15 +591,15 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
ulAdr = ConvertIPToInteger(m_IPFromServer ? m_myHost : m_myLocalHost);
// if it is not dcc or if it is dcc and a local ip exist
- if (mir_tstrcmpi(two.c_str(), _T("dcc")) != 0 || ulAdr) {
- if (mir_tstrcmpi(two.c_str(), _T("ping")) == 0)
- mir_sntprintf(szTemp, _T("/PRIVMSG %s \001%s %u\001"), one.c_str(), two.c_str(), time(0));
+ if (mir_tstrcmpi(two.c_str(), L"dcc") != 0 || ulAdr) {
+ if (mir_tstrcmpi(two.c_str(), L"ping") == 0)
+ mir_sntprintf(szTemp, L"/PRIVMSG %s \001%s %u\001", one.c_str(), two.c_str(), time(0));
else
- mir_sntprintf(szTemp, _T("/PRIVMSG %s \001%s\001"), one.c_str(), GetWordAddress(text.c_str(), 2));
+ mir_sntprintf(szTemp, L"/PRIVMSG %s \001%s\001", one.c_str(), GetWordAddress(text.c_str(), 2));
PostIrcMessageWnd(window, hContact, szTemp);
}
- if (mir_tstrcmpi(two.c_str(), _T("dcc")) != 0) {
+ if (mir_tstrcmpi(two.c_str(), L"dcc") != 0) {
mir_sntprintf(szTemp, TranslateT("CTCP %s request sent to %s"), two.c_str(), one.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
@@ -607,11 +607,11 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
return true;
}
- if (command == _T("/dcc")) {
+ if (command == L"/dcc") {
if (one.IsEmpty() || two.IsEmpty())
return true;
- if (mir_tstrcmpi(one.c_str(), _T("send")) == 0) {
+ if (mir_tstrcmpi(one.c_str(), L"send") == 0) {
TCHAR szTemp[1000];
unsigned long ulAdr = 0;
@@ -627,10 +627,10 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
CMString s;
if (getByte(ccNew, "AdvancedMode", 0) == 0)
- DoUserhostWithReason(1, (_T("S") + two).c_str(), true, two.c_str());
+ DoUserhostWithReason(1, (L"S" + two).c_str(), true, two.c_str());
else {
DBVARIANT dbv1;
- CMString S = _T("S");
+ CMString S = L"S";
if (!getTString(ccNew, "UWildcard", &dbv1)) {
S += dbv1.ptszVal;
DoUserhostWithReason(2, S.c_str(), true, dbv1.ptszVal);
@@ -661,7 +661,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
return true;
}
- if (mir_tstrcmpi(one.c_str(), _T("chat")) == 0) {
+ if (mir_tstrcmpi(one.c_str(), L"chat") == 0) {
TCHAR szTemp[1000];
unsigned long ulAdr = 0;
@@ -693,7 +693,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hConta
}
if (iPort != 0) {
- PostIrcMessage(_T("/CTCP %s DCC CHAT chat %u %u"), two.c_str(), ulAdr, iPort);
+ PostIrcMessage(L"/CTCP %s DCC CHAT chat %u %u", two.c_str(), ulAdr, iPort);
mir_sntprintf(szTemp, TranslateT("DCC CHAT request sent to %s"), two.c_str(), one.c_str());
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
@@ -735,7 +735,7 @@ static void __stdcall DoInputRequestAliasApcStub(void* _par)
TCHAR* title = NULL;
TCHAR* defaulttext = NULL;
CMString command = (TCHAR*)str;
- TCHAR* p = _tcsstr((TCHAR*)str, _T("%question"));
+ TCHAR* p = _tcsstr((TCHAR*)str, L"%question");
if (p[9] == '=' && p[10] == '\"') {
infotext = &p[11];
p = _tcschr(infotext, '\"');
@@ -833,12 +833,12 @@ bool CIrcProto::PostIrcMessageWnd(TCHAR *window, MCONTACT hContact, const TCHAR
if (!hContact && IsConnected()) {
Message = DoAlias(Message.c_str(), windowname);
- if (Message.Find(_T("%question")) != -1) {
+ if (Message.Find(L"%question") != -1) {
CallFunctionAsync(DoInputRequestAliasApcStub, new DoInputRequestParam(this, Message));
return 1;
}
- Message.Replace(_T("%newl"), _T("\r\n"));
+ Message.Replace(L"%newl", L"\r\n");
RemoveLinebreaks(Message);
}
@@ -852,8 +852,8 @@ bool CIrcProto::PostIrcMessageWnd(TCHAR *window, MCONTACT hContact, const TCHAR
while (!Message.IsEmpty()) {
// split the text into lines, and do an automatic textsplit on long lies as well
bool flag = false;
- CMString DoThis = _T("");
- int index = Message.Find(_T("\r\n"), 0);
+ CMString DoThis = L"";
+ int index = Message.Find(L"\r\n", 0);
if (index == -1)
index = Message.GetLength();
@@ -861,11 +861,11 @@ bool CIrcProto::PostIrcMessageWnd(TCHAR *window, MCONTACT hContact, const TCHAR
index = 432;
DoThis = Message.Mid(0, index);
Message.Delete(0, index);
- if (Message.Find(_T("\r\n"), 0) == 0)
+ if (Message.Find(L"\r\n", 0) == 0)
Message.Delete(0, 2);
//do this if it's a /raw
- if (IsConnected() && (GetWord(DoThis.c_str(), 0) == _T("/raw") || GetWord(DoThis.c_str(), 0) == _T("/quote"))) {
+ if (IsConnected() && (GetWord(DoThis.c_str(), 0) == L"/raw" || GetWord(DoThis.c_str(), 0) == L"/quote")) {
if (GetWord(DoThis.c_str(), 1).IsEmpty())
continue;
@@ -878,11 +878,11 @@ bool CIrcProto::PostIrcMessageWnd(TCHAR *window, MCONTACT hContact, const TCHAR
if ((GetWord(DoThis.c_str(), 0)[0] != '/') || // not a command
((GetWord(DoThis.c_str(), 0)[0] == '/') && (GetWord(DoThis.c_str(), 0)[1] == '/')) || // or double backslash at the beginning
hContact) {
- CMString S = _T("/PRIVMSG ");
+ CMString S = L"/PRIVMSG ";
if (mir_tstrcmpi(window, SERVERWINDOW) == 0 && !m_info.sServerName.IsEmpty())
- S += m_info.sServerName + _T(" ") + DoThis;
+ S += m_info.sServerName + L" " + DoThis;
else
- S += CMString(windowname) + _T(" ") + DoThis;
+ S += CMString(windowname) + L" " + DoThis;
DoThis = S;
flag = true;
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp
index 8d462b3a17..bac5fd2d2b 100644
--- a/protocols/IRCG/src/irclib.cpp
+++ b/protocols/IRCG/src/irclib.cpp
@@ -68,7 +68,7 @@ CIrcMessage::~CIrcMessage()
void CIrcMessage::Reset()
{
- prefix.sNick = prefix.sUser = prefix.sHost = sCommand = _T("");
+ prefix.sNick = prefix.sUser = prefix.sHost = sCommand = L"";
m_bIncoming = false;
m_bNotify = true;
@@ -105,13 +105,13 @@ void CIrcMessage::ParseIrcCommand(const TCHAR* lpszCmdLine)
if (*p1 == ':') {
// break prefix into its components (nick!user@host)
p2 = ++p1;
- while (*p2 && !_tcschr(_T(" !"), *p2))
+ while (*p2 && !_tcschr(L" !", *p2))
++p2;
prefix.sNick.SetString(p1, p2 - p1);
if (*p2 != '!')
goto end_of_prefix;
p1 = ++p2;
- while (*p2 && !_tcschr(_T(" @"), *p2))
+ while (*p2 && !_tcschr(L" @", *p2))
++p2;
prefix.sUser.SetString(p1, p2 - p1);
if (*p2 != '@')
@@ -184,7 +184,7 @@ void CIrcProto::SendIrcMessage(const TCHAR* msg, bool bNotify, int cp)
if (bNotify) {
CIrcMessage ircMsg(this, msg, cp);
- if (!ircMsg.sCommand.IsEmpty() && ircMsg.sCommand != _T("QUIT"))
+ if (!ircMsg.sCommand.IsEmpty() && ircMsg.sCommand != L"QUIT")
Notify(&ircMsg);
}
}
@@ -201,7 +201,7 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info)
con = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&ncon);
if (con == NULL) {
TCHAR szTemp[300];
- mir_sntprintf(szTemp, _T("\0035%s \002%s\002 (%S: %u)."),
+ mir_sntprintf(szTemp, L"\0035%s \002%s\002 (%S: %u).",
TranslateT("Failed to connect to"), si.sNetwork.c_str(), si.sServer.c_str(), si.iPort);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
return false;
@@ -230,7 +230,7 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info)
Sleep(100);
if (info.sPassword.GetLength())
NLSend("PASS %s\r\n", info.sPassword.c_str());
- NLSend(_T("NICK %s\r\n"), info.sNick.c_str());
+ NLSend(L"NICK %s\r\n", info.sNick.c_str());
CMString userID = GetWord(info.sUserID.c_str(), 0);
TCHAR szHostName[MAX_PATH];
@@ -238,10 +238,10 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info)
GetComputerName(szHostName, &cbHostName);
CMString HostName = GetWord(szHostName, 0);
if (userID.IsEmpty())
- userID = _T("Miranda");
+ userID = L"Miranda";
if (HostName.IsEmpty())
- HostName = _T("host");
- NLSend(_T("USER %s %s %s :%s\r\n"), userID.c_str(), HostName.c_str(), _T("server"), info.sFullName.c_str());
+ HostName = L"host";
+ NLSend(L"USER %s %s %s :%s\r\n", userID.c_str(), HostName.c_str(), L"server", info.sFullName.c_str());
return con != NULL;
}
@@ -256,7 +256,7 @@ void CIrcProto::Disconnect(void)
KillIdent();
if (m_quitMessage[0])
- NLSend(_T("QUIT :%s\r\n"), m_quitMessage);
+ NLSend(L"QUIT :%s\r\n", m_quitMessage);
else
NLSend("QUIT \r\n");
@@ -635,18 +635,18 @@ CIrcSessionInfo::CIrcSessionInfo(const CIrcSessionInfo& si) :
void CIrcSessionInfo::Reset()
{
sServer = "";
- sServerName = _T("");
+ sServerName = L"";
iPort = 0;
- sNick = _T("");
- sUserID = _T("");
- sFullName = _T("");
+ sNick = L"";
+ sUserID = L"";
+ sFullName = L"";
sPassword = "";
bIdentServer = false;
bNickFlag = false;
m_iSSL = 0;
- sIdentServerType = _T("");
+ sIdentServerType = L"";
iIdentServerPort = 0;
- sNetwork = _T("");
+ sNetwork = L"";
}
////////////////////////////////////////////////////////////////////
@@ -978,8 +978,8 @@ int CDccSession::SetupConnection()
// if spaces in the filename surround with quotes
if (sFileWithQuotes.Find(' ', 0) != -1) {
- sFileWithQuotes.Insert(0, _T("\""));
- sFileWithQuotes.Insert(sFileWithQuotes.GetLength(), _T("\""));
+ sFileWithQuotes.Insert(0, L"\"");
+ sFileWithQuotes.Insert(sFileWithQuotes.GetLength(), L"\"");
}
// send out DCC RECV command for passive filetransfers
@@ -990,7 +990,7 @@ int CDccSession::SetupConnection()
ulAdr = m_proto->m_IPFromServer ? ConvertIPToInteger(m_proto->m_myHost) : nb.dwExternalIP;
if (di->iPort && ulAdr)
- m_proto->PostIrcMessage(_T("/CTCP %s DCC SEND %s %u %u %I64u %s"), di->sContactName.c_str(), sFileWithQuotes.c_str(), ulAdr, di->iPort, di->dwSize, di->sToken.c_str());
+ m_proto->PostIrcMessage(L"/CTCP %s DCC SEND %s %u %u %I64u %s", di->sContactName.c_str(), sFileWithQuotes.c_str(), ulAdr, di->iPort, di->dwSize, di->sToken.c_str());
return TRUE;
}
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index 4e5c156334..eaa7f8541b 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -219,7 +219,7 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
CallChatEvent(WINDOW_HIDDEN, (LPARAM)&gce);
TCHAR szTemp[MAX_PATH];
- mir_sntprintf(szTemp, _T("%%miranda_path%%\\Plugins\\%S_perform.ini"), m_szModuleName);
+ mir_sntprintf(szTemp, L"%%miranda_path%%\\Plugins\\%S_perform.ini", m_szModuleName);
TCHAR *szLoadFileName = Utils_ReplaceVarsT(szTemp);
char* pszPerformData = IrcLoadFile(szLoadFileName);
if (pszPerformData != NULL) {
@@ -274,13 +274,13 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
if (m_nick[0]) {
TCHAR szBuf[40];
if (mir_tstrlen(m_alternativeNick) == 0) {
- mir_sntprintf(szBuf, _T("%s%u"), m_nick, rand() % 9999);
+ mir_sntprintf(szBuf, L"%s%u", m_nick, rand() % 9999);
setTString("AlernativeNick", szBuf);
mir_tstrncpy(m_alternativeNick, szBuf, 30);
}
if (mir_tstrlen(m_name) == 0) {
- mir_sntprintf(szBuf, _T("Miranda%u"), rand() % 9999);
+ mir_sntprintf(szBuf, L"Miranda%u", rand() % 9999);
setTString("Name", szBuf);
mir_tstrncpy(m_name, szBuf, 200);
}
@@ -305,7 +305,7 @@ MCONTACT __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr)
if (hContact) {
DBVARIANT dbv1;
- CMString S = _T("S");
+ CMString S = L"S";
if (getByte(hContact, "AdvancedMode", 0) == 0) {
S += user.name;
@@ -323,7 +323,7 @@ MCONTACT __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr)
}
}
if (getByte("MirVerAutoRequest", 1))
- PostIrcMessage(_T("/PRIVMSG %s \001VERSION\001"), user.name);
+ PostIrcMessage(L"/PRIVMSG %s \001VERSION\001", user.name);
}
mir_free(id);
@@ -421,14 +421,14 @@ int __cdecl CIrcProto::FileResume(HANDLE hTransfer, int* action, const TCHAR** s
// if spaces in the filename surround witrh quotes
if (sFileWithQuotes.Find(' ', 0) != -1) {
- sFileWithQuotes.Insert(0, _T("\""));
- sFileWithQuotes.Insert(sFileWithQuotes.GetLength(), _T("\""));
+ sFileWithQuotes.Insert(0, L"\"");
+ sFileWithQuotes.Insert(sFileWithQuotes.GetLength(), L"\"");
}
if (di->bReverse)
- PostIrcMessage(_T("/PRIVMSG %s \001DCC RESUME %s 0 %I64u %s\001"), di->sContactName.c_str(), sFileWithQuotes.c_str(), dwPos, dcc->di->sToken.c_str());
+ PostIrcMessage(L"/PRIVMSG %s \001DCC RESUME %s 0 %I64u %s\001", di->sContactName.c_str(), sFileWithQuotes.c_str(), dwPos, dcc->di->sToken.c_str());
else
- PostIrcMessage(_T("/PRIVMSG %s \001DCC RESUME %s %u %I64u\001"), di->sContactName.c_str(), sFileWithQuotes.c_str(), di->iPort, dwPos);
+ PostIrcMessage(L"/PRIVMSG %s \001DCC RESUME %s %u %I64u\001", di->sContactName.c_str(), sFileWithQuotes.c_str(), di->iPort, dwPos);
return 0;
}
@@ -565,8 +565,8 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz
// if spaces in the filename surround witrh quotes
if (sFileWithQuotes.Find(' ', 0) != -1) {
- sFileWithQuotes.Insert(0, _T("\""));
- sFileWithQuotes.Insert(sFileWithQuotes.GetLength(), _T("\""));
+ sFileWithQuotes.Insert(0, L"\"");
+ sFileWithQuotes.Insert(sFileWithQuotes.GetLength(), L"\"");
}
dci->hContact = hContact;
@@ -584,12 +584,12 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz
// need to make sure that %'s are doubled to avoid having chat interpret as color codes
CMString sFileCorrect = dci->sFile;
- sFileCorrect.Replace(_T("%"), _T("%%"));
+ sFileCorrect.Replace(L"%", L"%%");
// is it an reverse filetransfer (receiver acts as server)
if (dci->bReverse) {
TCHAR szTemp[256];
- PostIrcMessage(_T("/CTCP %s DCC SEND %s 200 0 %I64u %u"),
+ PostIrcMessage(L"/CTCP %s DCC SEND %s 200 0 %I64u %u",
dci->sContactName.c_str(), sFileWithQuotes.c_str(), dci->dwSize, dcc->iToken);
mir_sntprintf(szTemp,
@@ -599,7 +599,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz
if (m_sendNotice) {
mir_sntprintf(szTemp,
- _T("/NOTICE %s I am sending the file '\002%s\002' (%I64u kB) to you, please accept it. [Reverse transfer]"),
+ L"/NOTICE %s I am sending the file '\002%s\002' (%I64u kB) to you, please accept it. [Reverse transfer]",
dci->sContactName.c_str(), sFileCorrect.c_str(), dci->dwSize / 1024);
PostIrcMessage(szTemp);
}
@@ -608,7 +608,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz
iPort = dcc->Connect();
if (iPort) {
TCHAR szTemp[256];
- PostIrcMessage(_T("/CTCP %s DCC SEND %s %u %u %I64u"),
+ PostIrcMessage(L"/CTCP %s DCC SEND %s %u %u %I64u",
dci->sContactName.c_str(), sFileWithQuotes.c_str(), ulAdr, iPort, dci->dwSize);
mir_sntprintf(szTemp,
@@ -618,7 +618,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz
if (m_sendNotice) {
mir_sntprintf(szTemp,
- _T("/NOTICE %s I am sending the file '\002%s\002' (%I64u kB) to you, please accept it. [IP: %s]"),
+ L"/NOTICE %s I am sending the file '\002%s\002' (%I64u kB) to you, please accept it. [IP: %s]",
dci->sContactName.c_str(), sFileCorrect.c_str(), dci->dwSize / 1024, (TCHAR*)_A2T(ConvertIntegerToIP(ulAdr)));
PostIrcMessage(szTemp);
}
@@ -631,7 +631,7 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz
index++;
while (ppszFiles[index]) {
if (_taccess(ppszFiles[index], 0) == 0) {
- PostIrcMessage(_T("/DCC SEND %s %S"), dci->sContactName.c_str(), ppszFiles[index]);
+ PostIrcMessage(L"/DCC SEND %s %S", dci->sContactName.c_str(), ppszFiles[index]);
}
index++;
}
@@ -753,8 +753,8 @@ int CIrcProto::SetStatusInternal(int iNewStatus, bool bIsInternal)
}
else if ((iNewStatus == ID_STATUS_ONLINE || iNewStatus == ID_STATUS_FREECHAT) && IsConnected() && m_iStatus == ID_STATUS_AWAY) //go to online while connected
{
- m_statusMessage = _T("");
- PostIrcMessage(_T("/AWAY"));
+ m_statusMessage = L"";
+ PostIrcMessage(L"/AWAY");
return 0;
}
else if (iNewStatus == ID_STATUS_OFFLINE && IsConnected()) //go from online/away to offline
@@ -765,7 +765,7 @@ int CIrcProto::SetStatusInternal(int iNewStatus, bool bIsInternal)
}
else if (iNewStatus == ID_STATUS_AWAY && IsConnected()) //go to away while connected
{
- PostIrcMessage(_T("/AWAY %s"), m_statusMessage.Mid(0, 450));
+ PostIrcMessage(L"/AWAY %s", m_statusMessage.Mid(0, 450));
return 0;
}
else if (iNewStatus == ID_STATUS_ONLINE && IsConnected()) //already online
@@ -781,7 +781,7 @@ int CIrcProto::SetStatusInternal(int iNewStatus, bool bIsInternal)
HANDLE __cdecl CIrcProto::GetAwayMsg(MCONTACT hContact)
{
- WhoisAwayReply = _T("");
+ WhoisAwayReply = L"";
DBVARIANT dbv;
// bypass chat contacts.
@@ -792,7 +792,7 @@ HANDLE __cdecl CIrcProto::GetAwayMsg(MCONTACT hContact)
db_free(&dbv);
return 0;
}
- CMString S = _T("WHOIS ");
+ CMString S = L"WHOIS ";
S += dbv.ptszVal;
if (IsConnected())
SendIrcMessage(S.c_str(), false);
@@ -815,7 +815,7 @@ int __cdecl CIrcProto::SetAwayMsg(int status, const TCHAR* msg)
default:
CMString newStatus = msg;
- newStatus.Replace(_T("\r\n"), _T(" "));
+ newStatus.Replace(L"\r\n", L" ");
if (m_statusMessage.IsEmpty() || msg == NULL || m_statusMessage != newStatus) {
if (msg == NULL || *msg == 0)
m_statusMessage = STR_AWAYMESSAGE;
@@ -823,7 +823,7 @@ int __cdecl CIrcProto::SetAwayMsg(int status, const TCHAR* msg)
m_statusMessage = newStatus;
if (m_iStatus == ID_STATUS_AWAY)
- PostIrcMessage(_T("/AWAY %s"), m_statusMessage.Mid(0, 450));
+ PostIrcMessage(L"/AWAY %s", m_statusMessage.Mid(0, 450));
}
}
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index 7d13696798..608cd844bb 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -828,10 +828,10 @@ void CCtcpPrefsDlg::OnInitDialog()
m_combo.AddStringA("8192");
TCHAR szTemp[10];
- mir_sntprintf(szTemp, _T("%u"), m_proto->m_DCCPacketSize);
+ mir_sntprintf(szTemp, L"%u", m_proto->m_DCCPacketSize);
int i = m_combo.SelectString(szTemp);
if (i == CB_ERR)
- m_combo.SelectString(_T("4096"));
+ m_combo.SelectString(L"4096");
if (m_proto->m_DCCChatAccept == 1)
m_radio1.SetState(true);
@@ -849,14 +849,14 @@ void CCtcpPrefsDlg::OnInitDialog()
else {
if (m_proto->m_IPFromServer) {
if (m_proto->m_myHost[0]) {
- CMString s = (CMString)TranslateT("<Resolved IP: ") + (TCHAR*)_A2T(m_proto->m_myHost) + _T(">");
+ CMString s = (CMString)TranslateT("<Resolved IP: ") + (TCHAR*)_A2T(m_proto->m_myHost) + L">";
m_ip.SetText(s.c_str());
}
else m_ip.SetText(TranslateT("<Automatic>"));
}
else {
if (m_proto->m_myLocalHost[0]) {
- CMString s = (CMString)TranslateT("<Local IP: ") + (TCHAR*)_A2T(m_proto->m_myLocalHost) + _T(">");
+ CMString s = (CMString)TranslateT("<Local IP: ") + (TCHAR*)_A2T(m_proto->m_myLocalHost) + L">";
m_ip.SetText(s.c_str());
}
else m_ip.SetText(TranslateT("<Automatic>"));
@@ -874,14 +874,14 @@ void CCtcpPrefsDlg::OnClicked(CCtrlData*)
else {
if (m_fromServer.GetState()) {
if (m_proto->m_myHost[0]) {
- CMString s = (CMString)TranslateT("<Resolved IP: ") + (TCHAR*)_A2T(m_proto->m_myHost) + _T(">");
+ CMString s = (CMString)TranslateT("<Resolved IP: ") + (TCHAR*)_A2T(m_proto->m_myHost) + L">";
m_ip.SetText(s.c_str());
}
else m_ip.SetText(TranslateT("<Automatic>"));
}
else {
if (m_proto->m_myLocalHost[0]) {
- CMString s = (CMString)TranslateT("<Local IP: ") + (TCHAR*)_A2T(m_proto->m_myLocalHost) + _T(">");
+ CMString s = (CMString)TranslateT("<Local IP: ") + (TCHAR*)_A2T(m_proto->m_myLocalHost) + L">";
m_ip.SetText(s.c_str());
}
else m_ip.SetText(TranslateT("<Automatic>"));
@@ -1091,7 +1091,7 @@ void COtherPrefsDlg::OnAdd(CCtrlButton*)
{
TCHAR* temp = m_pertormEdit.GetText();
- if (my_strstri(temp, _T("/away")))
+ if (my_strstri(temp, L"/away"))
MessageBox(NULL, TranslateT("The usage of /AWAY in your perform buffer is restricted\n as IRC sends this command automatically."), TranslateT("IRC Error"), MB_OK);
else {
int i = m_performCombo.GetCurSel();
@@ -1113,7 +1113,7 @@ void COtherPrefsDlg::OnDelete(CCtrlButton*)
if (i != CB_ERR) {
PERFORM_INFO* pPerf = (PERFORM_INFO*)m_performCombo.GetItemData(i);
if (pPerf != NULL) {
- pPerf->mText = _T("");
+ pPerf->mText = L"";
m_pertormEdit.SetTextA("");
m_delete.Disable();
m_add.Disable();
@@ -1179,7 +1179,7 @@ void COtherPrefsDlg::addPerformComboValue(int idx, const char* szValueName)
pPref = new PERFORM_INFO(sSetting.c_str(), dbv.ptszVal);
db_free(&dbv);
}
- else pPref = new PERFORM_INFO(sSetting.c_str(), _T(""));
+ else pPref = new PERFORM_INFO(sSetting.c_str(), L"");
m_performCombo.SetItemData(idx, (LPARAM)pPref);
}
@@ -1232,7 +1232,7 @@ void CAddIgnoreDlg::OnOk(CCtrlButton*)
CMString Mask = GetWord(szMask, 0);
if (Mask.GetLength() != 0) {
if (!_tcschr(Mask.c_str(), '!') && !_tcschr(Mask.c_str(), '@'))
- Mask += _T("!*@*");
+ Mask += L"!*@*";
if (!flags.IsEmpty()) {
if (*szOldMask)
@@ -1316,7 +1316,7 @@ static LRESULT CALLBACK ListviewSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
void CIrcProto::InitIgnore(void)
{
TCHAR szTemp[MAX_PATH];
- mir_sntprintf(szTemp, _T("%%miranda_path%%\\Plugins\\%S_ignore.ini"), m_szModuleName);
+ mir_sntprintf(szTemp, L"%%miranda_path%%\\Plugins\\%S_ignore.ini", m_szModuleName);
TCHAR *szLoadFileName = Utils_ReplaceVarsT(szTemp);
char* pszIgnoreData = IrcLoadFile(szLoadFileName);
if (pszIgnoreData != NULL) {
@@ -1383,7 +1383,7 @@ void CIrcProto::RewriteIgnoreSettings(void)
mir_snprintf(settingName, "IGNORE:%d", i);
CIrcIgnoreItem& C = m_ignoreItems[i];
- setTString(settingName, (C.mask + _T(" ") + C.flags + _T(" ") + C.network).c_str());
+ setTString(settingName, (C.mask + L" " + C.flags + L" " + C.network).c_str());
}
}
@@ -1662,11 +1662,11 @@ int CIrcProto::OnInitOptionsPages(WPARAM wParam, LPARAM)
void CIrcProto::InitPrefs(void)
{
- ConnectSettings[0].defStr = _T("Miranda");
- ConnectSettings[1].defStr = _T("UNIX");
- ConnectSettings[2].defStr = _T("113");
- ConnectSettings[3].defStr = _T("30");
- ConnectSettings[4].defStr = _T("10");
+ ConnectSettings[0].defStr = L"Miranda";
+ ConnectSettings[1].defStr = L"UNIX";
+ ConnectSettings[2].defStr = L"113";
+ ConnectSettings[3].defStr = L"30";
+ ConnectSettings[4].defStr = L"10";
CtcpSettings[0].defStr = STR_USERINFO;
@@ -1701,7 +1701,7 @@ void CIrcProto::InitPrefs(void)
m_mySpecifiedHostIP[0] = 0;
if (m_alias == NULL)
- m_alias = mir_tstrdup(_T("/op /mode ## +ooo $1 $2 $3\r\n/dop /mode ## -ooo $1 $2 $3\r\n/voice /mode ## +vvv $1 $2 $3\r\n/dvoice /mode ## -vvv $1 $2 $3\r\n/j /join #$1 $2-\r\n/p /part ## $1-\r\n/w /whois $1\r\n/k /kick ## $1 $2-\r\n/q /query $1\r\n/logon /log on ##\r\n/logoff /log off ##\r\n/save /log buffer $1\r\n/slap /me slaps $1 around a bit with a large trout"));
+ m_alias = mir_tstrdup(L"/op /mode ## +ooo $1 $2 $3\r\n/dop /mode ## -ooo $1 $2 $3\r\n/voice /mode ## +vvv $1 $2 $3\r\n/dvoice /mode ## -vvv $1 $2 $3\r\n/j /join #$1 $2-\r\n/p /part ## $1-\r\n/w /whois $1\r\n/k /kick ## $1 $2-\r\n/q /query $1\r\n/logon /log on ##\r\n/logoff /log off ##\r\n/save /log buffer $1\r\n/slap /me slaps $1 around a bit with a large trout");
m_quickComboSelection = getDword("QuickComboSelection", m_serverComboSelection + 1);
m_myHost[0] = '\0';
@@ -1821,7 +1821,7 @@ INT_PTR CIrcProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
static void sttImportIni(const TCHAR* szIniFile)
{
- FILE* serverFile = _tfopen(szIniFile, _T("r"));
+ FILE* serverFile = _tfopen(szIniFile, L"r");
if (serverFile == NULL)
return;
@@ -1847,17 +1847,17 @@ static void sttImportIni(const TCHAR* szIniFile)
void InitServers()
{
- TCHAR *szTemp = Utils_ReplaceVarsT(_T("%miranda_path%\\Plugins\\IRC_servers.ini"));
+ TCHAR *szTemp = Utils_ReplaceVarsT(L"%miranda_path%\\Plugins\\IRC_servers.ini");
sttImportIni(szTemp);
mir_free(szTemp);
RereadServers();
if (g_servers.getCount() == 0) {
- TCHAR *szIniFile = Utils_ReplaceVarsT(_T("%temp%\\default_servers.ini"));
- FILE *serverFile = _tfopen(szIniFile, _T("a"));
+ TCHAR *szIniFile = Utils_ReplaceVarsT(L"%temp%\\default_servers.ini");
+ FILE *serverFile = _tfopen(szIniFile, L"a");
if (serverFile) {
- char* pszSvrs = (char*)LockResource(LoadResource(hInst, FindResource(hInst, MAKEINTRESOURCE(IDR_SERVERS), _T("TEXT"))));
+ char* pszSvrs = (char*)LockResource(LoadResource(hInst, FindResource(hInst, MAKEINTRESOURCE(IDR_SERVERS), L"TEXT")));
if (pszSvrs)
fwrite(pszSvrs, 1, mir_strlen(pszSvrs) + 1, serverFile);
fclose(serverFile);
diff --git a/protocols/IRCG/src/output.cpp b/protocols/IRCG/src/output.cpp
index c86d78fb61..8ff9d2a7b8 100644
--- a/protocols/IRCG/src/output.cpp
+++ b/protocols/IRCG/src/output.cpp
@@ -26,26 +26,26 @@ static CMString FormatOutput(const CIrcMessage* pmsg)
CMString sMessage;
if (pmsg->m_bIncoming) { // Is it an incoming message?
- if (pmsg->sCommand == _T("WALLOPS") && pmsg->parameters.getCount() > 0) {
+ if (pmsg->sCommand == L"WALLOPS" && pmsg->parameters.getCount() > 0) {
TCHAR temp[200]; *temp = '\0';
mir_sntprintf(temp, TranslateT("WallOps from %s: "), pmsg->prefix.sNick.c_str());
sMessage = temp;
for (int i = 0; i < (int)pmsg->parameters.getCount(); i++) {
sMessage += pmsg->parameters[i];
if (i != pmsg->parameters.getCount() - 1)
- sMessage += _T(" ");
+ sMessage += L" ";
}
goto THE_END;
}
- if (pmsg->sCommand == _T("INVITE") && pmsg->parameters.getCount() > 1) {
+ if (pmsg->sCommand == L"INVITE" && pmsg->parameters.getCount() > 1) {
TCHAR temp[256]; *temp = '\0';
mir_sntprintf(temp, TranslateT("%s invites you to %s"), pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
sMessage = temp;
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++) {
- sMessage += _T(": ") + pmsg->parameters[i];
+ sMessage += L": " + pmsg->parameters[i];
if (i != pmsg->parameters.getCount() - 1)
- sMessage += _T(" ");
+ sMessage += L" ";
}
goto THE_END;
}
@@ -56,30 +56,30 @@ static CMString FormatOutput(const CIrcMessage* pmsg)
mir_sntprintf(temp, TranslateT("%s is away"), pmsg->parameters[1].c_str());
sMessage = temp;
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++) {
- sMessage += _T(": ") + pmsg->parameters[i];
+ sMessage += L": " + pmsg->parameters[i];
if (i != pmsg->parameters.getCount() - 1)
- sMessage += _T(" ");
+ sMessage += L" ";
}
goto THE_END;
}
if ((index == 443 || index == 441) && pmsg->parameters.getCount() > 3)
- return pmsg->parameters[1] + _T(" ") + pmsg->parameters[3] + _T(": ") + pmsg->parameters[2];
+ return pmsg->parameters[1] + L" " + pmsg->parameters[3] + L": " + pmsg->parameters[2];
if (index == 303) { // ISON command
sMessage = TranslateT("These are online: ");
for (int i = 1; i < (int)pmsg->parameters.getCount(); i++) {
sMessage += pmsg->parameters[i];
if (i != pmsg->parameters.getCount() - 1)
- sMessage += _T(", ");
+ sMessage += L", ";
}
goto THE_END;
}
if ((index > 400 || index < 500) && pmsg->parameters.getCount() > 2 && pmsg->sCommand[0] == '4') //all error messages
- return pmsg->parameters[2] + _T(": ") + pmsg->parameters[1];
+ return pmsg->parameters[2] + L": " + pmsg->parameters[1];
}
- else if (pmsg->sCommand == _T("NOTICE") && pmsg->parameters.getCount() > 1) {
+ else if (pmsg->sCommand == L"NOTICE" && pmsg->parameters.getCount() > 1) {
TCHAR temp[500]; *temp = '\0';
int l = pmsg->parameters[1].GetLength();
@@ -89,7 +89,7 @@ static CMString FormatOutput(const CIrcMessage* pmsg)
tempstr.Delete(0, 1);
tempstr.Delete(tempstr.GetLength() - 1, 1);
CMString type = GetWord(tempstr.c_str(), 0);
- if (mir_tstrcmpi(type.c_str(), _T("ping")) == 0)
+ if (mir_tstrcmpi(type.c_str(), L"ping") == 0)
mir_sntprintf(temp, TranslateT("CTCP %s reply sent to %s"), type.c_str(), pmsg->parameters[0].c_str());
else
mir_sntprintf(temp, TranslateT("CTCP %s reply sent to %s: %s"), type.c_str(), pmsg->parameters[0].c_str(), GetWordAddress(tempstr.c_str(), 1));
@@ -101,7 +101,7 @@ static CMString FormatOutput(const CIrcMessage* pmsg)
for (int i = 1; i < (int)pmsg->parameters.getCount(); i++) {
sMessage += pmsg->parameters[i];
if (i != pmsg->parameters.getCount() - 1)
- sMessage += _T(" ");
+ sMessage += L" ";
}
}
goto THE_END;
@@ -111,18 +111,18 @@ static CMString FormatOutput(const CIrcMessage* pmsg)
if (pmsg->m_bIncoming) {
if (pmsg->parameters.getCount() < 2 && pmsg->parameters.getCount() > 0)
- return pmsg->sCommand + _T(" : ") + pmsg->parameters[0];
+ return pmsg->sCommand + L" : " + pmsg->parameters[0];
if (pmsg->parameters.getCount() > 1)
for (int i = 1; i < (int)pmsg->parameters.getCount(); i++)
- sMessage += pmsg->parameters[i] + _T(" ");
+ sMessage += pmsg->parameters[i] + L" ";
}
else {
if (pmsg->prefix.sNick.GetLength())
- sMessage = pmsg->prefix.sNick + _T(" ");
- sMessage += pmsg->sCommand + _T(" ");
+ sMessage = pmsg->prefix.sNick + L" ";
+ sMessage += pmsg->sCommand + L" ";
for (int i = 0; i < (int)pmsg->parameters.getCount(); i++)
- sMessage += pmsg->parameters[i] + _T(" ");
+ sMessage += pmsg->parameters[i] + L" ";
}
THE_END:
@@ -134,16 +134,16 @@ BOOL CIrcProto::ShowMessage(const CIrcMessage* pmsg)
CMString mess = FormatOutput(pmsg);
if (!pmsg->m_bIncoming)
- mess.Replace(_T("%%"), _T("%"));
+ mess.Replace(L"%%", L"%");
int iTemp = _ttoi(pmsg->sCommand.c_str());
//To active window
if ((iTemp > 400 || iTemp < 500) && pmsg->sCommand[0] == '4' //all error messages
- || pmsg->sCommand == _T("303") //ISON command
- || pmsg->sCommand == _T("INVITE")
- || ((pmsg->sCommand == _T("NOTICE")) && ((pmsg->parameters.getCount() > 2) ? (_tcsstr(pmsg->parameters[1].c_str(), _T("\001")) == NULL) : false)) // CTCP answers should go to m_network Log window!
- || pmsg->sCommand == _T("515")) //chanserv error
+ || pmsg->sCommand == L"303" //ISON command
+ || pmsg->sCommand == L"INVITE"
+ || ((pmsg->sCommand == L"NOTICE") && ((pmsg->parameters.getCount() > 2) ? (_tcsstr(pmsg->parameters[1].c_str(), L"\001") == NULL) : false)) // CTCP answers should go to m_network Log window!
+ || pmsg->sCommand == L"515") //chanserv error
{
DoEvent(GC_EVENT_INFORMATION, NULL, pmsg->m_bIncoming ? pmsg->prefix.sNick.c_str() : m_info.sNick.c_str(), mess.c_str(), NULL, NULL, NULL, true, pmsg->m_bIncoming ? false : true);
return TRUE;
diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp
index b8cd6b6e7b..ef968fb631 100644
--- a/protocols/IRCG/src/scripting.cpp
+++ b/protocols/IRCG/src/scripting.cpp
@@ -149,7 +149,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam)
gci.pszID = S.c_str();
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci)) {
TCHAR szTemp[40];
- mir_sntprintf(szTemp, _T("%u"), gci.iCount);
+ mir_sntprintf(szTemp, L"%u", gci.iCount);
sOutput = szTemp;
}
}
@@ -163,7 +163,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam)
return (INT_PTR)mir_strdup(gci.pszUsers);
}
else if (sRequest == "channellist") {
- CMString S = _T("");
+ CMString S = L"";
int n = CallServiceSync(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)m_szModuleName);
if (n >= 0) {
int j = 0;
@@ -175,10 +175,10 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam)
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci)) {
if (mir_tstrcmpi(gci.pszID, SERVERWINDOW)) {
CMString S1 = gci.pszID;
- int k = S1.Find(_T(" "));
+ int k = S1.Find(L" ");
if (k != -1)
S1 = S1.Mid(0, k);
- S += S1 + _T(" ");
+ S += S1 + L" ";
}
}
j++;
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp
index d147b48b2e..559e3bf29d 100644
--- a/protocols/IRCG/src/services.cpp
+++ b/protocols/IRCG/src/services.cpp
@@ -201,7 +201,7 @@ int __cdecl CIrcProto::OnContactDeleted(WPARAM wp, LPARAM)
if (!getTString(hContact, "Nick", &dbv)) {
int type = getByte(hContact, "ChatRoom", 0);
if (type != 0) {
- CMString S = _T("");
+ CMString S = L"";
if (type == GCW_CHATROOM)
S = MakeWndID(dbv.ptszVal);
if (type == GCW_SERVER)
@@ -210,7 +210,7 @@ int __cdecl CIrcProto::OnContactDeleted(WPARAM wp, LPARAM)
GCEVENT gce = { sizeof(gce), &gcd };
int i = CallChatEvent(SESSION_TERMINATE, (LPARAM)&gce);
if (i && type == GCW_CHATROOM)
- PostIrcMessage(_T("/PART %s %s"), dbv.ptszVal, m_userInfo);
+ PostIrcMessage(L"/PART %s %s", dbv.ptszVal, m_userInfo);
}
else {
BYTE bDCC = getByte((MCONTACT)wp, "DCC", 0);
@@ -234,7 +234,7 @@ INT_PTR __cdecl CIrcProto::OnJoinChat(WPARAM wp, LPARAM)
DBVARIANT dbv;
if (!getTString((MCONTACT)wp, "Nick", &dbv)) {
if (getByte((MCONTACT)wp, "ChatRoom", 0) == GCW_CHATROOM)
- PostIrcMessage(_T("/JOIN %s"), dbv.ptszVal);
+ PostIrcMessage(L"/JOIN %s", dbv.ptszVal);
db_free(&dbv);
}
return 0;
@@ -248,7 +248,7 @@ INT_PTR __cdecl CIrcProto::OnLeaveChat(WPARAM wp, LPARAM)
DBVARIANT dbv;
if (!getTString((MCONTACT)wp, "Nick", &dbv)) {
if (getByte((MCONTACT)wp, "ChatRoom", 0) == GCW_CHATROOM) {
- PostIrcMessage(_T("/PART %s %s"), dbv.ptszVal, m_userInfo);
+ PostIrcMessage(L"/PART %s %s", dbv.ptszVal, m_userInfo);
CMString S = MakeWndID(dbv.ptszVal);
GCDEST gcd = { m_szModuleName, S.c_str(), GC_EVENT_CONTROL };
@@ -268,7 +268,7 @@ INT_PTR __cdecl CIrcProto::OnMenuChanSettings(WPARAM wp, LPARAM)
MCONTACT hContact = (MCONTACT)wp;
DBVARIANT dbv;
if (!getTString(hContact, "Nick", &dbv)) {
- PostIrcMessageWnd(dbv.ptszVal, NULL, _T("/CHANNELMANAGER"));
+ PostIrcMessageWnd(dbv.ptszVal, NULL, L"/CHANNELMANAGER");
db_free(&dbv);
}
return 0;
@@ -282,7 +282,7 @@ INT_PTR __cdecl CIrcProto::OnMenuWhois(WPARAM wp, LPARAM)
DBVARIANT dbv;
if (!getTString((MCONTACT)wp, "Nick", &dbv)) {
- PostIrcMessage(_T("/WHOIS %s %s"), dbv.ptszVal, dbv.ptszVal);
+ PostIrcMessage(L"/WHOIS %s %s", dbv.ptszVal, dbv.ptszVal);
db_free(&dbv);
}
return 0;
@@ -316,7 +316,7 @@ INT_PTR __cdecl CIrcProto::OnMenuIgnore(WPARAM wp, LPARAM)
S = "+qnidcm";
else
S = "+qnidc";
- PostIrcMessage(_T("/IGNORE %%question=\"%s\",\"%s\",\"*!*@%S\" %s"),
+ PostIrcMessage(L"/IGNORE %%question=\"%s\",\"%s\",\"*!*@%S\" %s",
TranslateT("Please enter the hostmask (nick!user@host)\nNOTE! Contacts on your contact list are never ignored"),
TranslateT("Ignore"), host, S.c_str());
db_free(&dbv1);
@@ -361,7 +361,7 @@ INT_PTR __cdecl CIrcProto::OnQuickConnectMenuCommand(WPARAM, LPARAM)
INT_PTR __cdecl CIrcProto::OnShowListMenuCommand(WPARAM, LPARAM)
{
- PostIrcMessage(_T("/LIST"));
+ PostIrcMessage(L"/LIST");
return 0;
}
@@ -404,22 +404,22 @@ static void DoChatFormatting(TCHAR* pszText)
switch (p1[1]) {
case 'B':
case 'b':
- mir_tstrcpy(InsertThis, _T("\002"));
+ mir_tstrcpy(InsertThis, L"\002");
iRemoveChars = 2;
break;
case 'I':
case 'i':
- mir_tstrcpy(InsertThis, _T("\026"));
+ mir_tstrcpy(InsertThis, L"\026");
iRemoveChars = 2;
break;
case 'U':
case 'u':
- mir_tstrcpy(InsertThis, _T("\037"));
+ mir_tstrcpy(InsertThis, L"\037");
iRemoveChars = 2;
break;
case 'c':
{
- mir_tstrcpy(InsertThis, _T("\003"));
+ mir_tstrcpy(InsertThis, L"\003");
iRemoveChars = 2;
TCHAR szTemp[3];
@@ -429,36 +429,36 @@ static void DoChatFormatting(TCHAR* pszText)
break;
case 'C':
if (p1[2] == '%' && p1[3] == 'F') {
- mir_tstrcpy(InsertThis, _T("\x0399,99"));
+ mir_tstrcpy(InsertThis, L"\x0399,99");
iRemoveChars = 4;
}
else {
- mir_tstrcpy(InsertThis, _T("\x0399"));
+ mir_tstrcpy(InsertThis, L"\x0399");
iRemoveChars = 2;
}
iFG = -1;
break;
case 'f':
if (p1 - 3 >= pszText && p1[-3] == '\003')
- mir_tstrcpy(InsertThis, _T(","));
+ mir_tstrcpy(InsertThis, L",");
else if (iFG >= 0)
- mir_sntprintf(InsertThis, _T("\x03%u,"), iFG);
+ mir_sntprintf(InsertThis, L"\x03%u,", iFG);
else
- mir_tstrcpy(InsertThis, _T("\x0399,"));
+ mir_tstrcpy(InsertThis, L"\x0399,");
iRemoveChars = 2;
break;
case 'F':
if (iFG >= 0)
- mir_sntprintf(InsertThis, _T("\x03%u,99"), iFG);
+ mir_sntprintf(InsertThis, L"\x03%u,99", iFG);
else
- mir_tstrcpy(InsertThis, _T("\x0399,99"));
+ mir_tstrcpy(InsertThis, L"\x0399,99");
iRemoveChars = 2;
break;
case '%':
- mir_tstrcpy(InsertThis, _T("%"));
+ mir_tstrcpy(InsertThis, L"%");
iRemoveChars = 2;
break;
@@ -481,7 +481,7 @@ static void DoChatFormatting(TCHAR* pszText)
int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
{
GCHOOK *gch = (GCHOOK*)lParam;
- CMString S = _T("");
+ CMString S = L"";
mir_cslock lock(m_gchook);
@@ -489,7 +489,7 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
if (gch) {
if (!mir_strcmpi(gch->pDest->pszModule, m_szModuleName)) {
TCHAR *p1 = mir_tstrdup(gch->pDest->ptszID);
- TCHAR *p2 = _tcsstr(p1, _T(" - "));
+ TCHAR *p2 = _tcsstr(p1, L" - ");
if (p2)
*p2 = '\0';
@@ -509,13 +509,13 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
break;
case GC_USER_CHANMGR:
- PostIrcMessageWnd(p1, NULL, _T("/CHANNELMANAGER"));
+ PostIrcMessageWnd(p1, NULL, L"/CHANNELMANAGER");
break;
case GC_USER_PRIVMESS:
{
TCHAR szTemp[4000];
- mir_sntprintf(szTemp, _T("/QUERY %s"), gch->ptszUID);
+ mir_sntprintf(szTemp, L"/QUERY %s", gch->ptszUID);
PostIrcMessageWnd(p1, NULL, szTemp);
}
break;
@@ -526,11 +526,11 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
OnChangeNickMenuCommand(NULL, NULL);
break;
case 2:
- PostIrcMessageWnd(p1, NULL, _T("/CHANNELMANAGER"));
+ PostIrcMessageWnd(p1, NULL, L"/CHANNELMANAGER");
break;
case 3:
- PostIrcMessage(_T("/PART %s %s"), p1, m_userInfo);
+ PostIrcMessage(L"/PART %s %s", p1, m_userInfo);
{
S = MakeWndID(p1);
GCDEST gcd = { m_szModuleName, S.c_str(), GC_EVENT_CONTROL };
@@ -539,21 +539,21 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
}
break;
case 4: // show server window
- PostIrcMessageWnd(p1, NULL, _T("/SERVERSHOW"));
+ PostIrcMessageWnd(p1, NULL, L"/SERVERSHOW");
break;
/* case 5: // nickserv register nick
- PostIrcMessage( _T("/nickserv REGISTER %%question=\"%s\",\"%s\""),
+ PostIrcMessage( L"/nickserv REGISTER %%question=\"%s\",\"%s\"",
TranslateT("Please enter your authentication code"), TranslateT("Authenticate nick"));
break;
*/
case 6: // nickserv Identify
- PostIrcMessage(_T("/nickserv AUTH %%question=\"%s\",\"%s\""),
+ PostIrcMessage(L"/nickserv AUTH %%question=\"%s\",\"%s\"",
TranslateT("Please enter your authentication code"), TranslateT("Authenticate nick"));
break;
case 7: // nickserv drop nick
if (MessageBox(0, TranslateT("Are you sure you want to unregister your current nick?"), TranslateT("Delete nick"),
MB_ICONERROR + MB_YESNO + MB_DEFBUTTON2) == IDYES)
- PostIrcMessage(_T("/nickserv DROP"));
+ PostIrcMessage(L"/nickserv DROP");
break;
case 8: // nickserv Identify
{
@@ -563,7 +563,7 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
HWND hEditCtrl = GetDlgItem(question_hWnd, IDC_EDIT);
SetDlgItemText(question_hWnd, IDC_CAPTION, TranslateT("Identify nick"));
SetDlgItemText(question_hWnd, IDC_TEXT, TranslateT("Please enter your password"));
- SetDlgItemText(question_hWnd, IDC_HIDDENEDIT, _T("/nickserv IDENTIFY %question=\"%s\",\"%s\""));
+ SetDlgItemText(question_hWnd, IDC_HIDDENEDIT, L"/nickserv IDENTIFY %question=\"%s\",\"%s\"");
SetWindowLongPtr(GetDlgItem(question_hWnd, IDC_EDIT), GWL_STYLE,
(LONG)GetWindowLongPtr(GetDlgItem(question_hWnd, IDC_EDIT), GWL_STYLE) | ES_PASSWORD);
SendMessage(hEditCtrl, EM_SETPASSWORDCHAR, (WPARAM)_T('*'), 0);
@@ -575,75 +575,75 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
{
DBVARIANT dbv;
if (!getTString("Nick", &dbv)) {
- PostIrcMessage(_T("/nickserv SENDPASS %s"), dbv.ptszVal);
+ PostIrcMessage(L"/nickserv SENDPASS %s", dbv.ptszVal);
db_free(&dbv);
}
}
break;
case 10: // nickserv set new password
- PostIrcMessage(_T("/nickserv SET PASSWORD %%question=\"%s\",\"%s\""),
+ PostIrcMessage(L"/nickserv SET PASSWORD %%question=\"%s\",\"%s\"",
TranslateT("Please enter your new password"), TranslateT("Set new password"));
break;
case 11: // nickserv set language
- PostIrcMessage(_T("/nickserv SET LANGUAGE %%question=\"%s\",\"%s\""),
+ PostIrcMessage(L"/nickserv SET LANGUAGE %%question=\"%s\",\"%s\"",
TranslateT("Please enter desired language ID (numeric value, depends on server)"), TranslateT("Change language of NickServ messages"));
break;
case 12: // nickserv set homepage
- PostIrcMessage(_T("/nickserv SET URL %%question=\"%s\",\"%s\""),
+ PostIrcMessage(L"/nickserv SET URL %%question=\"%s\",\"%s\"",
TranslateT("Please enter URL that will be linked to your nick"), TranslateT("Set URL, linked to nick"));
break;
case 13: // nickserv set email
- PostIrcMessage(_T("/nickserv SET EMAIL %%question=\"%s\",\"%s\""),
+ PostIrcMessage(L"/nickserv SET EMAIL %%question=\"%s\",\"%s\"",
TranslateT("Please enter your e-mail, that will be linked to your nick"), TranslateT("Set e-mail, linked to nick"));
break;
case 14: // nickserv set info
- PostIrcMessage(_T("/nickserv SET INFO %%question=\"%s\",\"%s\""),
+ PostIrcMessage(L"/nickserv SET INFO %%question=\"%s\",\"%s\"",
TranslateT("Please enter some information about your nick"), TranslateT("Set information for nick"));
break;
case 15: // nickserv kill unauth off
- PostIrcMessage(_T("/nickserv SET KILL OFF"));
+ PostIrcMessage(L"/nickserv SET KILL OFF");
break;
case 16: // nickserv kill unauth on
- PostIrcMessage(_T("/nickserv SET KILL ON"));
+ PostIrcMessage(L"/nickserv SET KILL ON");
break;
case 17: // nickserv kill unauth quick
- PostIrcMessage(_T("/nickserv SET KILL QUICK"));
+ PostIrcMessage(L"/nickserv SET KILL QUICK");
break;
case 18: // nickserv hide nick from /LIST
- PostIrcMessage(_T("/nickserv SET PRIVATE ON"));
+ PostIrcMessage(L"/nickserv SET PRIVATE ON");
break;
case 19: // nickserv show nick to /LIST
- PostIrcMessage(_T("/nickserv SET PRIVATE OFF"));
+ PostIrcMessage(L"/nickserv SET PRIVATE OFF");
break;
case 20: // nickserv Hide e-mail from info
- PostIrcMessage(_T("/nickserv SET HIDE EMAIL ON"));
+ PostIrcMessage(L"/nickserv SET HIDE EMAIL ON");
break;
case 21: // nickserv Show e-mail in info
- PostIrcMessage(_T("/nickserv SET HIDE EMAIL OFF"));
+ PostIrcMessage(L"/nickserv SET HIDE EMAIL OFF");
break;
case 22: // nickserv Set security for nick
- PostIrcMessage(_T("/nickserv SET SECURE ON"));
+ PostIrcMessage(L"/nickserv SET SECURE ON");
break;
case 23: // nickserv Remove security for nick
- PostIrcMessage(_T("/nickserv SET SECURE OFF"));
+ PostIrcMessage(L"/nickserv SET SECURE OFF");
break;
case 24: // nickserv Link nick to current
- PostIrcMessage(_T("/nickserv LINK %%question=\"%s\",\"%s\""),
+ PostIrcMessage(L"/nickserv LINK %%question=\"%s\",\"%s\"",
TranslateT("Please enter nick you want to link to your current nick"), TranslateT("Link another nick to current nick"));
break;
case 25: // nickserv Unlink nick from current
- PostIrcMessage(_T("/nickserv LINK %%question=\"%s\",\"%s\""),
+ PostIrcMessage(L"/nickserv LINK %%question=\"%s\",\"%s\"",
TranslateT("Please enter nick you want to unlink from your current nick"), TranslateT("Unlink another nick from current nick"));
break;
case 26: // nickserv Set main nick
- PostIrcMessage(_T("/nickserv LINK %%question=\"%s\",\"%s\""),
+ PostIrcMessage(L"/nickserv LINK %%question=\"%s\",\"%s\"",
TranslateT("Please enter nick you want to set as your main nick"), TranslateT("Set main nick"));
break;
case 27: // nickserv list all linked nicks
- PostIrcMessage(_T("/nickserv LISTLINKS"));
+ PostIrcMessage(L"/nickserv LISTLINKS");
break;
case 28: // nickserv list all channels owned
- PostIrcMessage(_T("/nickserv LISTCHANS"));
+ PostIrcMessage(L"/nickserv LISTCHANS");
break;
}
break;
@@ -651,35 +651,35 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
case GC_USER_NICKLISTMENU:
switch (gch->dwData) {
case 1:
- PostIrcMessage(_T("/MODE %s +o %s"), p1, gch->ptszUID);
+ PostIrcMessage(L"/MODE %s +o %s", p1, gch->ptszUID);
break;
case 2:
- PostIrcMessage(_T("/MODE %s -o %s"), p1, gch->ptszUID);
+ PostIrcMessage(L"/MODE %s -o %s", p1, gch->ptszUID);
break;
case 3:
- PostIrcMessage(_T("/MODE %s +v %s"), p1, gch->ptszUID);
+ PostIrcMessage(L"/MODE %s +v %s", p1, gch->ptszUID);
break;
case 4:
- PostIrcMessage(_T("/MODE %s -v %s"), p1, gch->ptszUID);
+ PostIrcMessage(L"/MODE %s -v %s", p1, gch->ptszUID);
break;
case 5:
- PostIrcMessage(_T("/KICK %s %s"), p1, gch->ptszUID);
+ PostIrcMessage(L"/KICK %s %s", p1, gch->ptszUID);
break;
case 6:
- PostIrcMessage(_T("/KICK %s %s %%question=\"%s\",\"%s\",\"%s\""),
+ PostIrcMessage(L"/KICK %s %s %%question=\"%s\",\"%s\",\"%s\"",
p1, gch->ptszUID, TranslateT("Please enter the reason"), TranslateT("Kick"), TranslateT("Jerk"));
break;
case 7:
- DoUserhostWithReason(1, _T("B") + (CMString)p1, true, _T("%s"), gch->ptszUID);
+ DoUserhostWithReason(1, L"B" + (CMString)p1, true, L"%s", gch->ptszUID);
break;
case 8:
- DoUserhostWithReason(1, _T("K") + (CMString)p1, true, _T("%s"), gch->ptszUID);
+ DoUserhostWithReason(1, L"K" + (CMString)p1, true, L"%s", gch->ptszUID);
break;
case 9:
- DoUserhostWithReason(1, _T("L") + (CMString)p1, true, _T("%s"), gch->ptszUID);
+ DoUserhostWithReason(1, L"L" + (CMString)p1, true, L"%s", gch->ptszUID);
break;
case 10:
- PostIrcMessage(_T("/WHOIS %s %s"), gch->ptszUID, gch->ptszUID);
+ PostIrcMessage(L"/WHOIS %s %s", gch->ptszUID, gch->ptszUID);
break;
// case 11:
// DoUserhostWithReason(1, "I", true, "%s", gch->ptszUID );
@@ -688,38 +688,38 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
// DoUserhostWithReason(1, "J", true, "%s", gch->ptszUID );
// break;
case 13:
- PostIrcMessage(_T("/DCC CHAT %s"), gch->ptszUID);
+ PostIrcMessage(L"/DCC CHAT %s", gch->ptszUID);
break;
case 14:
- PostIrcMessage(_T("/DCC SEND %s"), gch->ptszUID);
+ PostIrcMessage(L"/DCC SEND %s", gch->ptszUID);
break;
case 15:
- DoUserhostWithReason(1, _T("I"), true, _T("%s"), gch->ptszUID);
+ DoUserhostWithReason(1, L"I", true, L"%s", gch->ptszUID);
break;
case 16:
- PostIrcMessage(_T("/MODE %s +h %s"), p1, gch->ptszUID);
+ PostIrcMessage(L"/MODE %s +h %s", p1, gch->ptszUID);
break;
case 17:
- PostIrcMessage(_T("/MODE %s -h %s"), p1, gch->ptszUID);
+ PostIrcMessage(L"/MODE %s -h %s", p1, gch->ptszUID);
break;
case 18:
- PostIrcMessage(_T("/MODE %s +q %s"), p1, gch->ptszUID);
+ PostIrcMessage(L"/MODE %s +q %s", p1, gch->ptszUID);
break;
case 19:
- PostIrcMessage(_T("/MODE %s -q %s"), p1, gch->ptszUID);
+ PostIrcMessage(L"/MODE %s -q %s", p1, gch->ptszUID);
break;
case 20:
- PostIrcMessage(_T("/MODE %s +a %s"), p1, gch->ptszUID);
+ PostIrcMessage(L"/MODE %s +a %s", p1, gch->ptszUID);
break;
case 21:
- PostIrcMessage(_T("/MODE %s -a %s"), p1, gch->ptszUID);
+ PostIrcMessage(L"/MODE %s -a %s", p1, gch->ptszUID);
break;
case 22:
- PostIrcMessage(_T("/NOTICE %s %%question=\"%s\",\"%s\""),
+ PostIrcMessage(L"/NOTICE %s %%question=\"%s\",\"%s\"",
gch->ptszUID, TranslateT("Please enter the notice text"), TranslateT("Send notice"));
break;
case 23:
- PostIrcMessage(_T("/INVITE %s %%question=\"%s\",\"%s\""),
+ PostIrcMessage(L"/INVITE %s %%question=\"%s\",\"%s\"",
gch->ptszUID, TranslateT("Please enter the channel name to invite to"), TranslateT("Invite to channel"));
break;
case 30:
@@ -738,13 +738,13 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
}
break;
case 31: //slap
- PostIrcMessageWnd(p1, NULL, CMString(FORMAT, _T("/slap %s"), gch->ptszUID));
+ PostIrcMessageWnd(p1, NULL, CMString(FORMAT, L"/slap %s", gch->ptszUID));
break;
case 32: //nickserv info
- PostIrcMessageWnd(p1, NULL, CMString(FORMAT, _T("/nickserv INFO %s ALL"), gch->ptszUID));
+ PostIrcMessageWnd(p1, NULL, CMString(FORMAT, L"/nickserv INFO %s ALL", gch->ptszUID));
break;
case 33: //nickserv ghost
- PostIrcMessageWnd(p1, NULL, CMString(FORMAT, _T("/nickserv GHOST %s"), gch->ptszUID));
+ PostIrcMessageWnd(p1, NULL, CMString(FORMAT, L"/nickserv GHOST %s", gch->ptszUID));
break;
}
break;
@@ -761,7 +761,7 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam)
static gc_item logItems[] = {
{ LPGENT("&Change your nickname"), 1, MENU_ITEM, FALSE },
{ LPGENT("Channel &settings"), 2, MENU_ITEM, FALSE },
- { _T(""), 0, MENU_SEPARATOR, FALSE },
+ { L"", 0, MENU_SEPARATOR, FALSE },
{ LPGENT("NickServ"), 0, MENU_NEWPOPUP, FALSE },
{ LPGENT("Register nick"), 5, MENU_POPUPITEM, TRUE },
{ LPGENT("Auth nick"), 6, MENU_POPUPITEM, FALSE },
@@ -773,27 +773,27 @@ static gc_item logItems[] = {
{ LPGENT("Set homepage"), 12, MENU_POPUPITEM, FALSE },
{ LPGENT("Set e-mail"), 13, MENU_POPUPITEM, FALSE },
{ LPGENT("Set info"), 14, MENU_POPUPITEM, FALSE },
- { _T(""), 0, MENU_POPUPSEPARATOR, FALSE },
+ { L"", 0, MENU_POPUPSEPARATOR, FALSE },
{ LPGENT("Hide e-mail from info"), 20, MENU_POPUPITEM, FALSE },
{ LPGENT("Show e-mail in info"), 21, MENU_POPUPITEM, FALSE },
- { _T(""), 0, MENU_POPUPSEPARATOR, FALSE },
+ { L"", 0, MENU_POPUPSEPARATOR, FALSE },
{ LPGENT("Set security for nick"), 22, MENU_POPUPITEM, FALSE },
{ LPGENT("Remove security for nick"), 23, MENU_POPUPITEM, FALSE },
- { _T(""), 0, MENU_POPUPSEPARATOR, FALSE },
+ { L"", 0, MENU_POPUPSEPARATOR, FALSE },
{ LPGENT("Link nick to current"), 24, MENU_POPUPITEM, FALSE },
{ LPGENT("Unlink nick from current"), 25, MENU_POPUPITEM, FALSE },
{ LPGENT("Set main nick"), 26, MENU_POPUPITEM, FALSE },
{ LPGENT("List all your nicks"), 27, MENU_POPUPITEM, FALSE },
{ LPGENT("List your channels"), 28, MENU_POPUPITEM, FALSE },
- { _T(""), 0, MENU_POPUPSEPARATOR, FALSE },
+ { L"", 0, MENU_POPUPSEPARATOR, FALSE },
{ LPGENT("Kill unauthorized: off"), 15, MENU_POPUPITEM, FALSE },
{ LPGENT("Kill unauthorized: on"), 16, MENU_POPUPITEM, FALSE },
{ LPGENT("Kill unauthorized: quick"), 17, MENU_POPUPITEM, FALSE },
- { _T(""), 0, MENU_POPUPSEPARATOR, FALSE },
+ { L"", 0, MENU_POPUPSEPARATOR, FALSE },
{ LPGENT("Hide nick from list"), 18, MENU_POPUPITEM, FALSE },
{ LPGENT("Show nick to list"), 19, MENU_POPUPITEM, FALSE },
{ LPGENT("Show the server &window"), 4, MENU_ITEM, FALSE },
- { _T(""), 0, MENU_SEPARATOR, FALSE },
+ { L"", 0, MENU_SEPARATOR, FALSE },
{ LPGENT("&Leave the channel"), 3, MENU_ITEM, FALSE }
};
@@ -815,7 +815,7 @@ static gc_item nickItems[] = {
{ LPGENT("Take H&alfop"), 17, MENU_POPUPITEM, FALSE },
{ LPGENT("Give &Voice"), 3, MENU_POPUPITEM, FALSE }, //15
{ LPGENT("Take V&oice"), 4, MENU_POPUPITEM, FALSE },
- { _T(""), 0, MENU_POPUPSEPARATOR, FALSE },
+ { L"", 0, MENU_POPUPSEPARATOR, FALSE },
{ LPGENT("&Kick"), 5, MENU_POPUPITEM, FALSE },
{ LPGENT("Ki&ck (reason)"), 6, MENU_POPUPITEM, FALSE },
{ LPGENT("&Ban"), 7, MENU_POPUPITEM, FALSE }, //20
@@ -825,7 +825,7 @@ static gc_item nickItems[] = {
{ LPGENT("Request &Chat"), 13, MENU_POPUPITEM, FALSE },
{ LPGENT("Send &File"), 14, MENU_POPUPITEM, FALSE }, //25
{ LPGENT("Add to &ignore list"), 15, MENU_ITEM, FALSE },
- { _T(""), 12, MENU_SEPARATOR, FALSE },
+ { L"", 12, MENU_SEPARATOR, FALSE },
{ LPGENT("&Add User"), 30, MENU_ITEM, FALSE }
};
@@ -968,7 +968,7 @@ int __cdecl CIrcProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam)
DBVARIANT dbv;
if (!getTString(hContact, "Nick", &dbv)) {
if (getByte("MirVerAutoRequest", 1))
- PostIrcMessage(_T("/PRIVMSG %s \001VERSION\001"), dbv.ptszVal);
+ PostIrcMessage(L"/PRIVMSG %s \001VERSION\001", dbv.ptszVal);
db_free(&dbv);
}
}
@@ -1045,9 +1045,9 @@ void CIrcProto::ConnectToServer(void)
bTempDisableCheck = false;
bTempForceCheck = false;
m_iTempCheckTime = 0;
- sChannelPrefixes = _T("&#");
+ sChannelPrefixes = L"&#";
sUserModes = "ov";
- sUserModePrefixes = _T("@+");
+ sUserModePrefixes = L"@+";
sChannelModes = "btnimklps";
if (!m_bConnectThreadRunning)
@@ -1056,7 +1056,7 @@ void CIrcProto::ConnectToServer(void)
InterlockedIncrement((long *)&m_bConnectRequested);
TCHAR szTemp[300];
- mir_sntprintf(szTemp, _T("\033%s \002%s\002 (%S: %u)"),
+ mir_sntprintf(szTemp, L"\033%s \002%s\002 (%S: %u)",
TranslateT("Connecting to"), si.sNetwork.c_str(), si.sServer.c_str(), si.iPort);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
}
diff --git a/protocols/IRCG/src/stdafx.h b/protocols/IRCG/src/stdafx.h
index 6870a538d2..2fa3ab877b 100644
--- a/protocols/IRCG/src/stdafx.h
+++ b/protocols/IRCG/src/stdafx.h
@@ -79,12 +79,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define IRC_UM_DISCONNECT "/UMenuDisconnect"
#define IRC_UM_IGNORE "/UMenuIgnore"
-#define STR_QUITMESSAGE _T("\002Miranda NG!\002 Smaller, Faster, Easier. http://miranda-ng.org/")
-#define STR_USERINFO _T("I'm a happy Miranda NG user! Get it here: http://miranda-ng.org/")
-#define STR_AWAYMESSAGE _T("I'm away from the computer.") // Default away
-#define DCCSTRING _T(" (DCC)")
+#define STR_QUITMESSAGE L"\002Miranda NG!\002 Smaller, Faster, Easier. http://miranda-ng.org/"
+#define STR_USERINFO L"I'm a happy Miranda NG user! Get it here: http://miranda-ng.org/"
+#define STR_AWAYMESSAGE L"I'm away from the computer." // Default away
+#define DCCSTRING L" (DCC)"
#define SERVERSMODULE "IRC Servers"
-#define SERVERWINDOW _T("Network log")
+#define SERVERWINDOW L"Network log"
#define DCC_CHAT 1
#define DCC_SEND 2
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp
index c21a4760d6..cfae12a301 100644
--- a/protocols/IRCG/src/tools.cpp
+++ b/protocols/IRCG/src/tools.cpp
@@ -29,7 +29,7 @@ void CIrcProto::AddToJTemp(TCHAR op, CMString& sCommand)
int pos = 0;
for (;;) {
- CMString tmp = sCommand.Tokenize(_T(","), pos);
+ CMString tmp = sCommand.Tokenize(L",", pos);
if (pos == -1)
break;
@@ -37,12 +37,12 @@ void CIrcProto::AddToJTemp(TCHAR op, CMString& sCommand)
if (res.IsEmpty())
res = tmp;
else
- res += _T(" ") + tmp;
+ res += L" " + tmp;
}
DBVARIANT dbv;
if (!getTString("JTemp", &dbv)) {
- res = CMString(dbv.ptszVal) + _T(" ") + res;
+ res = CMString(dbv.ptszVal) + L" " + res;
db_free(&dbv);
}
@@ -110,13 +110,13 @@ const TCHAR* __stdcall GetWordAddress(const TCHAR* text, int index)
void __stdcall RemoveLinebreaks(CMString &Message)
{
- while (Message.Find(_T("\r\n\r\n"), 0) != -1)
- Message.Replace(_T("\r\n\r\n"), _T("\r\n"));
+ while (Message.Find(L"\r\n\r\n", 0) != -1)
+ Message.Replace(L"\r\n\r\n", L"\r\n");
- if (Message.Find(_T("\r\n"), 0) == 0)
+ if (Message.Find(L"\r\n", 0) == 0)
Message.Delete(0, 2);
- if ((Message.GetLength() > 1) && (Message.Find(_T("\r\n"), Message.GetLength() - 2) == 0))
+ if ((Message.GetLength() > 1) && (Message.Find(L"\r\n", Message.GetLength() - 2) == 0))
Message.Delete(Message.GetLength() - 2, 2);
}
@@ -124,7 +124,7 @@ char* __stdcall IrcLoadFile(TCHAR* szPath)
{
char * szContainer = NULL;
DWORD dwSiz = 0;
- FILE *hFile = _tfopen(szPath, _T("rb"));
+ FILE *hFile = _tfopen(szPath, L"rb");
if (hFile != NULL) {
fseek(hFile, 0, SEEK_END); // seek to end
dwSiz = ftell(hFile); // size
@@ -342,7 +342,7 @@ TCHAR* __stdcall DoColorCodes(const TCHAR* text, bool bStrip, bool bReplacePerce
*p++ = '%';
*p++ = 'c';
- mir_sntprintf(buf, _T("%02u"), iFG);
+ mir_sntprintf(buf, L"%02u", iFG);
for (int i = 0; i < 2; i++)
*p++ = buf[i];
}
@@ -355,7 +355,7 @@ TCHAR* __stdcall DoColorCodes(const TCHAR* text, bool bStrip, bool bReplacePerce
*p++ = '%';
*p++ = 'f';
- mir_sntprintf(buf, _T("%02u"), iBG);
+ mir_sntprintf(buf, L"%02u", iBG);
for (int i = 0; i < 2; i++)
*p++ = buf[i];
}
@@ -387,7 +387,7 @@ INT_PTR CIrcProto::DoEvent(int iEvent, const TCHAR* pszWindow, const TCHAR* pszN
{
GCDEST gcd = { m_szModuleName, NULL, iEvent };
CMString sID;
- CMString sText = _T("");
+ CMString sText = L"";
if (iEvent == GC_EVENT_INFORMATION && bIsMe && !bEcho)
return false;
@@ -401,7 +401,7 @@ INT_PTR CIrcProto::DoEvent(int iEvent, const TCHAR* pszWindow, const TCHAR* pszN
if (pszWindow) {
if (mir_tstrcmpi(pszWindow, SERVERWINDOW))
- sID = pszWindow + (CMString)_T(" - ") + m_info.sNetwork;
+ sID = pszWindow + (CMString)L" - " + m_info.sNetwork;
else
sID = pszWindow;
gcd.ptszID = (TCHAR*)sID.c_str();
@@ -435,21 +435,21 @@ CMString CIrcProto::ModeToStatus(int sMode)
if (sUserModes.Find(sMode) != -1) {
switch (sMode) {
case 'q':
- return (CMString)_T("Owner");
+ return (CMString)L"Owner";
case 'o':
- return (CMString)_T("Op");
+ return (CMString)L"Op";
case 'v':
- return (CMString)_T("Voice");
+ return (CMString)L"Voice";
case 'h':
- return (CMString)_T("Halfop");
+ return (CMString)L"Halfop";
case 'a':
- return (CMString)_T("Admin");
+ return (CMString)L"Admin";
default:
- return (CMString)_T("Unknown");
+ return (CMString)L"Unknown";
}
}
- return (CMString)_T("Normal");
+ return (CMString)L"Normal";
}
CMString CIrcProto::PrefixToStatus(int cPrefix)
@@ -460,7 +460,7 @@ CMString CIrcProto::PrefixToStatus(int cPrefix)
return ModeToStatus(sUserModes[index]);
}
- return (CMString)_T("Normal");
+ return (CMString)L"Normal";
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -533,11 +533,11 @@ void CIrcProto::KillChatTimer(UINT_PTR &nIDEvent)
int CIrcProto::SetChannelSBText(CMString sWindow, CHANNELINFO * wi)
{
- CMString sTemp = _T("");
+ CMString sTemp = L"";
if (wi->pszMode) {
- sTemp += _T("[");
+ sTemp += L"[";
sTemp += wi->pszMode;
- sTemp += _T("] ");
+ sTemp += L"] ";
}
if (wi->pszTopic)
sTemp += wi->pszTopic;
@@ -548,7 +548,7 @@ int CIrcProto::SetChannelSBText(CMString sWindow, CHANNELINFO * wi)
CMString CIrcProto::MakeWndID(const TCHAR* sWindow)
{
TCHAR buf[200];
- mir_sntprintf(buf, _T("%s - %s"), sWindow, (IsConnected()) ? m_info.sNetwork.c_str() : TranslateT("Offline"));
+ mir_sntprintf(buf, L"%s - %s", sWindow, (IsConnected()) ? m_info.sNetwork.c_str() : TranslateT("Offline"));
return CMString(buf);
}
@@ -613,22 +613,22 @@ void CIrcProto::FindLocalIP(HANDLE hConn) // inspiration from jabber
void CIrcProto::DoUserhostWithReason(int type, CMString reason, bool bSendCommand, CMString userhostparams, ...)
{
TCHAR temp[4096];
- CMString S = _T("");
+ CMString S = L"";
switch (type) {
case 1:
- S = _T("USERHOST");
+ S = L"USERHOST";
break;
case 2:
- S = _T("WHO");
+ S = L"WHO";
break;
default:
- S = _T("USERHOST");
+ S = L"USERHOST";
break;
}
va_list ap;
va_start(ap, userhostparams);
- mir_vsntprintf(temp, _countof(temp), (S + _T(" ") + userhostparams).c_str(), ap);
+ mir_vsntprintf(temp, _countof(temp), (S + L" " + userhostparams).c_str(), ap);
va_end(ap);
// Add reason
@@ -644,7 +644,7 @@ void CIrcProto::DoUserhostWithReason(int type, CMString reason, bool bSendComman
CMString CIrcProto::GetNextUserhostReason(int type)
{
- CMString reason = _T("");
+ CMString reason = L"";
switch (type) {
case 1:
if (!vUserhostReasons.getCount())
diff --git a/protocols/IRCG/src/userinfo.cpp b/protocols/IRCG/src/userinfo.cpp
index c3ed0b36bf..dd557e25d1 100644
--- a/protocols/IRCG/src/userinfo.cpp
+++ b/protocols/IRCG/src/userinfo.cpp
@@ -114,9 +114,9 @@ INT_PTR CALLBACK UserDetailsDlgProc(HWND m_hwnd, UINT msg, WPARAM wParam, LPARAM
DBVARIANT dbv;
if (!p->ppro->getTString(p->hContact, "Default", &dbv)) {
CMString S = _T(STR_ERROR);
- S += _T(" (");
+ S += L" (";
S += dbv.ptszVal;
- S += _T(")");
+ S += L")";
if ((mir_tstrlen(temp) < 4 && mir_tstrlen(temp)) || !WCCmp(CharLower(temp), CharLower(dbv.ptszVal))) {
MessageBox(NULL, TranslateTS(S.c_str()), TranslateT("IRC error"), MB_OK | MB_ICONERROR);
db_free(&dbv);
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp
index 78417104da..e41020e7d1 100644
--- a/protocols/IRCG/src/windows.cpp
+++ b/protocols/IRCG/src/windows.cpp
@@ -111,14 +111,14 @@ void CWhoisDlg::OnGo(CCtrlButton*)
{
TCHAR szTemp[255];
m_InfoNick.GetText(szTemp, _countof(szTemp));
- m_proto->PostIrcMessage(_T("/WHOIS %s %s"), szTemp, szTemp);
+ m_proto->PostIrcMessage(L"/WHOIS %s %s", szTemp, szTemp);
}
void CWhoisDlg::OnQuery(CCtrlButton*)
{
TCHAR szTemp[255];
m_InfoNick.GetText(szTemp, _countof(szTemp));
- m_proto->PostIrcMessage(_T("/QUERY %s"), szTemp);
+ m_proto->PostIrcMessage(L"/QUERY %s", szTemp);
}
void CWhoisDlg::OnPing(CCtrlButton*)
@@ -126,7 +126,7 @@ void CWhoisDlg::OnPing(CCtrlButton*)
TCHAR szTemp[255];
m_InfoNick.GetText(szTemp, _countof(szTemp));
m_Reply.SetText(TranslateT("Please wait..."));
- m_proto->PostIrcMessage(_T("/PRIVMSG %s \001PING %u\001"), szTemp, time(0));
+ m_proto->PostIrcMessage(L"/PRIVMSG %s \001PING %u\001", szTemp, time(0));
}
void CWhoisDlg::OnUserInfo(CCtrlButton*)
@@ -134,7 +134,7 @@ void CWhoisDlg::OnUserInfo(CCtrlButton*)
TCHAR szTemp[255];
m_InfoNick.GetText(szTemp, _countof(szTemp));
m_Reply.SetText(TranslateT("Please wait..."));
- m_proto->PostIrcMessage(_T("/PRIVMSG %s \001USERINFO\001"), szTemp);
+ m_proto->PostIrcMessage(L"/PRIVMSG %s \001USERINFO\001", szTemp);
}
void CWhoisDlg::OnTime(CCtrlButton*)
@@ -142,7 +142,7 @@ void CWhoisDlg::OnTime(CCtrlButton*)
TCHAR szTemp[255];
m_InfoNick.GetText(szTemp, _countof(szTemp));
m_Reply.SetText(TranslateT("Please wait..."));
- m_proto->PostIrcMessage(_T("/PRIVMSG %s \001TIME\001"), szTemp);
+ m_proto->PostIrcMessage(L"/PRIVMSG %s \001TIME\001", szTemp);
}
void CWhoisDlg::OnVersion(CCtrlButton*)
@@ -150,7 +150,7 @@ void CWhoisDlg::OnVersion(CCtrlButton*)
TCHAR szTemp[255];
m_InfoNick.GetText(szTemp, _countof(szTemp));
m_Reply.SetText(TranslateT("Please wait..."));
- m_proto->PostIrcMessage(_T("/PRIVMSG %s \001VERSION\001"), szTemp);
+ m_proto->PostIrcMessage(L"/PRIVMSG %s \001VERSION\001", szTemp);
}
void CWhoisDlg::ShowMessage(const CIrcMessage* pmsg)
@@ -163,12 +163,12 @@ void CWhoisDlg::ShowMessage(const CIrcMessage* pmsg)
m_InfoName.SetText(pmsg->parameters[5].c_str());
m_InfoAddress.SetText(pmsg->parameters[3].c_str());
m_InfoId.SetText(pmsg->parameters[2].c_str());
- m_InfoChannels.SetText(_T(""));
- m_InfoServer.SetText(_T(""));
- m_InfoAway2.SetText(_T(""));
- m_InfoAuth.SetText(_T(""));
- m_InfoOther.SetText(_T(""));
- m_Reply.SetText(_T(""));
+ m_InfoChannels.SetText(L"");
+ m_InfoServer.SetText(L"");
+ m_InfoAway2.SetText(L"");
+ m_InfoAuth.SetText(L"");
+ m_InfoOther.SetText(L"");
+ m_Reply.SetText(L"");
SetWindowText(m_hwnd, TranslateT("User information"));
EnableWindow(GetDlgItem(m_hwnd, ID_INFO_QUERY), true);
ShowWindow(m_hwnd, SW_SHOW);
@@ -183,14 +183,14 @@ void CWhoisDlg::ShowMessageNoUser(const CIrcMessage *pmsg)
m_InfoNick.SetText(pmsg->parameters[2].c_str());
m_InfoNick.SendMsg(CB_SETEDITSEL, 0, MAKELPARAM(0, -1));
m_Caption.SetText(pmsg->parameters[2].c_str());
- m_InfoName.SetText(_T(""));
- m_InfoAddress.SetText(_T(""));
- m_InfoId.SetText(_T(""));
- m_InfoChannels.SetText(_T(""));
- m_InfoServer.SetText(_T(""));
- m_InfoAway2.SetText(_T(""));
- m_InfoAuth.SetText(_T(""));
- m_Reply.SetText(_T(""));
+ m_InfoName.SetText(L"");
+ m_InfoAddress.SetText(L"");
+ m_InfoId.SetText(L"");
+ m_InfoChannels.SetText(L"");
+ m_InfoServer.SetText(L"");
+ m_InfoAway2.SetText(L"");
+ m_InfoAuth.SetText(L"");
+ m_Reply.SetText(L"");
EnableWindow(GetDlgItem(m_hwnd, ID_INFO_QUERY), false);
}
@@ -230,7 +230,7 @@ void CNickDlg::OnOk(CCtrlButton*)
{
TCHAR szTemp[255];
m_Enick.GetText(szTemp, _countof(szTemp));
- m_proto->PostIrcMessage(_T("/NICK %s"), szTemp);
+ m_proto->PostIrcMessage(L"/NICK %s", szTemp);
CMString S = szTemp;
DBVARIANT dbv;
@@ -238,7 +238,7 @@ void CNickDlg::OnOk(CCtrlButton*)
for (int i = 0; i < 10; i++) {
CMString s = GetWord(dbv.ptszVal, i);
if (!s.IsEmpty() && s != szTemp)
- S += _T(" ") + s;
+ S += L" " + s;
}
db_free(&dbv);
}
@@ -279,7 +279,7 @@ void CListDlg::OnInitDialog()
switch (index) {
case 0: mir_tstrcpy(szBuffer, TranslateT("Channel")); break;
- case 1: mir_tstrcpy(szBuffer, _T("#")); break;
+ case 1: mir_tstrcpy(szBuffer, L"#"); break;
case 2: mir_tstrcpy(szBuffer, TranslateT("Mode")); break;
case 3: mir_tstrcpy(szBuffer, TranslateT("Topic")); break;
}
@@ -470,7 +470,7 @@ void CListDlg::OnJoin(CCtrlButton*)
m_list2.GetItemText(m_list2.GetSelectionMark(), 0, szTemp, 255);
else
m_list.GetItemText(m_list.GetSelectionMark(), 0, szTemp, 255);
- m_proto->PostIrcMessage(_T("/JOIN %s"), szTemp);
+ m_proto->PostIrcMessage(L"/JOIN %s", szTemp);
}
void CListDlg::UpdateList()
@@ -507,7 +507,7 @@ void CJoinDlg::OnInitDialog()
for (int i = 0; i < 20; i++) {
if (!GetWord(dbv.ptszVal, i).IsEmpty()) {
CMString S = GetWord(dbv.ptszVal, i);
- S.Replace(_T("%newl"), _T(" "));
+ S.Replace(L"%newl", L" ");
SendDlgItemMessage(m_hwnd, IDC_ENICK, CB_ADDSTRING, 0, (LPARAM)S.c_str());
}
}
@@ -526,12 +526,12 @@ void CJoinDlg::OnOk(CCtrlButton*)
TCHAR szTemp[255];
GetDlgItemText(m_hwnd, IDC_ENICK, szTemp, _countof(szTemp));
if (m_proto->IsChannel(szTemp))
- m_proto->PostIrcMessage(_T("/JOIN %s"), szTemp);
+ m_proto->PostIrcMessage(L"/JOIN %s", szTemp);
else
- m_proto->PostIrcMessage(_T("/JOIN #%s"), szTemp);
+ m_proto->PostIrcMessage(L"/JOIN #%s", szTemp);
CMString S = szTemp;
- S.Replace(_T(" "), _T("%newl"));
+ S.Replace(L" ", L"%newl");
CMString SL = S;
DBVARIANT dbv;
@@ -539,7 +539,7 @@ void CJoinDlg::OnOk(CCtrlButton*)
for (int i = 0; i < 20; i++) {
CMString W = GetWord(dbv.ptszVal, i);
if (!W.IsEmpty() && W != SL)
- S += _T(" ") + W;
+ S += L" " + W;
}
db_free(&dbv);
}
@@ -633,7 +633,7 @@ void CQuickDlg::OnOk(CCtrlButton*)
TCHAR windowname[20];
GetWindowText(m_hwnd, windowname, _countof(windowname));
- if (mir_tstrcmpi(windowname, _T("Miranda IRC")) == 0) {
+ if (mir_tstrcmpi(windowname, L"Miranda IRC") == 0) {
m_proto->m_serverComboSelection = m_serverCombo.GetCurSel() - 1;
m_proto->setDword("ServerComboSelection", m_proto->m_serverComboSelection);
m_proto->setString("ServerName", m_proto->m_serverName);
@@ -734,7 +734,7 @@ void CQuestionDlg::OnOk(CCtrlButton*)
TCHAR *m = new TCHAR[j + 2];
GetDlgItemText(m_hwnd, IDC_HIDDENEDIT, m, j + 1);
- TCHAR *text = _tcsstr(m, _T("%question"));
+ TCHAR *text = _tcsstr(m, L"%question");
TCHAR *p1 = text;
TCHAR *p2 = NULL;
if (p1) {
@@ -909,21 +909,21 @@ void CManagerDlg::OnClose()
TCHAR window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
- CMString S = _T("");
+ CMString S = L"";
TCHAR temp[1000];
for (int i = 0; i < 5; i++) {
if (m_topic.SendMsg(CB_GETLBTEXT, i, (LPARAM)temp) != LB_ERR) {
CMString S1 = temp;
/* FIXME: What the hell does it mean!? GCC won't compile this on UNICODE */
#if !defined(__GNUC__) || !defined(UNICODE)
- S1.Replace(_T(" "), _T("%¤"));
+ S1.Replace(L" ", L"%¤");
#endif
- S += _T(" ") + S1;
+ S += L" " + S1;
}
}
if (!S.IsEmpty() && m_proto->IsConnected()) {
- mir_sntprintf(temp, _T("Topic%s%s"), window, m_proto->m_info.sNetwork.c_str());
+ mir_sntprintf(temp, L"Topic%s%s", window, m_proto->m_info.sNetwork.c_str());
char* p = mir_t2a(temp);
m_proto->setTString(p, S.c_str());
mir_free(p);
@@ -942,15 +942,15 @@ void CManagerDlg::OnAdd(CCtrlButton*)
TCHAR temp[100];
TCHAR mode[3];
if (m_radio1.GetState()) {
- mir_tstrcpy(mode, _T("+b"));
+ mir_tstrcpy(mode, L"+b");
mir_tstrncpy(temp, TranslateT("Add ban"), 100);
}
if (m_radio2.GetState()) {
- mir_tstrcpy(mode, _T("+I"));
+ mir_tstrcpy(mode, L"+I");
mir_tstrncpy(temp, TranslateT("Add invite"), 100);
}
if (m_radio3.GetState()) {
- mir_tstrcpy(mode, _T("+e"));
+ mir_tstrcpy(mode, L"+e");
mir_tstrncpy(temp, TranslateT("Add exception"), 100);
}
@@ -967,7 +967,7 @@ void CManagerDlg::OnAdd(CCtrlButton*)
TCHAR temp2[450];
TCHAR window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
- mir_sntprintf(temp2, _T("/MODE %s %s %s"), window, mode, _T("%question"));
+ mir_sntprintf(temp2, L"/MODE %s %s %s", window, mode, L"%question");
SetDlgItemText(addban_hWnd, IDC_HIDDENEDIT, temp2);
dlg->Activate();
}
@@ -984,15 +984,15 @@ void CManagerDlg::OnEdit(CCtrlButton*)
TCHAR temp[100];
TCHAR mode[3];
if (m_radio1.GetState()) {
- mir_tstrcpy(mode, _T("b"));
+ mir_tstrcpy(mode, L"b");
mir_tstrncpy(temp, TranslateT("Edit ban"), 100);
}
if (m_radio2.GetState()) {
- mir_tstrcpy(mode, _T("I"));
+ mir_tstrcpy(mode, L"I");
mir_tstrncpy(temp, TranslateT("Edit invite?"), 100);
}
if (m_radio3.GetState()) {
- mir_tstrcpy(mode, _T("e"));
+ mir_tstrcpy(mode, L"e");
mir_tstrncpy(temp, TranslateT("Edit exception?"), 100);
}
@@ -1010,7 +1010,7 @@ void CManagerDlg::OnEdit(CCtrlButton*)
TCHAR temp2[450];
TCHAR window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
- mir_sntprintf(temp2, _T("/MODE %s -%s %s%s/MODE %s +%s %s"), window, mode, user.c_str(), _T("%newl"), window, mode, _T("%question"));
+ mir_sntprintf(temp2, L"/MODE %s -%s %s%s/MODE %s +%s %s", window, mode, user.c_str(), L"%newl", window, mode, L"%question");
SetDlgItemText(addban_hWnd, IDC_HIDDENEDIT, temp2);
dlg->Activate();
}
@@ -1030,22 +1030,22 @@ void CManagerDlg::OnRemove(CCtrlButton*)
CMString user = GetWord(m, 0);
if (m_radio1.GetState()) {
- mir_tstrcpy(mode, _T("-b"));
+ mir_tstrcpy(mode, L"-b");
mir_tstrncpy(temp, TranslateT("Remove ban?"), 100);
}
if (m_radio2.GetState()) {
- mir_tstrcpy(mode, _T("-I"));
+ mir_tstrcpy(mode, L"-I");
mir_tstrncpy(temp, TranslateT("Remove invite?"), 100);
}
if (m_radio3.GetState()) {
- mir_tstrcpy(mode, _T("-e"));
+ mir_tstrcpy(mode, L"-e");
mir_tstrncpy(temp, TranslateT("Remove exception?"), 100);
}
TCHAR window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
if (MessageBox(m_hwnd, user.c_str(), temp, MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2) == IDYES) {
- m_proto->PostIrcMessage(_T("/MODE %s %s %s"), window, mode, user.c_str());
+ m_proto->PostIrcMessage(L"/MODE %s %s %s", window, mode, user.c_str());
ApplyQuestion();
}
CloseQuestion();
@@ -1083,79 +1083,79 @@ void CManagerDlg::OnApplyModes(CCtrlButton*)
if (wi) {
TCHAR toadd[10]; *toadd = '\0';
TCHAR toremove[10]; *toremove = '\0';
- CMString appendixadd = _T("");
- CMString appendixremove = _T("");
+ CMString appendixadd = L"";
+ CMString appendixremove = L"";
if (wi->pszMode && _tcschr(wi->pszMode, 't')) {
if (!m_check1.GetState())
- mir_tstrcat(toremove, _T("t"));
+ mir_tstrcat(toremove, L"t");
}
else if (m_check1.GetState())
- mir_tstrcat(toadd, _T("t"));
+ mir_tstrcat(toadd, L"t");
if (wi->pszMode && _tcschr(wi->pszMode, 'n')) {
if (!m_check2.GetState())
- mir_tstrcat(toremove, _T("n"));
+ mir_tstrcat(toremove, L"n");
}
else if (m_check2.GetState())
- mir_tstrcat(toadd, _T("n"));
+ mir_tstrcat(toadd, L"n");
if (wi->pszMode && _tcschr(wi->pszMode, 'i')) {
if (!m_check3.GetState())
- mir_tstrcat(toremove, _T("i"));
+ mir_tstrcat(toremove, L"i");
}
else if (m_check3.GetState())
- mir_tstrcat(toadd, _T("i"));
+ mir_tstrcat(toadd, L"i");
if (wi->pszMode && _tcschr(wi->pszMode, 'm')) {
if (!m_check4.GetState())
- mir_tstrcat(toremove, _T("m"));
+ mir_tstrcat(toremove, L"m");
}
else if (m_check4.GetState())
- mir_tstrcat(toadd, _T("m"));
+ mir_tstrcat(toadd, L"m");
if (wi->pszMode && _tcschr(wi->pszMode, 'p')) {
if (!m_check7.GetState())
- mir_tstrcat(toremove, _T("p"));
+ mir_tstrcat(toremove, L"p");
}
else if (m_check7.GetState())
- mir_tstrcat(toadd, _T("p"));
+ mir_tstrcat(toadd, L"p");
if (wi->pszMode && _tcschr(wi->pszMode, 's')) {
if (!m_check8.GetState())
- mir_tstrcat(toremove, _T("s"));
+ mir_tstrcat(toremove, L"s");
}
else if (m_check8.GetState())
- mir_tstrcat(toadd, _T("s"));
+ mir_tstrcat(toadd, L"s");
if (wi->pszMode && _tcschr(wi->pszMode, 'c')) {
if (!m_check9.GetState())
- mir_tstrcat(toremove, _T("c"));
+ mir_tstrcat(toremove, L"c");
}
else if (m_check9.GetState())
- mir_tstrcat(toadd, _T("c"));
+ mir_tstrcat(toadd, L"c");
- CMString Key = _T("");
- CMString Limit = _T("");
+ CMString Key = L"";
+ CMString Limit = L"";
if (wi->pszMode && wi->pszPassword && _tcschr(wi->pszMode, 'k')) {
if (!m_check5.GetState()) {
- mir_tstrcat(toremove, _T("k"));
- appendixremove += _T(" ") + CMString(wi->pszPassword);
+ mir_tstrcat(toremove, L"k");
+ appendixremove += L" " + CMString(wi->pszPassword);
}
else if (GetWindowTextLength(m_key.GetHwnd())) {
TCHAR temp[400];
m_key.GetText(temp, 14);
if (Key != temp) {
- mir_tstrcat(toremove, _T("k"));
- mir_tstrcat(toadd, _T("k"));
- appendixadd += _T(" ") + CMString(temp);
- appendixremove += _T(" ") + CMString(wi->pszPassword);
+ mir_tstrcat(toremove, L"k");
+ mir_tstrcat(toadd, L"k");
+ appendixadd += L" " + CMString(temp);
+ appendixremove += L" " + CMString(wi->pszPassword);
}
}
}
else if (m_check5.GetState() && GetWindowTextLength(m_key.GetHwnd())) {
- mir_tstrcat(toadd, _T("k"));
- appendixadd += _T(" ");
+ mir_tstrcat(toadd, L"k");
+ appendixadd += L" ";
TCHAR temp[400];
m_key.GetText(temp, _countof(temp));
@@ -1164,19 +1164,19 @@ void CManagerDlg::OnApplyModes(CCtrlButton*)
if (_tcschr(wi->pszMode, 'l')) {
if (!m_check6.GetState())
- mir_tstrcat(toremove, _T("l"));
+ mir_tstrcat(toremove, L"l");
else if (GetWindowTextLength(GetDlgItem(m_hwnd, IDC_LIMIT))) {
TCHAR temp[15];
GetDlgItemText(m_hwnd, IDC_LIMIT, temp, _countof(temp));
if (wi->pszLimit && mir_tstrcmpi(wi->pszLimit, temp)) {
- mir_tstrcat(toadd, _T("l"));
- appendixadd += _T(" ") + CMString(temp);
+ mir_tstrcat(toadd, L"l");
+ appendixadd += L" " + CMString(temp);
}
}
}
else if (m_check6.GetState() && GetWindowTextLength(m_limit.GetHwnd())) {
- mir_tstrcat(toadd, _T("l"));
- appendixadd += _T(" ");
+ mir_tstrcat(toadd, L"l");
+ appendixadd += L" ";
TCHAR temp[15];
m_limit.GetText(temp, _countof(temp));
@@ -1185,13 +1185,13 @@ void CManagerDlg::OnApplyModes(CCtrlButton*)
if (mir_tstrlen(toadd) || mir_tstrlen(toremove)) {
TCHAR temp[500];
- mir_tstrcpy(temp, _T("/mode "));
+ mir_tstrcpy(temp, L"/mode ");
mir_tstrcat(temp, window);
- mir_tstrcat(temp, _T(" "));
+ mir_tstrcat(temp, L" ");
if (mir_tstrlen(toremove))
- mir_sntprintf(temp, _T("%s-%s"), temp, toremove);
+ mir_sntprintf(temp, L"%s-%s", temp, toremove);
if (mir_tstrlen(toadd))
- mir_sntprintf(temp, _T("%s+%s"), temp, toadd);
+ mir_sntprintf(temp, L"%s+%s", temp, toadd);
if (!appendixremove.IsEmpty())
mir_tstrcat(temp, appendixremove.c_str());
if (!appendixadd.IsEmpty())
@@ -1209,7 +1209,7 @@ void CManagerDlg::OnApplyTopic(CCtrlButton*)
TCHAR window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
m_topic.GetText(temp, _countof(temp));
- m_proto->PostIrcMessage(_T("/TOPIC %s %s"), window, temp);
+ m_proto->PostIrcMessage(L"/TOPIC %s %s", window, temp);
int i = m_topic.SendMsg(CB_FINDSTRINGEXACT, -1, (LPARAM)temp);
if (i != LB_ERR)
m_topic.SendMsg(CB_DELETESTRING, i, 0);
@@ -1246,11 +1246,11 @@ void CManagerDlg::ApplyQuestion()
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
TCHAR mode[3];
- mir_tstrcpy(mode, _T("+b"));
+ mir_tstrcpy(mode, L"+b");
if (m_radio2.GetState())
- mir_tstrcpy(mode, _T("+I"));
+ mir_tstrcpy(mode, L"+I");
if (m_radio3.GetState())
- mir_tstrcpy(mode, _T("+e"));
+ mir_tstrcpy(mode, L"+e");
m_list.ResetContent();
m_radio1.Disable();
m_radio2.Disable();
@@ -1258,7 +1258,7 @@ void CManagerDlg::ApplyQuestion()
m_add.Disable();
m_edit.Disable();
m_remove.Disable();
- m_proto->PostIrcMessage(_T("%s %s %s"), _T("/MODE"), window, mode); //wrong overloaded operator if three args
+ m_proto->PostIrcMessage(L"%s %s %s", L"/MODE", window, mode); //wrong overloaded operator if three args
}
void CManagerDlg::CloseQuestion()
@@ -1278,7 +1278,7 @@ void CManagerDlg::InitManager(int mode, const TCHAR* window)
if (wi) {
if (m_proto->IsConnected()) {
TCHAR temp[1000];
- mir_sntprintf(temp, _T("Topic%s%s"), window, m_proto->m_info.sNetwork.c_str());
+ mir_sntprintf(temp, L"Topic%s%s", window, m_proto->m_info.sNetwork.c_str());
char* p = mir_t2a(temp);
@@ -1289,7 +1289,7 @@ void CManagerDlg::InitManager(int mode, const TCHAR* window)
if (!S.IsEmpty()) {
/* FIXME: What the hell does it mean!? GCC won't compile this on UNICODE */
#if !defined(__GNUC__) || !defined(UNICODE)
- S.Replace(_T("%¤"), _T(" "));
+ S.Replace(L"%¤", L" ");
#endif
m_topic.SendMsg(CB_ADDSTRING, 0, (LPARAM)S.c_str());
}
@@ -1364,7 +1364,7 @@ void CManagerDlg::InitManager(int mode, const TCHAR* window)
if (strchr(m_proto->sChannelModes.c_str(), 'b')) {
m_radio1.SetState(true);
- m_proto->PostIrcMessage(_T("/MODE %s +b"), window);
+ m_proto->PostIrcMessage(L"/MODE %s +b", window);
}
}