forked from tildeverse/tilde.chat
skip channels with +s
This commit is contained in:
parent
c2fc0237fe
commit
e489171e37
10
gen_stats
10
gen_stats
|
@ -12,6 +12,7 @@ assert d.tag == "inspircdstats"
|
|||
with open(f"{WORK_DIR}/blacklist", "r") as f:
|
||||
BLACKLIST = f.read().splitlines()
|
||||
|
||||
|
||||
def define(name, xps, vfilter=lambda x: x):
|
||||
global out
|
||||
out[name] = vfilter(d.findall(xps)[0].text)
|
||||
|
@ -32,15 +33,14 @@ for schannel in schannels:
|
|||
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 (
|
||||
# skip channels in the blacklist or with mode +s
|
||||
"s" in schannel.findall("./channelmodes")[0].text.split()[0]
|
||||
and channel["topic"] != "No topic set"
|
||||
or channel["name"] in BLACKLIST
|
||||
):
|
||||
channel["topic"] = "Topic hidden"
|
||||
if channel["name"] in BLACKLIST:
|
||||
# skip channels in the blacklist
|
||||
continue
|
||||
|
||||
channel["webchatlink"] = "https://web.tilde.chat/?join=" + channel["name"].lstrip(
|
||||
"#"
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue