From 9e047a3bebb577b202ec8fe5ae398bf64eaf9531 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sun, 4 Dec 2011 19:53:26 +0700 Subject: [PATCH] Store all 005 values in a map. Thanks to jayne for requesting this. --- include/znc/IRCSock.h | 2 ++ src/IRCSock.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/include/znc/IRCSock.h b/include/znc/IRCSock.h index 843dbe2d..26a79e4e 100644 --- a/include/znc/IRCSock.h +++ b/include/znc/IRCSock.h @@ -90,6 +90,7 @@ public: // This is true if we are past raw 001 bool IsAuthed() const { return m_bAuthed; } bool IsCapAccepted(const CString& sCap) { return 1 == m_ssAcceptedCaps.count(sCap); } + const MCString& GetISupport() const { return m_mISupport; } // !Getters // This handles NAMESX and UHNAMES in a raw 353 reply @@ -121,6 +122,7 @@ protected: unsigned int m_uNumCTCP; static const time_t m_uCTCPFloodTime; static const unsigned int m_uCTCPFloodCount; + MCString m_mISupport; }; #endif // !_IRCSOCK_H diff --git a/src/IRCSock.cpp b/src/IRCSock.cpp index e8db0976..7534f488 100644 --- a/src/IRCSock.cpp +++ b/src/IRCSock.cpp @@ -1023,6 +1023,12 @@ void CIRCSock::ParseISupport(const CString& sLine) { CString sName = it->Token(0, false, "="); CString sValue = it->Token(1, true, "="); + if (0 < sName.length() && ':' == sName[0]) { + break; + } + + m_mISupport[sName] = sValue; + if (sName.Equals("PREFIX")) { CString sPrefixes = sValue.Token(1, false, ")"); CString sPermModes = sValue.Token(0, false, ")");