partyline: send RPL_ISUPPORT regardless of network or IRC connection

The behavior of IRC clients is unpredictable if they don't get the
appropriate CHANTYPES for partyline channels. Thus, send RPL_ISUPPORT
with the appropriate CHANTYPES also when a client is not connected to
a network, or when the network is not connected to IRC.
This commit is contained in:
J-P Nurmi
2015-08-11 15:16:12 +02:00
parent c0f6b68c05
commit 078eef5ba9
+6 -8
View File
@@ -114,12 +114,10 @@ public:
for (map<CString, CUser*>::const_iterator it = msUsers.begin(); it != msUsers.end(); ++it) {
CUser* pUser = it->second;
for (vector<CIRCNetwork*>::const_iterator i = pUser->GetNetworks().begin(); i != pUser->GetNetworks().end(); ++i) {
CIRCNetwork* pNetwork = *i;
if (pNetwork->GetIRCSock()) {
if (pNetwork->GetChanPrefixes().find(CHAN_PREFIX_1) == CString::npos) {
pNetwork->PutUser(":" + GetIRCServer(pNetwork) + " 005 " + pNetwork->GetIRCNick().GetNick() + " CHANTYPES=" + pNetwork->GetChanPrefixes() + CHAN_PREFIX_1 " :are supported by this server.");
}
for (CClient* pClient : pUser->GetAllClients()) {
CIRCNetwork* pNetwork = pClient->GetNetwork();
if (!pNetwork || !pNetwork->IsIRCConnected() || !pNetwork->GetChanPrefixes().Contains(CHAN_PREFIX_1)) {
pClient->PutClient(":" + GetIRCServer(pNetwork) + " 005 " + pClient->GetNick() + " CHANTYPES=" + (pNetwork ? pNetwork->GetChanPrefixes() : "") + CHAN_PREFIX_1 " :are supported by this server.");
}
}
}
@@ -213,8 +211,8 @@ public:
CUser* pUser = GetUser();
CClient* pClient = GetClient();
CIRCNetwork* pNetwork = GetNetwork();
if (m_spInjectedPrefixes.find(pNetwork) == m_spInjectedPrefixes.end() && pNetwork && !pNetwork->GetChanPrefixes().empty()) {
pClient->PutClient(":" + GetIRCServer(pNetwork) + " 005 " + pClient->GetNick() + " CHANTYPES=" + pNetwork->GetChanPrefixes() + CHAN_PREFIX_1 " :are supported by this server.");
if (!pNetwork || !pNetwork->IsIRCConnected()) {
pClient->PutClient(":" + GetIRCServer(pNetwork) + " 005 " + pClient->GetNick() + " CHANTYPES=" + CHAN_PREFIX_1 " :are supported by this server.");
}
// Make sure this user is in the default channels