Merge branch 'master' of github.com:znc/znc

This commit is contained in:
Alexey Sokolov
2012-07-02 13:20:51 +07:00
3 changed files with 19 additions and 7 deletions

View File

@@ -96,6 +96,7 @@ public:
virtual ~CClient();
void SendRequiredPasswordNotice();
void AcceptLogin(CUser& User);
void RefuseLogin(const CString& sReason);

View File

@@ -271,6 +271,8 @@ void CChan::ModeChange(const CString& sModes, const CNick* pOpNick) {
unsigned char uPerm = m_pNetwork->GetIRCSock()->GetPermFromMode(uMode);
if (uPerm) {
bool bNoChange = (pNick->HasPerm(uPerm) == bAdd);
if (bAdd) {
pNick->AddPerm(uPerm);
@@ -284,7 +286,6 @@ void CChan::ModeChange(const CString& sModes, const CNick* pOpNick) {
RemPerm(uPerm);
}
}
bool bNoChange = (pNick->HasPerm(uPerm) == bAdd);
if (uMode && pOpNick) {
NETWORKMODULECALL(OnChanPermission(*pOpNick, *pNick, *this, uMode, bAdd, bNoChange), m_pNetwork->GetUser(), m_pNetwork, NULL, NOTHING);

View File

@@ -69,6 +69,13 @@ CClient::~CClient() {
}
}
void CClient::SendRequiredPasswordNotice() {
PutClient(":irc.znc.in 464 " + GetNick() + " :Password required");
PutClient(":irc.znc.in NOTICE AUTH :*** "
"You need to send your password. "
"Try /quote PASS <username>:<password>");
}
void CClient::ReadLine(const CString& sData) {
CString sLine = sData;
@@ -132,11 +139,8 @@ void CClient::ReadLine(const CString& sData) {
m_bGotUser = true;
if (m_bGotPass) {
AuthUser();
} else {
PutClient(":irc.znc.in 464 " + GetNick() + " :Password required");
PutClient(":irc.znc.in NOTICE AUTH :*** "
"You need to send your password. "
"Try /quote PASS <username>:<password>");
} else if (!m_bInCap) {
SendRequiredPasswordNotice();
}
return; // Don't forward this msg. ZNC has already registered us.
@@ -808,7 +812,13 @@ void CClient::HandleCap(const CString& sLine)
m_bInCap = true;
} else if (sSubCmd.Equals("END")) {
m_bInCap = false;
AuthUser();
if (!IsAttached()) {
if (!m_pUser && m_bGotUser && !m_bGotPass) {
SendRequiredPasswordNotice();
} else {
AuthUser();
}
}
} else if (sSubCmd.Equals("REQ")) {
VCString vsTokens;
VCString::iterator it;