diff options
| author | 2019-10-18 15:54:36 +0100 | |
|---|---|---|
| committer | 2019-10-18 15:54:36 +0100 | |
| commit | 1c02de8a69c2d6b493880e61e9511bb4ffad7ddd (patch) | |
| tree | c507df1e7c4be4287aa50da3759c7ba31be01858 | |
| parent | add "!" arg to !fedi, to denote "dont show content warning" (diff) | |
| signature | ||
change !fedi "!" arg to still show CW but also show content of Note
| -rw-r--r-- | modules/fediverse/__init__.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/fediverse/__init__.py b/modules/fediverse/__init__.py index 690ca524..e002a2ef 100644 --- a/modules/fediverse/__init__.py +++ b/modules/fediverse/__init__.py @@ -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: - out = "CW: %s - %s" % (cw, shorturl) + 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) |
