]> jfr.im git - irc/gunnarbeutner/shroudbnc.git/commitdiff
Made sbnc use numeric 004 for server information, as that's what clients use for...
authordemize <redacted>
Mon, 26 May 2014 07:20:41 +0000 (03:20 -0400)
committerGunnar Beutner <redacted>
Thu, 29 May 2014 08:40:09 +0000 (10:40 +0200)
Signed-off-by: Gunnar Beutner <redacted>
src/IRCConnection.cpp
src/IRCConnection.h
src/User.cpp

index 10571132327a0b7c4c29f7154ca8ceb3164c1af5..113e26ac53808424abb7e9ab71163b137bb36349 100644 (file)
@@ -211,7 +211,19 @@ bool CIRCConnection::ParseLineArgV(int argc, const char **argv) {
        static CHashCompare hashPong("PONG");
        // END of HASH values
 
-       if (argc > 3 && iRaw == 433) {
+       if (argc > 6 && iRaw == 4) {
+               free(m_Server);
+               m_Server = strdup(argv[3]);
+
+                free(m_ServerVersion);
+                m_ServerVersion = strdup(argv[4]);
+
+               free(m_UserModes);
+               m_UserModes = strdup(argv[5]);
+
+               free(m_ChanModes);
+               m_ChanModes = strdup(argv[6]);
+       } else if (argc > 3 && iRaw == 433) {
                bool ReturnValue = ModuleEvent(argc, argv);
 
                if (ReturnValue) {
@@ -1160,6 +1172,14 @@ const char *CIRCConnection::GetServerFeat(void) const {
        return m_ServerFeat;
 }
 
+const char *CIRCConnection::GetServerChanModes(void) const {
+       return m_ChanModes;
+}
+
+const char *CIRCConnection::GetServerUserModes(void) const {
+       return m_UserModes;
+}
+
 /**
  * GetISupportAll
  *
index ac0063285be2d055777a21579a0466167c773eac..3a5d2ef57ef7f0f13229e5371816448a146ac788 100644 (file)
@@ -71,8 +71,10 @@ private:
 
        CHashtable<CChannel *, false> *m_Channels; /**< the channels this IRC user is on */
 
-       char *m_ServerVersion; /**< the version from the 351 reply */
+       char *m_ServerVersion; /**< the version from the 004 reply */
        char *m_ServerFeat; /**< the server features from the 351 reply */
+       char *m_ChanModes; /**< the channel modes from the 004 reply */
+       char *m_UserModes; /**< the user modes from the 004 reply */
 
        CHashtable<char *, false> *m_ISupport; /**< the key/value pairs from the 005 replies */
        
@@ -125,6 +127,8 @@ public:
 
        const char *GetServerVersion(void) const;
        const char *GetServerFeat(void) const;
+       const char *GetServerUserModes(void) const;
+       const char *GetServerChanModes(void) const;
 
        CQueue *GetQueueHigh(void);
        CQueue *GetQueueMiddle(void);
index b1eef3e3a997a5b2d85f34e84494bbe5634ec46f..035324f9d72c34ed202bb0238c3c13020184dbf6 100644 (file)
@@ -268,6 +268,8 @@ void CUser::Attach(CClientConnection *Client) {
                        Client->ChangeNick(IrcNick);
 
                        Client->WriteLine(":%s 001 %s :Welcome to the Internet Relay Network %s", m_IRC->GetServer(), IrcNick, IrcNick);
+                        Client->WriteLine(":%s 002 %s :Your host is %s, running %s", m_IRC->GetServer(), IrcNick, m_IRC->GetServer(), m_IRC->GetServerVersion());
+                        Client->WriteLine(":%s 004 %s %s %s %s %s", m_IRC->GetServer(), IrcNick, m_IRC->GetServer(), m_IRC->GetServerVersion(), m_IRC->GetServerUserModes(), m_IRC->GetServerChanModes());
 
                        if (Motd->IsEmpty()) {
                                Client->WriteLine(":%s 422 %s :MOTD File is missing", m_IRC->GetServer(), IrcNick);