X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/73788f79538ecea791077aaca3257f776f6abf05..1a9821cd5104596cac3cce5669f62bb8cb8c4691:/modules/m_topic.c diff --git a/modules/m_topic.c b/modules/m_topic.c index a69a99e..e81ce2c 100644 --- a/modules/m_topic.c +++ b/modules/m_topic.c @@ -53,7 +53,6 @@ DECLARE_MODULE_AV1(topic, NULL, NULL, topic_clist, NULL, NULL, "$Revision: 254 $ /* * m_topic - * parv[0] = sender prefix * parv[1] = channel name * parv[2] = new topic, if setting topic */ @@ -115,11 +114,16 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char * return 0; } - if((chptr->mode.mode & MODE_TOPICLIMIT) == 0 || is_chanop(msptr)) + if((chptr->mode.mode & MODE_TOPICLIMIT) == 0 || is_any_op(msptr) || IsOverride(source_p)) { 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, @@ -134,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)) { @@ -166,7 +171,6 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char * /* * ms_topic - * parv[0] = sender prefix * parv[1] = channel name * parv[2] = topic_info * parv[3] = topic_info time