alias top {
if ($active !ischan) { echo -ac own This command can only be used on a channel. | return }
if ($1 == -v) { if ($chan($active).topic) { topic $active } | else { echo -ac own No topic. } }
if ($1 == -r && $chan($active).topic && $nick($active,$me,~&@) && $popup_remove) { topic -r $active }
if (!$istok(-v -r,$1,32) && $nick($active,$me,~&@)) {
if ($1) { var %newtopic $1- } | else { var %newtopic $popup_enter }
if (%newtopic && $popup_change) { topic $active %newtopic }
}
}
alias -l popup_enter { return $$?="Enter your channel topic:" }
alias -l popup_change { return $?!="Are you sure you want to change the channel topic?" }
alias -l popup_remove { return $?!="Are you sure you want to remove the channel topic?" }