]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Allow for nick!user@host in TOPIC information.
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 11 Feb 2007 18:50:04 +0000 (18:50 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 11 Feb 2007 18:50:04 +0000 (18:50 +0000)
Note that this adds another <options> tag value, 'hostintopic'. (defaults to yes)

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6572 e03df62e-2008-0410-955e-edbf42e46eb7

docs/inspircd.conf.example
include/channels.h
include/configreader.h
src/cmd_topic.cpp
src/configreader.cpp
src/modules/m_spanningtree/treesocket1.cpp

index c0ad163d547a3a8bf0c27d8fd743fd776888fbc0..202e4a8d126a24262e8a19c66102e16a083ace68 100644 (file)
 #                  NOTICE and PRIVMSG adding the prefix to the line   #
 #                  of text sent out. Eg. NOTICE @#test :@ testing     #
 #                  vs off: NOTICE @#test :testing                     #
-#
+#                                                                     #
 #  notimesync    - If this value is 'yes', 'true', or '1', time       #
 #                  synchronization is disabled on this server. This   #
 #                  means any servers you are linked to will not       #
 #                  on netsplits. This option should be the same on    #
 #                  all servers.                                       #
 #                                                                     #
+#  hostintopic   - If this is set to yes (the default) then the full  #
+#                  nick!user@host is shown for who set a TOPIC last.  #
+#                  if set to no, then only the nickname is shown.     #
+#                                                                     #
 
 <options prefixquit="Quit: "
          loglevel="default"
          ircumsgprefix="no"
          announcets="yes"
          notimesync="no"
+        hostintopic="yes"
          allowhalfop="yes">
 
 #-#-#-#-#-#-#-#-#-#-#-#-#-  WHOWAS OPTIONS   -#-#-#-#-#-#-#-#-#-#-#-#-#
index 17e7364a42919eab3ed829887c8cb0a8f7d94d8f..7daab2167c72509a43f18000d49186c1567bf6f0 100644 (file)
@@ -178,7 +178,7 @@ class chanrec : public Extensible
        /** The last user to set the topic.
         * If this member is an empty string, no topic was ever set.
         */
-       char setby[NICKMAX];
+       char setby[128];
 
        /** Contains the channel user limit.
         * If this value is zero, there is no limit in place.
index 5e8c62e0620d9e38bca9a8384b750bdfe37f7969..61cf887faf28f207c43a58867077ab1dca9d073e 100644 (file)
@@ -503,6 +503,11 @@ class ServerConfig : public Extensible
         */
        bool UndernetMsgPrefix;
 
+       /** If set to true, the full nick!user@host will be shown in the TOPIC command
+        * for who set the topic last. If false, only the nick is shown.
+        */
+       bool FullHostInTopic;
+
        /** All oper type definitions from the config file
         */
        opertype_t opertypes;
index f9abaa3092640a8425e70fa2c8ac04e5b812e114..dfd03a65183884f9db9a9a1ba8e846053a5cf7a2 100644 (file)
@@ -95,7 +95,11 @@ CmdResult cmd_topic::Handle (const char** parameters, int pcnt, userrec *user)
                                strlcpy(Ptr->topic, parameters[1], MAXTOPIC-1);
                        }
 
-                       strlcpy(Ptr->setby,user->nick,NICKMAX-1);
+                       if (ServerInstance->Config->FullHostInTopic)
+                               strlcpy(Ptr->setby,user->GetFullHost(),127);
+                       else
+                               strlcpy(Ptr->setby,user->nick,127);
+
                        Ptr->topicset = ServerInstance->Time();
                        Ptr->WriteChannel(user, "TOPIC %s :%s", Ptr->name, Ptr->topic);
 
index 3060b98663404c92128cd853c3a88112daf5db14..feb55b293e16e51c4889518418714e1c658a86fe 100644 (file)
@@ -588,6 +588,7 @@ void ServerConfig::Read(bool bail, userrec* user)
                {"options",     "syntaxhints",  "0",                    new ValueContainerBool (&this->SyntaxHints),            DT_BOOLEAN, NoValidation},
                {"options",     "cyclehosts",   "0",                    new ValueContainerBool (&this->CycleHosts),             DT_BOOLEAN, NoValidation},
                {"options",     "ircumsgprefix","0",                    new ValueContainerBool (&this->UndernetMsgPrefix),      DT_BOOLEAN, NoValidation},
+               {"options",     "hostintopic",  "1",                    new ValueContainerBool (&this->FullHostInTopic),        DT_BOOLEAN, NoValidation},
                {"pid",         "file",         "",                     new ValueContainerChar (this->PID),                     DT_CHARPTR, NoValidation},
                {"whowas",      "groupsize",    "10",                   new ValueContainerInt  (&this->WhoWasGroupSize),        DT_INTEGER, NoValidation},
                {"whowas",      "maxgroups",    "10240",                new ValueContainerInt  (&this->WhoWasMaxGroups),        DT_INTEGER, NoValidation},
index 1e25a2fff65a24151f5cf59aebd9cf2d5d3be1a8..c17f8d0f6edd1a0c734c9da6befa77501f7c622c 100644 (file)
@@ -797,7 +797,7 @@ bool TreeSocket::ForceTopic(const std::string &source, std::deque<std::string> &
                {
                        std::string oldtopic = c->topic;
                        strlcpy(c->topic,params[3].c_str(),MAXTOPIC);
-                       strlcpy(c->setby,params[2].c_str(),NICKMAX-1);
+                       strlcpy(c->setby,params[2].c_str(),127);
                        c->topicset = ts;
                        /* if the topic text is the same as the current topic,
                         * dont bother to send the TOPIC command out, just silently