Add option to disable custom emoji reactions
This commit is contained in:
@@ -45,6 +45,7 @@ type BridgeConfig struct {
|
||||
MuteChannelsOnCreate bool `yaml:"mute_channels_on_create"`
|
||||
SyncDirectChatList bool `yaml:"sync_direct_chat_list"`
|
||||
ResendBridgeInfo bool `yaml:"resend_bridge_info"`
|
||||
CustomEmojiReactions bool `yaml:"custom_emoji_reactions"`
|
||||
DeletePortalOnChannelDelete bool `yaml:"delete_portal_on_channel_delete"`
|
||||
DeleteGuildOnLeave bool `yaml:"delete_guild_on_leave"`
|
||||
FederateRooms bool `yaml:"federate_rooms"`
|
||||
|
||||
@@ -40,6 +40,7 @@ func DoUpgrade(helper *up.Helper) {
|
||||
helper.Copy(up.Bool, "bridge", "mute_channels_on_create")
|
||||
helper.Copy(up.Bool, "bridge", "sync_direct_chat_list")
|
||||
helper.Copy(up.Bool, "bridge", "resend_bridge_info")
|
||||
helper.Copy(up.Bool, "bridge", "custom_emoji_reactions")
|
||||
helper.Copy(up.Bool, "bridge", "delete_portal_on_channel_delete")
|
||||
helper.Copy(up.Bool, "bridge", "delete_guild_on_leave")
|
||||
helper.Copy(up.Bool, "bridge", "federate_rooms")
|
||||
|
||||
@@ -125,6 +125,9 @@ bridge:
|
||||
# Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
|
||||
# This field will automatically be changed back to false after it, except if the config file is not writable.
|
||||
resend_bridge_info: false
|
||||
# Should incoming custom emoji reactions be bridged as mxc:// URIs?
|
||||
# If set to false, custom emoji reactions will be bridged as the shortcode instead, and the image won't be available.
|
||||
custom_emoji_reactions: true
|
||||
# Should the bridge attempt to completely delete portal rooms when a channel is deleted on Discord?
|
||||
# If true, the bridge will try to kick Matrix users from the room. Otherwise, the bridge only makes ghosts leave.
|
||||
delete_portal_on_channel_delete: false
|
||||
|
||||
@@ -1522,6 +1522,10 @@ func (portal *Portal) handleDiscordReaction(user *User, reaction *discordgo.Mess
|
||||
extraContent["fi.mau.discord.reaction"] = map[string]any{
|
||||
"id": reaction.Emoji.ID,
|
||||
"name": reaction.Emoji.Name,
|
||||
"mxc": matrixReaction,
|
||||
}
|
||||
if !portal.bridge.Config.Bridge.CustomEmojiReactions {
|
||||
content.RelatesTo.Key = fmt.Sprintf(":%s:", reaction.Emoji.Name)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user