summaryrefslogtreecommitdiff
path: root/protocols/IRCG
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/IRCG')
-rw-r--r--protocols/IRCG/res/IRC.rc25
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp136
-rw-r--r--protocols/IRCG/src/irc_dlg.h5
-rw-r--r--protocols/IRCG/src/irclib.cpp8
-rw-r--r--protocols/IRCG/src/ircproto.cpp6
-rw-r--r--protocols/IRCG/src/options.cpp14
-rw-r--r--protocols/IRCG/src/resource.h7
-rw-r--r--protocols/IRCG/src/stdafx.h5
-rw-r--r--protocols/IRCG/src/version.h2
9 files changed, 141 insertions, 67 deletions
diff --git a/protocols/IRCG/res/IRC.rc b/protocols/IRCG/res/IRC.rc
index 3b7e3a71b9..d2e8a5988a 100644
--- a/protocols/IRCG/res/IRC.rc
+++ b/protocols/IRCG/res/IRC.rc
@@ -58,13 +58,13 @@ BEGIN
LTEXT "Server name",IDC_STATIC,10,22,125,8,0,WS_EX_TRANSPARENT
COMBOBOX IDC_SERVERCOMBO,10,30,125,90,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "Internet address",IDC_STATIC,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,10,45,81,8,WS_EX_TRANSPARENT
- EDITTEXT IDC_SERVER,10,53,88,12,ES_AUTOHSCROLL | ES_READONLY | WS_GROUP | WS_TABSTOP
+ EDITTEXT IDC_SERVER,10,53,88,12,ES_AUTOHSCROLL | ES_READONLY | WS_GROUP
LTEXT "SSL",IDC_STATIC,107,45,28,8,0,WS_EX_TRANSPARENT
- EDITTEXT IDC_SSL,107,53,28,12,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER | WS_TABSTOP,WS_EX_RIGHT
- LTEXT "Port range",IDC_STATIC,10,67,125,8,0,WS_EX_TRANSPARENT
- EDITTEXT IDC_PORT,10,75,50,12,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER | WS_TABSTOP,WS_EX_RIGHT
- LTEXT "->",IDC_STATIC,71,75,8,8
- EDITTEXT IDC_PORT2,85,75,50,12,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER | WS_TABSTOP,WS_EX_RIGHT
+ EDITTEXT IDC_SSL,107,53,28,12,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER,WS_EX_RIGHT
+ LTEXT "Port range",IDC_STATIC,10,67,79,8,0,WS_EX_TRANSPARENT
+ EDITTEXT IDC_PORT,10,75,33,12,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER,WS_EX_RIGHT
+ LTEXT "->",IDC_STATIC,45,76,8,8
+ EDITTEXT IDC_PORT2,54,75,33,12,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER,WS_EX_RIGHT
LTEXT "Password",IDC_STATIC,10,90,125,8,0,WS_EX_TRANSPARENT
EDITTEXT IDC_PASS,10,100,125,12,ES_PASSWORD | ES_AUTOHSCROLL
CONTROL "&Add",IDC_ADDSERVER,"MButtonClass",WS_DISABLED | WS_TABSTOP,16,116,27,14,WS_EX_NOACTIVATE | 0x10000000L
@@ -107,6 +107,7 @@ BEGIN
RTEXT "Don't check if more than (users):",IDC_STATIC,142,212,124,8
EDITTEXT IDC_LIMIT,267,210,29,12,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT
CONTROL "Spin2",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,284,209,11,14
+ CONTROL "SASL",IDC_SASL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,103,77,32,10
END
IDD_INFO DIALOGEX 0, 0, 267, 214
@@ -694,6 +695,18 @@ END
//
IDR_SERVERS TEXT "..\\docs\\IRC_servers.ini"
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// AFX_DIALOG_LAYOUT
+//
+
+IDD_PREFS_CONNECT AFX_DIALOG_LAYOUT
+BEGIN
+ 0
+END
+
#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index 6694c24698..840d96eeb3 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -258,7 +258,7 @@ void __cdecl CIrcProto::ResolveIPThread(void *di)
delete ipr;
}
-bool CIrcProto::OnIrc_PING(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_PING(const CIrcMessage *pmsg)
{
wchar_t szResponse[100];
if (pmsg->parameters.getCount() > 0)
@@ -269,7 +269,7 @@ bool CIrcProto::OnIrc_PING(const CIrcMessage* pmsg)
return false;
}
-bool CIrcProto::OnIrc_WELCOME(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_WELCOME(const CIrcMessage *pmsg)
{
if (pmsg->parameters[0] != m_info.sNick)
m_info.sNick = pmsg->parameters[0];
@@ -294,7 +294,7 @@ bool CIrcProto::OnIrc_WELCOME(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_WHOTOOLONG(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_WHOTOOLONG(const CIrcMessage *pmsg)
{
CMStringW command = GetNextUserhostReason(2);
if (command[0] == 'U')
@@ -303,7 +303,7 @@ bool CIrcProto::OnIrc_WHOTOOLONG(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_BACKFROMAWAY(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_BACKFROMAWAY(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming) {
int Temp = m_iStatus;
@@ -318,7 +318,7 @@ bool CIrcProto::OnIrc_BACKFROMAWAY(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_SETAWAY(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_SETAWAY(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming) {
int Temp = m_iDesiredStatus;
@@ -357,7 +357,7 @@ bool CIrcProto::OnIrc_SETAWAY(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_JOIN(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_JOIN(const CIrcMessage *pmsg)
{
if (pmsg->parameters.getCount() > 0 && pmsg->m_bIncoming && pmsg->prefix.sNick != m_info.sNick) {
CMStringW host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
@@ -369,7 +369,7 @@ bool CIrcProto::OnIrc_JOIN(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_QUIT(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_QUIT(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming) {
CMStringW host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
@@ -384,7 +384,7 @@ bool CIrcProto::OnIrc_QUIT(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_PART(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_PART(const CIrcMessage *pmsg)
{
if (pmsg->parameters.getCount() > 0 && pmsg->m_bIncoming) {
CMStringW host = pmsg->prefix.sUser + L"@" + pmsg->prefix.sHost;
@@ -399,7 +399,7 @@ bool CIrcProto::OnIrc_PART(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_KICK(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_KICK(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1)
DoEvent(GC_EVENT_KICK, pmsg->parameters[0], pmsg->parameters[1], pmsg->parameters.getCount() > 2 ? pmsg->parameters[2].c_str() : nullptr, pmsg->prefix.sNick, nullptr, NULL, true, false);
@@ -422,7 +422,7 @@ bool CIrcProto::OnIrc_KICK(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_MODEQUERY(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_MODEQUERY(const CIrcMessage *pmsg)
{
if (pmsg->parameters.getCount() > 2 && pmsg->m_bIncoming && IsChannel(pmsg->parameters[1])) {
CMStringW sPassword = L"";
@@ -456,7 +456,7 @@ bool CIrcProto::OnIrc_MODEQUERY(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_MODE(const CIrcMessage *pmsg)
{
bool flag = false;
bool bContainsValidModes = false;
@@ -567,7 +567,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_NICK(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_NICK(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 0) {
bool bIsMe = pmsg->prefix.sNick == m_info.sNick ? true : false;
@@ -596,7 +596,7 @@ bool CIrcProto::OnIrc_NICK(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_NOTICE(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_NOTICE(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1) {
if (IsCTCP(pmsg))
@@ -639,7 +639,7 @@ bool CIrcProto::OnIrc_NOTICE(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_YOURHOST(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_YOURHOST(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming) {
static const wchar_t* lpszFmt = L"Your host is %99[^ \x5b,], running version %99s";
@@ -654,7 +654,7 @@ bool CIrcProto::OnIrc_YOURHOST(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_INVITE(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_INVITE(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && (m_ignore && IsIgnored(pmsg->prefix.sNick, pmsg->prefix.sUser, pmsg->prefix.sHost, 'i')))
return true;
@@ -666,7 +666,7 @@ bool CIrcProto::OnIrc_INVITE(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_PINGPONG(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_PINGPONG(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->sCommand == L"PING") {
wchar_t szResponse[100];
@@ -677,7 +677,7 @@ bool CIrcProto::OnIrc_PINGPONG(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage *pmsg)
{
if (pmsg->parameters.getCount() > 1) {
if (IsCTCP(pmsg))
@@ -727,7 +727,7 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
+bool CIrcProto::IsCTCP(const CIrcMessage *pmsg)
{
// is it a ctcp command, i e is the first and last characer of a PRIVMSG or NOTICE text ASCII 1
CMStringW mess = pmsg->parameters[1];
@@ -1232,7 +1232,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_NAMES(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_NAMES(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 3)
sNamesList += pmsg->parameters[3] + L" ";
@@ -1240,7 +1240,7 @@ bool CIrcProto::OnIrc_NAMES(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1) {
CMStringW name = L"a";
@@ -1411,7 +1411,7 @@ bool CIrcProto::OnIrc_ENDNAMES(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_INITIALTOPIC(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_INITIALTOPIC(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 2) {
AddWindowItemData(pmsg->parameters[1], nullptr, nullptr, nullptr, pmsg->parameters[2]);
@@ -1423,7 +1423,7 @@ bool CIrcProto::OnIrc_INITIALTOPIC(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_INITIALTOPICNAME(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_INITIALTOPICNAME(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 3) {
wchar_t tTimeBuf[128], *tStopStr;
@@ -1437,7 +1437,7 @@ bool CIrcProto::OnIrc_INITIALTOPICNAME(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_TOPIC(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_TOPIC(const CIrcMessage *pmsg)
{
if (pmsg->parameters.getCount() > 1 && pmsg->m_bIncoming) {
DoEvent(GC_EVENT_TOPIC, pmsg->parameters[0], pmsg->prefix.sNick, pmsg->parameters[1], nullptr, sTopicTime.IsEmpty() ? nullptr : sTopicTime.c_str(), NULL, true, false);
@@ -1457,7 +1457,7 @@ static void __stdcall sttShowDlgList(void* param)
SetEvent(ppro->m_evWndCreate);
}
-bool CIrcProto::OnIrc_LISTSTART(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_LISTSTART(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming) {
CallFunctionAsync(sttShowDlgList, this);
@@ -1469,7 +1469,7 @@ bool CIrcProto::OnIrc_LISTSTART(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_LIST(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_LIST(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming == 1 && m_listDlg && pmsg->parameters.getCount() > 2) {
m_channelNumber++;
@@ -1526,7 +1526,7 @@ bool CIrcProto::OnIrc_LIST(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_LISTEND(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_LISTEND(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && m_listDlg) {
EnableWindow(GetDlgItem(m_listDlg->GetHwnd(), IDC_JOIN), true);
@@ -1551,7 +1551,7 @@ bool CIrcProto::OnIrc_LISTEND(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_BANLIST(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_BANLIST(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 2) {
if (m_managerDlg->GetHwnd() && (
@@ -1580,7 +1580,7 @@ bool CIrcProto::OnIrc_BANLIST(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_BANLISTEND(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_BANLISTEND(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1) {
if (m_managerDlg->GetHwnd() &&
@@ -1617,7 +1617,7 @@ static void __stdcall sttShowWhoisWnd(void* param)
delete pmsg;
}
-bool CIrcProto::OnIrc_WHOIS_NAME(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_WHOIS_NAME(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 5 && m_manualWhoisCount > 0) {
CallFunctionAsync(sttShowWhoisWnd, new CIrcMessage(*pmsg));
@@ -1627,7 +1627,7 @@ bool CIrcProto::OnIrc_WHOIS_NAME(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_WHOIS_CHANNELS(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_WHOIS_CHANNELS(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && m_whoisDlg && pmsg->parameters.getCount() > 2 && m_manualWhoisCount > 0)
m_whoisDlg->m_InfoChannels.SetText(pmsg->parameters[2]);
@@ -1635,7 +1635,7 @@ bool CIrcProto::OnIrc_WHOIS_CHANNELS(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_WHOIS_AWAY(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_WHOIS_AWAY(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && m_whoisDlg && pmsg->parameters.getCount() > 2 && m_manualWhoisCount > 0)
m_whoisDlg->m_InfoAway2.SetText(pmsg->parameters[2]);
@@ -1645,7 +1645,7 @@ bool CIrcProto::OnIrc_WHOIS_AWAY(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_WHOIS_OTHER(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_WHOIS_OTHER(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && m_whoisDlg && pmsg->parameters.getCount() > 2 && m_manualWhoisCount > 0) {
wchar_t temp[1024], temp2[1024];
@@ -1658,7 +1658,7 @@ bool CIrcProto::OnIrc_WHOIS_OTHER(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_WHOIS_END(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_WHOIS_END(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1 && m_manualWhoisCount < 1) {
CONTACT user = { pmsg->parameters[1], nullptr, nullptr, false, false, true };
@@ -1674,7 +1674,7 @@ bool CIrcProto::OnIrc_WHOIS_END(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_WHOIS_IDLE(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_WHOIS_IDLE(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && m_whoisDlg && pmsg->parameters.getCount() > 2 && m_manualWhoisCount > 0) {
int S = _wtoi(pmsg->parameters[2]);
@@ -1708,7 +1708,7 @@ bool CIrcProto::OnIrc_WHOIS_IDLE(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_WHOIS_SERVER(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_WHOIS_SERVER(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && m_whoisDlg && pmsg->parameters.getCount() > 2 && m_manualWhoisCount > 0)
m_whoisDlg->m_InfoServer.SetText(pmsg->parameters[2]);
@@ -1716,7 +1716,7 @@ bool CIrcProto::OnIrc_WHOIS_SERVER(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_WHOIS_AUTH(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 == L"330")
@@ -1730,7 +1730,7 @@ bool CIrcProto::OnIrc_WHOIS_AUTH(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_WHOIS_NO_USER(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_WHOIS_NO_USER(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 2 && !IsChannel(pmsg->parameters[1])) {
if (m_whoisDlg)
@@ -1782,7 +1782,7 @@ static void __stdcall sttShowNickWnd(void* param)
delete pmsg;
}
-bool CIrcProto::OnIrc_NICK_ERR(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_NICK_ERR(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming) {
if (nickflag && ((m_alternativeNick[0] != 0)) && (pmsg->parameters.getCount() > 2 && mir_wstrcmp(pmsg->parameters[1], m_alternativeNick))) {
@@ -1801,7 +1801,7 @@ bool CIrcProto::OnIrc_NICK_ERR(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_JOINERROR(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_JOINERROR(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming) {
DBVARIANT dbv;
@@ -1831,7 +1831,7 @@ bool CIrcProto::OnIrc_JOINERROR(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_UNKNOWN(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_UNKNOWN(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 0) {
if (pmsg->parameters[0] == L"WHO" && GetNextUserhostReason(2) != L"U")
@@ -1843,7 +1843,7 @@ bool CIrcProto::OnIrc_UNKNOWN(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_ENDMOTD(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_ENDMOTD(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && !bPerformDone)
DoOnConnect(pmsg);
@@ -1851,7 +1851,7 @@ bool CIrcProto::OnIrc_ENDMOTD(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_NOOFCHANNELS(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_NOOFCHANNELS(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1)
m_noOfChannels = _wtoi(pmsg->parameters[1]);
@@ -1863,7 +1863,7 @@ bool CIrcProto::OnIrc_NOOFCHANNELS(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_ERROR(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_ERROR(const CIrcMessage *pmsg)
{
if (pmsg->m_bIncoming && !m_disableErrorPopups && m_iDesiredStatus != ID_STATUS_OFFLINE) {
CMStringW S;
@@ -1877,7 +1877,7 @@ bool CIrcProto::OnIrc_ERROR(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_WHO_END(const CIrcMessage *pmsg)
{
CMStringW command = GetNextUserhostReason(2);
if (command[0] == 'S') {
@@ -1974,7 +1974,7 @@ bool CIrcProto::OnIrc_WHO_END(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_WHO_REPLY(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_WHO_REPLY(const CIrcMessage *pmsg)
{
CMStringW command = PeekAtReasons(2);
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 6 && command[0] == 'S') {
@@ -1991,7 +1991,7 @@ bool CIrcProto::OnIrc_WHO_REPLY(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_TRYAGAIN(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_TRYAGAIN(const CIrcMessage *pmsg)
{
CMStringW command = L"";
if (pmsg->m_bIncoming && pmsg->parameters.getCount() > 1) {
@@ -2006,7 +2006,7 @@ bool CIrcProto::OnIrc_TRYAGAIN(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage *pmsg)
{
CMStringW command;
if (pmsg->m_bIncoming) {
@@ -2145,7 +2145,45 @@ bool CIrcProto::OnIrc_USERHOST_REPLY(const CIrcMessage* pmsg)
return true;
}
-bool CIrcProto::OnIrc_SUPPORT(const CIrcMessage* pmsg)
+bool CIrcProto::OnIrc_AUTH_OK(const CIrcMessage *pmsg)
+{
+ if (pmsg->m_bIncoming && !bPerformDone)
+ DoOnConnect(pmsg);
+
+ return true;
+}
+
+bool CIrcProto::OnIrc_AUTH_FAIL(const CIrcMessage*)
+{
+ int Temp = m_iDesiredStatus;
+ m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_WRONGPASSWORD);
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)Temp, ID_STATUS_OFFLINE);
+ return false;
+}
+
+bool CIrcProto::OnIrc_AUTHENTICATE(const CIrcMessage *pmsg)
+{
+ if (m_bUseSASL && pmsg->parameters[0] == "+") {
+ CMStringA payload(FORMAT, "%S%c%S%c%s%c", m_name, 0, m_name, 0, m_password, 0);
+ NLSend("AUTHENTICATE %s\r\n", ptrA(mir_base64_encode(payload, payload.GetLength())).get());
+ }
+
+ return true;
+}
+
+bool CIrcProto::OnIrc_CAP(const CIrcMessage *pmsg)
+{
+ if (pmsg->parameters.getCount() < 3)
+ return true;
+
+ if (m_bUseSASL && pmsg->parameters[1] == "ACK" && pmsg->parameters[2].Trim() == "sasl") {
+ NLSend("AUTHENTICATE PLAIN\r\n");
+ }
+ return true;
+}
+
+bool CIrcProto::OnIrc_SUPPORT(const CIrcMessage *pmsg)
{
static const wchar_t *lpszFmt = L"Try server %99[^ ,], port %19s";
wchar_t szAltServer[100];
@@ -2224,7 +2262,7 @@ bool CIrcProto::OnIrc_SUPPORT(const CIrcMessage* pmsg)
return true;
}
-void CIrcProto::OnIrcDefault(const CIrcMessage* pmsg)
+void CIrcProto::OnIrcDefault(const CIrcMessage *pmsg)
{
ShowMessage(pmsg);
}
diff --git a/protocols/IRCG/src/irc_dlg.h b/protocols/IRCG/src/irc_dlg.h
index a9610a97f3..0a23223930 100644
--- a/protocols/IRCG/src/irc_dlg.h
+++ b/protocols/IRCG/src/irc_dlg.h
@@ -203,8 +203,9 @@ struct CConnectPrefsDlg : public CProtoDlgBase < CIrcProto >
CCtrlCheck m_forceVisible, m_rejoinOnKick, m_rejoinChannels, m_disableError,
m_address, m_useServer, m_showServer, m_keepAlive, m_autoJoin,
- m_oldStyle, m_onlineNotif, m_channelAway, m_enableServer;
- CCtrlEdit m_onlineTimer, m_limit, m_spin1, m_spin2, m_ssl;
+ m_oldStyle, m_onlineNotif, m_channelAway, m_enableServer, m_useSasl;
+ CCtrlEdit m_onlineTimer, m_limit, m_ssl;
+ CCtrlSpin m_spin1, m_spin2;
CConnectPrefsDlg(CIrcProto* _pro);
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp
index 94f736affa..0033ec2d6c 100644
--- a/protocols/IRCG/src/irclib.cpp
+++ b/protocols/IRCG/src/irclib.cpp
@@ -224,11 +224,12 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info)
m_info = info;
+ if (m_bUseSASL)
+ NLSend("CAP REQ :sasl\r\n");
+
// start receiving messages from host
ForkThread(&CIrcProto::ThreadProc, nullptr);
Sleep(100);
- if (info.sPassword.GetLength())
- NLSend("PASS %s\r\n", info.sPassword.c_str());
NLSend(L"NICK %s\r\n", info.sNick.c_str());
CMStringW userID = GetWord(info.sUserID.c_str(), 0);
@@ -242,6 +243,9 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info)
HostName = L"host";
NLSend(L"USER %s %s %s :%s\r\n", userID.c_str(), HostName.c_str(), L"server", info.sFullName.c_str());
+ if (!m_bUseSASL && info.sPassword.GetLength())
+ NLSend("PASS %s\r\n", info.sPassword.c_str());
+
return con != nullptr;
}
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index 869732806a..69b19da59b 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -82,6 +82,8 @@ CIrcProto::CIrcProto(const char* szModuleName, const wchar_t* tszUserName) :
IRC_MAP_ENTRY("NOTICE", NOTICE)
IRC_MAP_ENTRY("PING", PINGPONG)
IRC_MAP_ENTRY("PONG", PINGPONG)
+ IRC_MAP_ENTRY("CAP", CAP)
+ IRC_MAP_ENTRY("AUTHENTICATE", AUTHENTICATE)
IRC_MAP_ENTRY("INVITE", INVITE)
IRC_MAP_ENTRY("ERROR", ERROR)
IRC_MAP_ENTRY("001", WELCOME)
@@ -134,6 +136,10 @@ CIrcProto::CIrcProto(const char* szModuleName, const wchar_t* tszUserName) :
IRC_MAP_ENTRY("474", JOINERROR)
IRC_MAP_ENTRY("475", JOINERROR)
IRC_MAP_ENTRY("671", WHOIS_OTHER) //Encryption info (SSL connect)
+ IRC_MAP_ENTRY("903", AUTH_OK)
+ IRC_MAP_ENTRY("904", AUTH_FAIL)
+ IRC_MAP_ENTRY("905", AUTH_FAIL)
+ IRC_MAP_ENTRY("906", AUTH_FAIL)
}
CIrcProto::~CIrcProto()
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index 374500cb5f..0fedca772e 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -423,6 +423,7 @@ static TDbSetting ConnectSettings[] =
{ FIELD_OFFSET(CIrcProto, m_showAddresses), "ShowAddresses", DBVT_BYTE },
{ FIELD_OFFSET(CIrcProto, m_oldStyleModes), "OldStyleModes", DBVT_BYTE },
{ FIELD_OFFSET(CIrcProto, m_useServer), "UseServer", DBVT_BYTE, 0, 1 },
+ { FIELD_OFFSET(CIrcProto, m_bUseSASL), "UseSASL", DBVT_BYTE },
{ FIELD_OFFSET(CIrcProto, m_hideServerWindow), "HideServerWindow", DBVT_BYTE, 0, 1 },
{ FIELD_OFFSET(CIrcProto, m_serverComboSelection), "ServerComboSelection", DBVT_DWORD, 0 },
{ FIELD_OFFSET(CIrcProto, m_sendKeepAlive), "SendKeepAlive", DBVT_BYTE, 0, 1 },
@@ -457,6 +458,7 @@ CConnectPrefsDlg::CConnectPrefsDlg(CIrcProto* _pro)
m_keepAlive(this, IDC_KEEPALIVE),
m_autoJoin(this, IDC_AUTOJOIN),
m_oldStyle(this, IDC_OLDSTYLE),
+ m_useSasl(this, IDC_SASL),
m_onlineNotif(this, IDC_ONLINENOTIF),
m_channelAway(this, IDC_CHANNELAWAY),
m_enableServer(this, IDC_STARTUP),
@@ -509,10 +511,12 @@ void CConnectPrefsDlg::OnInitDialog()
}
}
- m_spin1.SendMsg(UDM_SETRANGE, 0, MAKELONG(999, 20));
- m_spin1.SendMsg(UDM_SETPOS, 0, MAKELONG(m_proto->m_onlineNotificationTime, 0));
- m_spin2.SendMsg(UDM_SETRANGE, 0, MAKELONG(200, 0));
- m_spin2.SendMsg(UDM_SETPOS, 0, MAKELONG(m_proto->m_onlineNotificationLimit, 0));
+ m_spin1.SetRange(999, 20);
+ m_spin1.SetPosition(m_proto->m_onlineNotificationTime);
+
+ m_spin2.SetRange(200);
+ m_spin2.SetPosition(m_proto->m_onlineNotificationLimit);
+
m_nick.SetText(m_proto->m_nick);
m_nick2.SetText(m_proto->m_alternativeNick);
m_userID.SetText(m_proto->m_userID);
@@ -522,6 +526,7 @@ void CConnectPrefsDlg::OnInitDialog()
m_identPort.SetText(m_proto->m_identPort);
m_address.SetState(m_proto->m_showAddresses);
m_oldStyle.SetState(m_proto->m_oldStyleModes);
+ m_useSasl.SetState(m_proto->m_bUseSASL);
m_channelAway.SetState(m_proto->m_channelAwayNotification);
m_onlineNotif.SetState(m_proto->m_autoOnlineNotification);
m_onlineTimer.Enable(m_proto->m_autoOnlineNotification);
@@ -708,6 +713,7 @@ void CConnectPrefsDlg::OnApply()
m_proto->m_showAddresses = m_address.GetState();
m_proto->m_oldStyleModes = m_oldStyle.GetState();
m_proto->m_useServer = m_useServer.GetState();
+ m_proto->m_bUseSASL = m_useSasl.GetState();
Menu_EnableItem(m_proto->hMenuServer, m_proto->m_useServer != 0);
diff --git a/protocols/IRCG/src/resource.h b/protocols/IRCG/src/resource.h
index b2462f00ca..6f21099b10 100644
--- a/protocols/IRCG/src/resource.h
+++ b/protocols/IRCG/src/resource.h
@@ -1,6 +1,6 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
-// Used by ..\res\IRC.rc
+// Used by w:\miranda-ng\protocols\IRCG\res\IRC.rc
//
#define ID_INFO_QUERY 3
#define IDD_PREFS_MAIN 101
@@ -184,6 +184,7 @@
#define IDC_FILTER_STRING 1235
#define IDC_BUTTON1 1236
#define IDC_FILTER_BTN 1237
+#define IDC_SASL 1238
#define ID_MENU1_OP 40013
#define ID_MENU1_DEOP 40014
#define ID_MENU1_VOICE 40015
@@ -242,9 +243,9 @@
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 203
+#define _APS_NEXT_RESOURCE_VALUE 204
#define _APS_NEXT_COMMAND_VALUE 40067
-#define _APS_NEXT_CONTROL_VALUE 1238
+#define _APS_NEXT_CONTROL_VALUE 1239
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/protocols/IRCG/src/stdafx.h b/protocols/IRCG/src/stdafx.h
index 4a5c6eea79..5428e0fe9c 100644
--- a/protocols/IRCG/src/stdafx.h
+++ b/protocols/IRCG/src/stdafx.h
@@ -324,6 +324,7 @@ struct CIrcProto : public PROTO<CIrcProto>
BYTE m_channelAwayNotification;
BYTE m_sendNotice;
BYTE m_utfAutodetect;
+ BYTE m_bUseSASL;
int m_codepage;
COLORREF colors[16];
HICON hIcon[13];
@@ -567,6 +568,10 @@ private:
bool OnIrc_WHO_END(const CIrcMessage *pmsg);
bool OnIrc_WHO_REPLY(const CIrcMessage *pmsg);
bool OnIrc_WHOTOOLONG(const CIrcMessage *pmsg);
+ bool OnIrc_AUTHENTICATE(const CIrcMessage *pmsg);
+ bool OnIrc_AUTH_OK(const CIrcMessage *pmsg);
+ bool OnIrc_AUTH_FAIL(const CIrcMessage *pmsg);
+ bool OnIrc_CAP(const CIrcMessage *pmsg);
bool IsCTCP(const CIrcMessage *pmsg);
diff --git a/protocols/IRCG/src/version.h b/protocols/IRCG/src/version.h
index 79f72dcd9b..4ef31cab0e 100644
--- a/protocols/IRCG/src/version.h
+++ b/protocols/IRCG/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 95
#define __RELEASE_NUM 7
-#define __BUILD_NUM 1
+#define __BUILD_NUM 2
#include <stdver.h>