xmpp: Make URL removal configurable
This commit is contained in:
1 parent
a718ab6f86
commit
7b0e1f7e8c
2 files changed
+7
-1
No files matched your search
@@ -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