Implement +s topic hiding in stats

This commit is contained in:
Robert Miles 2018-07-13 18:36:37 -04:00
parent 5123443083
commit 79bd8d273a
1 changed files with 3 additions and 0 deletions

View File

@ -18,6 +18,9 @@ channels = []
for schannel in schannels:
channel = dict(name=schannel.findall("channelname")[0].text,usercount=int(schannel.findall("usercount")[0].text))
channel["topic"] = schannel.findall("./channeltopic/topictext")[0].text if schannel.findall("./channeltopic/topictext")[0].text is not None else "No topic set"
# bugfix: if mode s is set and there's a topic, hide the topic
if "s" in schannel.findall("./channelmodes")[0].text.split()[0] and channel["topic"]!="No topic set":
channel["topic"]="Topic hidden"
if channel["name"]=="#secret-sudoers": # no stat output for #secret-sudoers! it's a sekrit club of the ~team sysadmins!
continue
channels.append(channel)