restrict setting topic to mod

This commit is contained in:
Stuart Henderson 2013-03-18 00:45:11 +00:00 committed by Mike Belopuhov
parent 7eb46d467f
commit 8886035ebe

5
cmd.c
View File

@ -233,6 +233,11 @@ icb_cmd_topic(struct icb_session *is, char *arg)
else
icb_status(is, STATUS_TOPIC, "The topic is not set.");
} else { /* setting the topic */
if (!icb_ismoder(ig, is)) {
icb_status(is, STATUS_NOTIFY, "Setting the topic is "
"only for moderators.");
return;
}
strlcpy(ig->topic, arg, sizeof ig->topic);
icb_status_group(ig, NULL, STATUS_TOPIC,
"%s changed the topic to \"%s\"", is->nick, ig->topic);