xmpp: Make URL removal configurable
This commit is contained in:
@@ -58,6 +58,7 @@ class BridgeComponent(ComponentXMPP):
|
||||
self._dont_ignore_offline = self._config["general"].get("dont_ignore_offline", True)
|
||||
self._reactions_compat = self._config["general"].get("reactions_compat", True)
|
||||
self._muc_mention_compat = self._config["general"].get("muc_mention_compat", True)
|
||||
self._remove_url_on_embed = self._config["general"].get("remove_url_on_embed", False)
|
||||
|
||||
register_stanza_plugin(Message, OOBData)
|
||||
|
||||
@@ -260,7 +261,7 @@ class BridgeComponent(ComponentXMPP):
|
||||
embed.set_image(url=message["oob"]["url"])
|
||||
|
||||
# I mean, this should always be true, but you never know
|
||||
if content == message["oob"]["url"]:
|
||||
if content == message["oob"]["url"] and self._remove_url_on_embed:
|
||||
# NOTE: To prevent the URL being visible in Discord, remove the content.
|
||||
# Makes it feel more native.
|
||||
content = None
|
||||
|
||||
Reference in New Issue
Block a user