Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix support for /msg @#chan :hi

005 STATUSMSG defines list of characters prependable to channel name,
but we used simple modes instead.

See
https://tools.ietf.org/html/draft-brocklesby-irc-isupport-03#section-3.16

Fix #272

Thanks to grawity for the link to 005 docs draft, and to carrot for
testing the patch.
  • Loading branch information...
commit d5e03cb73612e43322652c4ab64283667613f838 1 parent 7454331
@DarthGandalf DarthGandalf authored
Showing with 12 additions and 1 deletion.
  1. +1 −0  include/znc/IRCSock.h
  2. +2 −1  src/IRCNetwork.cpp
  3. +9 −0 src/IRCSock.cpp
View
1  include/znc/IRCSock.h
@@ -102,6 +102,7 @@ class CIRCSock : public CZNCSock {
bool IsAuthed() const { return m_bAuthed; }
bool IsCapAccepted(const CString& sCap) { return 1 == m_ssAcceptedCaps.count(sCap); }
const MCString& GetISupport() const { return m_mISupport; }
+ CString GetISupport(const CString& sKey, const CString& sDefault = "") const;
// !Getters
// This handles NAMESX and UHNAMES in a raw 353 reply
View
3  src/IRCNetwork.cpp
@@ -624,7 +624,8 @@ const vector<CChan*>& CIRCNetwork::GetChans() const { return m_vChans; }
CChan* CIRCNetwork::FindChan(CString sName) const {
if (GetIRCSock()) {
- sName.TrimLeft(GetIRCSock()->GetPerms());
+ // See https://tools.ietf.org/html/draft-brocklesby-irc-isupport-03#section-3.16
+ sName.TrimLeft(GetIRCSock()->GetISupport("STATUSMSG", ""));
}
for (unsigned int a = 0; a < m_vChans.size(); a++) {
View
9 src/IRCSock.cpp
@@ -1211,6 +1211,15 @@ void CIRCSock::ParseISupport(const CString& sLine) {
}
}
+CString CIRCSock::GetISupport(const CString& sKey, const CString& sDefault) const {
+ MCString::const_iterator i = m_mISupport.find(sKey.AsUpper());
+ if (i == m_mISupport.end()) {
+ return sDefault;
+ } else {
+ return i->second;
+ }
+}
+
void CIRCSock::ForwardRaw353(const CString& sLine) const {
vector<CClient*>& vClients = m_pNetwork->GetClients();
vector<CClient*>::iterator it;
Please sign in to comment.
Something went wrong with that request. Please try again.