forked from tildeverse/tilde.chat
Implement +s topic hiding in stats
This commit is contained in:
parent
5123443083
commit
79bd8d273a
|
@ -18,6 +18,9 @@ channels = []
|
||||||
for schannel in schannels:
|
for schannel in schannels:
|
||||||
channel = dict(name=schannel.findall("channelname")[0].text,usercount=int(schannel.findall("usercount")[0].text))
|
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"
|
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!
|
if channel["name"]=="#secret-sudoers": # no stat output for #secret-sudoers! it's a sekrit club of the ~team sysadmins!
|
||||||
continue
|
continue
|
||||||
channels.append(channel)
|
channels.append(channel)
|
||||||
|
|
Loading…
Reference in New Issue