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