diff options
Diffstat (limited to 'protocols/IRCG')
-rw-r--r-- | protocols/IRCG/src/commandmonitor.cpp | 143 | ||||
-rw-r--r-- | protocols/IRCG/src/input.cpp | 106 | ||||
-rw-r--r-- | protocols/IRCG/src/irclib.cpp | 18 | ||||
-rw-r--r-- | protocols/IRCG/src/options.cpp | 2 | ||||
-rw-r--r-- | protocols/IRCG/src/scripting.cpp | 6 | ||||
-rw-r--r-- | protocols/IRCG/src/tools.cpp | 4 |
6 files changed, 137 insertions, 142 deletions
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index e0f187a727..a73cec6b40 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -618,11 +618,11 @@ bool CIrcProto::OnIrc_NOTICE(const CIrcMessage* pmsg) gci.Flags = GCF_BYID | GCF_TYPE;
gci.pszModule = m_szModuleName;
- CMString S3 = GetWord(pmsg->parameters[1].c_str(), 0);
- if (S3[0] == '[' && S3[1] == '#' && S3[S3.GetLength() - 1] == ']') {
- S3.Delete(S3.GetLength() - 1, 1);
- S3.Delete(0, 1);
- CMString Wnd = MakeWndID(S3.c_str());
+ CMString str = GetWord(pmsg->parameters[1].c_str(), 0);
+ if (str[0] == '[' && str[1] == '#' && str[str.GetLength() - 1] == ']') {
+ str.Delete(str.GetLength() - 1, 1);
+ str.Delete(0, 1);
+ CMString Wnd = MakeWndID(str.c_str());
gci.pszID = Wnd.c_str();
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci) && gci.iType == GCW_CHATROOM)
S2 = GetWord(gci.pszID, 0);
@@ -1204,13 +1204,13 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) if (pmsg->m_bIncoming && command == _T("ping")) {
SetActiveWindow(m_whoisDlg->GetHwnd());
int s = (int)time(0) - (int)_ttol(GetWordAddress(mess.c_str(), 1));
- TCHAR szTemp[30];
+ TCHAR szTmp[30];
if (s == 1)
- mir_sntprintf(szTemp, _T("%u second"), s);
+ mir_sntprintf(szTmp, _T("%u second"), s);
else
- mir_sntprintf(szTemp, _T("%u seconds"), s);
+ mir_sntprintf(szTmp, _T("%u seconds"), s);
- m_whoisDlg->m_Reply.SetText(DoColorCodes(szTemp, TRUE, FALSE));
+ m_whoisDlg->m_Reply.SetText(DoColorCodes(szTmp, TRUE, FALSE));
return true;
}
}
@@ -1296,56 +1296,57 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg) CallChatEvent(0, (LPARAM)&gce);
gce.ptszStatus = _T("Normal");
CallChatEvent(0, (LPARAM)&gce);
-
- int i = 0;
- CMString sTemp = GetWord(sNamesList.c_str(), i);
-
- // Fill the nicklist
- while (!sTemp.IsEmpty()) {
- CMString sStat;
- CMString sTemp2 = sTemp;
- sStat = PrefixToStatus(sTemp[0]);
-
- // fix for networks like freshirc where they allow more than one prefix
- while (PrefixToStatus(sTemp[0]) != _T("Normal"))
- sTemp.Delete(0, 1);
-
- gcd.iType = GC_EVENT_JOIN;
- gce.ptszUID = sTemp.c_str();
- gce.ptszNick = sTemp.c_str();
- gce.ptszStatus = sStat.c_str();
- BOOL bIsMe = (!mir_tstrcmpi(gce.ptszNick, m_info.sNick.c_str())) ? TRUE : FALSE;
- if (bIsMe) {
- char BitNr = -1;
- switch (sTemp2[0]) {
+ {
+ int k = 0;
+ CMString sTemp = GetWord(sNamesList.c_str(), k);
+
+ // Fill the nicklist
+ while (!sTemp.IsEmpty()) {
+ CMString sStat;
+ CMString sTemp2 = sTemp;
+ sStat = PrefixToStatus(sTemp[0]);
+
+ // fix for networks like freshirc where they allow more than one prefix
+ while (PrefixToStatus(sTemp[0]) != _T("Normal"))
+ sTemp.Delete(0, 1);
+
+ gcd.iType = GC_EVENT_JOIN;
+ gce.ptszUID = sTemp.c_str();
+ gce.ptszNick = sTemp.c_str();
+ gce.ptszStatus = sStat.c_str();
+ BOOL bIsMe = (!mir_tstrcmpi(gce.ptszNick, m_info.sNick.c_str())) ? TRUE : FALSE;
+ if (bIsMe) {
+ char BitNr = -1;
+ switch (sTemp2[0]) {
case '+': BitNr = 0; break;
case '%': BitNr = 1; break;
case '@': BitNr = 2; break;
case '!': BitNr = 3; break;
case '*': BitNr = 4; break;
+ }
+ if (BitNr >= 0)
+ btOwnMode = (1 << BitNr);
+ else
+ btOwnMode = 0;
}
- if (BitNr >= 0)
- btOwnMode = (1 << BitNr);
- else
- btOwnMode = 0;
- }
- gce.bIsMe = bIsMe;
- gce.time = bIsMe ? time(0) : 0;
- 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")) {
- 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);
+ gce.bIsMe = bIsMe;
+ gce.time = bIsMe ? time(0) : 0;
+ 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")) {
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);
+ sTemp2.Delete(0, 1);
+ sStat = PrefixToStatus(sTemp2[0]);
+ }
}
- }
- i++;
- sTemp = GetWord(sNamesList.c_str(), i);
+ k++;
+ sTemp = GetWord(sNamesList.c_str(), k);
+ }
}
//Set the item data for the window
@@ -1386,11 +1387,11 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg) if (!getTString("JTemp", &dbv)) {
CMString command = _T("a");
CMString save = _T("");
- int i = 0;
+ int k = 0;
while (!command.IsEmpty()) {
- command = GetWord(dbv.ptszVal, i);
- i++;
+ command = GetWord(dbv.ptszVal, k);
+ k++;
if (!command.IsEmpty()) {
CMString S = command.Mid(1);
if (!mir_tstrcmpi(sChanName, S))
@@ -1401,7 +1402,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg) }
if (!command.IsEmpty()) {
- save += GetWordAddress(dbv.ptszVal, i);
+ save += GetWordAddress(dbv.ptszVal, k);
switch (command[0]) {
case 'M':
CallChatEvent(WINDOW_HIDDEN, (LPARAM)&gce);
@@ -1943,8 +1944,8 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg) ptrT UserList(mir_tstrdup(m_whoReply.c_str()));
const TCHAR* p1 = UserList;
m_whoReply = _T("");
- CONTACT user = { (TCHAR*)pmsg->parameters[1].c_str(), NULL, NULL, false, true, false };
- MCONTACT hContact = CList_FindContact(&user);
+ CONTACT ccUser = { (TCHAR*)pmsg->parameters[1].c_str(), NULL, NULL, false, true, false };
+ MCONTACT hContact = CList_FindContact(&ccUser);
if (hContact && getByte(hContact, "AdvancedMode", 0) == 1) {
ptrT DBHost(getTStringA(hContact, "UHost"));
@@ -2229,23 +2230,23 @@ bool CIrcProto::OnIrc_SUPPORT(const CIrcMessage* pmsg) p1 = _tcschr(temp, '=');
p1++;
sUserModePrefixes = p1;
- for (int i = 0; i < sUserModePrefixes.GetLength() + 1; i++) {
- if (sUserModePrefixes[i] == '@')
- sUserModes.SetAt(i, 'o');
- else if (sUserModePrefixes[i] == '+')
- sUserModes.SetAt(i, 'v');
- else if (sUserModePrefixes[i] == '-')
- sUserModes.SetAt(i, 'u');
- else if (sUserModePrefixes[i] == '%')
- sUserModes.SetAt(i, 'h');
- else if (sUserModePrefixes[i] == '!')
- sUserModes.SetAt(i, 'a');
- else if (sUserModePrefixes[i] == '*')
- sUserModes.SetAt(i, 'q');
- else if (sUserModePrefixes[i] == '\0')
- sUserModes.SetAt(i, '\0');
+ for (int n = 0; n < sUserModePrefixes.GetLength() + 1; n++) {
+ if (sUserModePrefixes[n] == '@')
+ sUserModes.SetAt(n, 'o');
+ else if (sUserModePrefixes[n] == '+')
+ sUserModes.SetAt(n, 'v');
+ else if (sUserModePrefixes[n] == '-')
+ sUserModes.SetAt(n, 'u');
+ else if (sUserModePrefixes[n] == '%')
+ sUserModes.SetAt(n, 'h');
+ else if (sUserModePrefixes[n] == '!')
+ sUserModes.SetAt(n, 'a');
+ else if (sUserModePrefixes[n] == '*')
+ sUserModes.SetAt(n, 'q');
+ else if (sUserModePrefixes[n] == '\0')
+ sUserModes.SetAt(n, '\0');
else
- sUserModes.SetAt(i, '_');
+ sUserModes.SetAt(n, '_');
}
}
}
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp index 95e09dd869..d5967a7b22 100644 --- a/protocols/IRCG/src/input.cpp +++ b/protocols/IRCG/src/input.cpp @@ -102,9 +102,9 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window) CMString alias(m_alias);
const TCHAR* p3 = _tcsstr(alias.c_str(), (GetWord(line, 0) + _T(" ")).c_str());
if (p3 != alias.c_str()) {
- CMString S = _T("\r\n");
- S += GetWord(line, 0) + _T(" ");
- p3 = _tcsstr(alias.c_str(), S.c_str());
+ CMString str = _T("\r\n");
+ str += GetWord(line, 0) + _T(" ");
+ p3 = _tcsstr(alias.c_str(), str.c_str());
if (p3)
p3 += 2;
}
@@ -115,32 +115,30 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window) p4 = _tcschr(p3, '\0');
*(TCHAR*)p4 = 0;
- CMString S = p3;
- S.Replace(_T("##"), window);
- S.Replace(_T("$?"), _T("%question"));
+ CMString str = p3;
+ str.Replace(_T("##"), window);
+ str.Replace(_T("$?"), _T("%question"));
+ TCHAR buf[5];
for (int index = 1; index < 8; index++) {
- TCHAR str[5];
- mir_sntprintf(str, _countof(str), _T("#$%u"), index);
+ mir_sntprintf(buf, _countof(buf), _T("#$%u"), index);
if (!GetWord(line, index).IsEmpty() && IsChannel(GetWord(line, index)))
- S.Replace(str, GetWord(line, index).c_str());
+ str.Replace(buf, GetWord(line, index).c_str());
else {
CMString S1 = _T("#");
S1 += GetWord(line, index);
- S.Replace(str, S1.c_str());
+ str.Replace(buf, S1.c_str());
}
}
for (int index2 = 1; index2 < 8; index2++) {
- TCHAR str[5];
- mir_sntprintf(str, _countof(str), _T("$%u-"), index2);
- S.Replace(str, GetWordAddress(line, index2));
+ mir_sntprintf(buf, _countof(buf), _T("$%u-"), index2);
+ str.Replace(buf, GetWordAddress(line, index2));
}
for (int index3 = 1; index3 < 8; index3++) {
- TCHAR str[5];
- mir_sntprintf(str, _countof(str), _T("$%u"), index3);
- S.Replace(str, GetWord(line, index3).c_str());
+ mir_sntprintf(buf, _countof(buf), _T("$%u"), index3);
+ str.Replace(buf, GetWord(line, index3).c_str());
}
- Messageout += GetWordAddress(S.c_str(), 1);
+ Messageout += GetWordAddress(str.c_str(), 1);
}
else Messageout += line;
}
@@ -212,16 +210,13 @@ static void __stdcall sttSetTimerOff(void* _pro) ppro->KillChatTimer(ppro->OnlineNotifTimer3);
}
-BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hContact)
+BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR *window, MCONTACT hContact)
{
- TCHAR temp[30];
- mir_tstrncpy(temp, GetWord(text.c_str(), 0).c_str(), 29);
- CharLower(temp);
- CMString command = temp;
- CMString one = GetWord(text.c_str(), 1);
- CMString two = GetWord(text.c_str(), 2);
- CMString three = GetWord(text.c_str(), 3);
- CMString therest = GetWordAddress(text.c_str(), 4);
+ CMString command(GetWord(text, 0)); command.MakeLower();
+ CMString one = GetWord(text, 1);
+ CMString two = GetWord(text, 2);
+ CMString three = GetWord(text, 3);
+ CMString therest = GetWordAddress(text, 4);
if (command == _T("/servershow") || command == _T("/serverhide")) {
if (m_useServer) {
@@ -302,15 +297,15 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta }
else IgnoreFlags = _T("qnidc");
- CMString m_network;
+ CMString szNetwork;
if (three.IsEmpty())
- m_network = m_info.sNetwork;
+ szNetwork = m_info.sNetwork;
else
- m_network = three;
+ szNetwork = three;
- AddIgnore(one.c_str(), IgnoreFlags.c_str(), m_network.c_str());
+ AddIgnore(one.c_str(), IgnoreFlags.c_str(), szNetwork.c_str());
- mir_sntprintf(temp, TranslateT("%s on %s is now ignored (+%s)"), one.c_str(), m_network.c_str(), IgnoreFlags.c_str());
+ mir_sntprintf(temp, TranslateT("%s on %s is now ignored (+%s)"), one.c_str(), szNetwork.c_str(), IgnoreFlags.c_str());
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
}
return true;
@@ -333,21 +328,21 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta if (one.IsEmpty())
return true;
- DoUserhostWithReason(1, _T("U"), false, temp);
+ DoUserhostWithReason(1, _T("U"), false, command);
return false;
}
if (command == _T("/joinx")) {
if (!one.IsEmpty()) {
for (int i = 1;; i++) {
- CMString tmp = GetWord(text.c_str(), i);
+ CMString tmp = GetWord(text, i);
if (tmp.IsEmpty())
break;
AddToJTemp('X', tmp);
}
- PostIrcMessage(_T("/JOIN %s"), GetWordAddress(text.c_str(), 1));
+ PostIrcMessage(_T("/JOIN %s"), GetWordAddress(text, 1));
}
return true;
}
@@ -355,14 +350,14 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta if (command == _T("/joinm")) {
if (!one.IsEmpty()) {
for (int i = 1;; i++) {
- CMString tmp = GetWord(text.c_str(), i);
+ CMString tmp = GetWord(text, i);
if (tmp.IsEmpty())
break;
AddToJTemp('M', tmp);
}
- PostIrcMessage(_T("/JOIN %s"), GetWordAddress(text.c_str(), 1));
+ PostIrcMessage(_T("/JOIN %s"), GetWordAddress(text, 1));
}
return true;
}
@@ -485,7 +480,7 @@ 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.c_str(), 1));
+ PostIrcMessage(_T("/JOIN %s"), GetWordAddress(text, 1));
return true;
}
@@ -498,9 +493,8 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta int minutes = (int)m_noOfChannels / 4000;
int minutes2 = (int)m_noOfChannels / 9000;
- TCHAR text[256];
- mir_sntprintf(text, 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, text, TranslateT("IRC warning"), MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) == IDYES)) {
+ 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"));
return false;
@@ -628,16 +622,16 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta if (ulAdr) {
CONTACT user = { (TCHAR*)two.c_str(), NULL, NULL, false, false, true };
- MCONTACT hContact = CList_AddContact(&user, false, false);
- if (hContact) {
+ MCONTACT ccNew = CList_AddContact(&user, false, false);
+ if (ccNew) {
CMString s;
- if (getByte(hContact, "AdvancedMode", 0) == 0)
+ if (getByte(ccNew, "AdvancedMode", 0) == 0)
DoUserhostWithReason(1, (_T("S") + two).c_str(), true, two.c_str());
else {
DBVARIANT dbv1;
CMString S = _T("S");
- if (!getTString(hContact, "UWildcard", &dbv1)) {
+ if (!getTString(ccNew, "UWildcard", &dbv1)) {
S += dbv1.ptszVal;
DoUserhostWithReason(2, S.c_str(), true, dbv1.ptszVal);
db_free(&dbv1);
@@ -649,14 +643,14 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta }
if (three.IsEmpty())
- CallService(MS_FILE_SENDFILE, hContact, 0);
+ CallService(MS_FILE_SENDFILE, ccNew, 0);
else {
CMString temp = GetWordAddress(text.c_str(), 3);
TCHAR* pp[2];
TCHAR* p = (TCHAR*)temp.c_str();
pp[0] = p;
pp[1] = NULL;
- CallService(MS_FILE_SENDSPECIFICFILEST, hContact, (LPARAM)pp);
+ CallService(MS_FILE_SENDSPECIFICFILEST, ccNew, (LPARAM)pp);
}
}
}
@@ -679,22 +673,22 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta if (ulAdr) {
CMString contact = two; contact += DCCSTRING;
CONTACT user = { (TCHAR*)contact.c_str(), NULL, NULL, false, false, true };
- MCONTACT hContact = CList_AddContact(&user, false, false);
- setByte(hContact, "DCC", 1);
+ MCONTACT ccNew = CList_AddContact(&user, false, false);
+ setByte(ccNew, "DCC", 1);
int iPort = 0;
- if (hContact) {
+ if (ccNew) {
DCCINFO* dci = new DCCINFO;
- dci->hContact = hContact;
+ dci->hContact = ccNew;
dci->sContactName = two;
dci->iType = DCC_CHAT;
dci->bSender = true;
CDccSession* dcc = new CDccSession(this, dci);
- CDccSession* olddcc = FindDCCSession(hContact);
+ CDccSession* olddcc = FindDCCSession(ccNew);
if (olddcc)
olddcc->Disconnect();
- AddDCCSession(hContact, dcc);
+ AddDCCSession(ccNew, dcc);
iPort = dcc->Connect();
}
@@ -852,7 +846,7 @@ bool CIrcProto::PostIrcMessageWnd(TCHAR *window, MCONTACT hContact, const TCHAR return 0;
CHANNELINFO *wi = (CHANNELINFO *)DoEvent(GC_EVENT_GETITEMDATA, windowname, NULL, NULL, NULL, NULL, NULL, FALSE, FALSE, 0);
- int codepage = (wi) ? wi->codepage : getCodepage();
+ int cp = (wi) ? wi->codepage : getCodepage();
// process the message
while (!Message.IsEmpty()) {
@@ -876,7 +870,7 @@ bool CIrcProto::PostIrcMessageWnd(TCHAR *window, MCONTACT hContact, const TCHAR continue;
CMString S = GetWordAddress(DoThis.c_str(), 1);
- SendIrcMessage(S.c_str(), true, codepage);
+ SendIrcMessage(S.c_str(), true, cp);
continue;
}
@@ -918,12 +912,12 @@ bool CIrcProto::PostIrcMessageWnd(TCHAR *window, MCONTACT hContact, const TCHAR }
else if (IsConnected()) {
FormatMsg(DoThis);
- SendIrcMessage(DoThis.c_str(), false, codepage);
+ SendIrcMessage(DoThis.c_str(), false, cp);
}
}
else {
FormatMsg(DoThis);
- SendIrcMessage(DoThis.c_str(), true, codepage);
+ SendIrcMessage(DoThis.c_str(), true, cp);
}
}
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index 5961bcf5f2..8b40818a9e 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -168,13 +168,13 @@ int CIrcProto::getCodepage() const return (con != NULL) ? codepage : CP_ACP; } -void CIrcProto::SendIrcMessage(const TCHAR* msg, bool bNotify, int codepage) +void CIrcProto::SendIrcMessage(const TCHAR* msg, bool bNotify, int cp) { - if (codepage == -1) - codepage = getCodepage(); + if (cp == -1) + cp = getCodepage(); if (this) { - char* str = mir_t2a_cp(msg, codepage); + char* str = mir_t2a_cp(msg, cp); rtrim(str); int cbLen = (int)mir_strlen(str); str = (char*)mir_realloc(str, cbLen + 3); @@ -183,7 +183,7 @@ void CIrcProto::SendIrcMessage(const TCHAR* msg, bool bNotify, int codepage) mir_free(str); if (bNotify) { - CIrcMessage ircMsg(this, msg, codepage); + CIrcMessage ircMsg(this, msg, cp); if (!ircMsg.sCommand.IsEmpty() && ircMsg.sCommand != _T("QUIT")) Notify(&ircMsg); } @@ -232,16 +232,16 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info) NLSend("PASS %s\r\n", info.sPassword.c_str()); NLSend(_T("NICK %s\r\n"), info.sNick.c_str()); - CMString m_userID = GetWord(info.sUserID.c_str(), 0); + CMString userID = GetWord(info.sUserID.c_str(), 0); TCHAR szHostName[MAX_PATH]; DWORD cbHostName = _countof(szHostName); GetComputerName(szHostName, &cbHostName); CMString HostName = GetWord(szHostName, 0); - if (m_userID.IsEmpty()) - m_userID = _T("Miranda"); + if (userID.IsEmpty()) + userID = _T("Miranda"); if (HostName.IsEmpty()) HostName = _T("host"); - NLSend(_T("USER %s %s %s :%s\r\n"), m_userID.c_str(), HostName.c_str(), _T("server"), info.sFullName.c_str()); + NLSend(_T("USER %s %s %s :%s\r\n"), userID.c_str(), HostName.c_str(), _T("server"), info.sFullName.c_str()); return con != NULL; } diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 19033eabdc..dff5b71451 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -770,7 +770,7 @@ void CConnectPrefsDlg::OnApply() int j = m_serverCombo.GetCount();
if (j != CB_ERR && j != 0) {
for (int index2 = 0; index2 < j; index2++) {
- SERVER_INFO* pData = (SERVER_INFO*)m_serverCombo.GetItemData(index2);
+ pData = (SERVER_INFO*)m_serverCombo.GetItemData(index2);
if (pData == NULL || (INT_PTR)pData == CB_ERR)
continue;
diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp index 3fd4b420d2..a0c98d3298 100644 --- a/protocols/IRCG/src/scripting.cpp +++ b/protocols/IRCG/src/scripting.cpp @@ -163,10 +163,10 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam) }
else if (sRequest == "channellist") {
CMString S = _T("");
- int i = CallServiceSync(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)m_szModuleName);
- if (i >= 0) {
+ int n = CallServiceSync(MS_GC_GETSESSIONCOUNT, 0, (LPARAM)m_szModuleName);
+ if (n >= 0) {
int j = 0;
- while (j < i) {
+ while (j < n) {
GC_INFO gci = { 0 };
gci.Flags = GCF_BYINDEX | GCF_ID;
gci.pszModule = m_szModuleName;
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp index 97b5bcf6d9..c21a4760d6 100644 --- a/protocols/IRCG/src/tools.cpp +++ b/protocols/IRCG/src/tools.cpp @@ -597,10 +597,10 @@ bool CIrcProto::AddWindowItemData(CMString window, const TCHAR* pszLimit, const return false;
}
-void CIrcProto::FindLocalIP(HANDLE con) // inspiration from jabber
+void CIrcProto::FindLocalIP(HANDLE hConn) // inspiration from jabber
{
// Determine local IP
- int socket = CallService(MS_NETLIB_GETSOCKET, (WPARAM)con, 0);
+ int socket = CallService(MS_NETLIB_GETSOCKET, (WPARAM)hConn, 0);
if (socket != INVALID_SOCKET) {
struct sockaddr_in saddr;
int len = sizeof(saddr);
|