change !fedi "!" arg to still show CW but also show content of Note

This commit is contained in:
jesopo 2019-10-18 15:54:36 +01:00
parent 20a115e71d
commit 1c02de8a69

View file

@ -55,11 +55,11 @@ class Module(ModuleManager.BaseModule):
account = None account = None
url = None url = None
show_cw = True strict_cw = True
args_split = event["args_split"][:] args_split = event["args_split"][:]
for i, arg in enumerate(args_split): for i, arg in enumerate(args_split):
if arg == "!": if arg == "!":
show_cw = False strict_cw = False
args_split.pop(i) args_split.pop(i)
break break
@ -101,8 +101,11 @@ class Module(ModuleManager.BaseModule):
shorturl = self.exports.get_one("shorturl")(event["server"], url, shorturl = self.exports.get_one("shorturl")(event["server"], url,
context=event["target"]) context=event["target"])
if cw and show_cw: if cw:
out = "CW: %s - %s" % (cw, shorturl) if strict_cw:
out = "CW: %s - %s" % (cw, shorturl)
else:
out = "(CW %s) %s - %s" % (cw, out, shorturl)
else: else:
out = "%s - %s" % (out, shorturl) out = "%s - %s" % (out, shorturl)
event["stdout"].write(out) event["stdout"].write(out)