Permalink
Browse files

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

  • Loading branch information...
2 parents 28f6809 + ed5610f commit ba99a64c7cf27664629e7bda6fb4e14125985399 @DarthGandalf DarthGandalf committed Mar 30, 2012
Showing with 9 additions and 5 deletions.
  1. +1 −1 modules/imapauth.cpp
  2. +8 −4 src/IRCSock.cpp
View
@@ -134,7 +134,7 @@ void CIMAPSock::ReadLine(const CString& sLine) {
}
Write("AUTH LOGIN " + sUsername + " " + m_spAuth->GetPassword() + "\r\n");
- } else {
+ } else if (sLine.Left(5) == "AUTH ") {
CUser* pUser = CZNC::Get().FindUser(m_spAuth->GetUsername());
if (pUser && sLine.Equals("AUTH OK", false, 7)) {
View
@@ -330,10 +330,14 @@ void CIRCSock::ReadLine(const CString& sData) {
// The client doesn't support multi-prefix so we need to remove
// the other prefixes.
- CString sNewLine = sServer + " 352 " + sLine.Token(2) + " " + \
- sLine.Token(3) + " " + sIdent + " " + sHost + " " + \
- sLine.Token(6) + " " + sNick[0] + \
- sNick.substr(sNick.find_first_not_of(GetPerms())) + " " + \
+ CString sNewNick = sNick;
+ size_t pos = sNick.find_first_not_of(GetPerms());
+ if (pos >= 2 && pos != CString::npos) {
+ sNewNick = sNick[0] + sNick.substr(pos);
+ }
+ CString sNewLine = sServer + " 352 " + sLine.Token(2) + " " +
+ sLine.Token(3) + " " + sIdent + " " + sHost + " " +
+ sLine.Token(6) + " " + sNewNick + " " +
sLine.Token(8, true);
m_pNetwork->PutUser(sNewLine, pClient);
}

0 comments on commit ba99a64

Please sign in to comment.