mirror of https://github.com/caronc/apprise
improved handling of default image
parent
dc0a992bad
commit
e3e3080614
|
@ -325,8 +325,8 @@ class NotifySlack(NotifyBase):
|
||||||
token_b=None,
|
token_b=None,
|
||||||
token_c=None,
|
token_c=None,
|
||||||
targets=None,
|
targets=None,
|
||||||
include_image=True,
|
include_image=None,
|
||||||
include_footer=True,
|
include_footer=None,
|
||||||
use_blocks=None,
|
use_blocks=None,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
|
@ -414,10 +414,15 @@ class NotifySlack(NotifyBase):
|
||||||
re.IGNORECASE,
|
re.IGNORECASE,
|
||||||
)
|
)
|
||||||
# Place a thumbnail image inline with the message body
|
# Place a thumbnail image inline with the message body
|
||||||
self.include_image = include_image
|
self.include_image = \
|
||||||
|
self.template_args["image"]["default"] \
|
||||||
|
if include_image is None else include_image
|
||||||
|
|
||||||
# Place a footer with each post
|
# Place a footer with each post
|
||||||
self.include_footer = include_footer
|
self.include_footer = \
|
||||||
|
self.template_args["footer"]["default"] \
|
||||||
|
if include_footer is None else include_footer
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def send(
|
def send(
|
||||||
|
@ -1224,18 +1229,18 @@ class NotifySlack(NotifyBase):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Get Image Flag
|
# Get Image Flag
|
||||||
results["include_image"] = parse_bool(
|
results["include_image"] = \
|
||||||
results["qsd"].get("image", True)
|
parse_bool(results["qsd"].get(
|
||||||
)
|
"image", NotifySlack.template_args["image"]["default"]))
|
||||||
|
|
||||||
# Get Payload structure (use blocks?)
|
# Get Payload structure (use blocks?)
|
||||||
if "blocks" in results["qsd"] and len(results["qsd"]["blocks"]):
|
if "blocks" in results["qsd"] and len(results["qsd"]["blocks"]):
|
||||||
results["use_blocks"] = parse_bool(results["qsd"]["blocks"])
|
results["use_blocks"] = parse_bool(results["qsd"]["blocks"])
|
||||||
|
|
||||||
# Get Footer Flag
|
# Get Footer Flag
|
||||||
results["include_footer"] = parse_bool(
|
results["include_footer"] = \
|
||||||
results["qsd"].get("footer", True)
|
parse_bool(results["qsd"].get(
|
||||||
)
|
"footer", NotifySlack.template_args["footer"]["default"]))
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue