Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't forward WHO replies with multi-prefix to unsupported clients

  • Loading branch information...
commit 38ce17906cb99c419f2fc80fb942c0d480f42eb7 1 parent bf25eee
@kylef kylef authored
Showing with 27 additions and 1 deletion.
  1. +27 −1 src/IRCSock.cpp
View
28 src/IRCSock.cpp
@@ -289,7 +289,7 @@ void CIRCSock::ReadLine(const CString& sData) {
break;
}
- case 352: {
+ case 352: { // WHO
// :irc.yourserver.com 352 yournick #chan ident theirhost.com irc.theirserver.com theirnick H :0 Real Name
sServer = sLine.Token(0);
sNick = sLine.Token(7);
@@ -312,6 +312,32 @@ void CIRCSock::ReadLine(const CString& sData) {
vChans[a]->OnWho(sNick, sIdent, sHost);
}
+ if (m_bNamesx && (sNick.size() > 1) && IsPermChar(sNick[1])) {
+ // sLine uses multi-prefix
+
+ vector<CClient*>& vClients = m_pNetwork->GetClients();
+ vector<CClient*>::iterator it;
+ for (it = vClients.begin(); it != vClients.end(); ++it) {
+ CClient *pClient = *it;
+
+ if (pClient->HasNamesx()) {
+ m_pNetwork->PutUser(sLine, pClient);
+ } else {
+ // 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())) + " " + \
+ sLine.Token(8, true);
+ m_pNetwork->PutUser(sNewLine, pClient);
+ }
+ }
+
+ return;
+ }
+
break;
}
case 353: { // NAMES
Please sign in to comment.
Something went wrong with that request. Please try again.