]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/m_topic.c
Hey, charybdis already kinda does these two.
[irc/rqf/shadowircd.git] / modules / m_topic.c
index d8ad5b9d6f19f4b0426115e2a705b04648674a8e..3eee639b4ed3e3042b31763fe5c06f9a46d33768 100644 (file)
@@ -117,8 +117,13 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char *
                if((chptr->mode.mode & MODE_TOPICLIMIT) == 0 || is_chanop(msptr))
                {
                        char topic_info[USERHOST_REPLYLEN];
-                       rb_sprintf(topic_info, "%s!%s@%s",
-                                       source_p->name, source_p->username, source_p->host);
+
+                       if(ConfigChannel.host_in_topic)
+                               rb_sprintf(topic_info, "%s!%s@%s",
+                                               source_p->name, source_p->username, source_p->host);
+                       else
+                               rb_strlcpy(topic_info, source_p->name, sizeof(topic_info));
+
                        set_channel_topic(chptr, parv[2], topic_info, rb_current_time());
 
                        sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
@@ -133,7 +138,8 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char *
                }
                else
                        sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
-                                       me.name, source_p->name, name);
+                                       get_id(&me, source_p),
+                                       get_id(source_p, source_p), name);
        }
        else if(MyClient(source_p))
        {