mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-09-27 12:09:00 +02:00
parent
3d778a5a44
commit
464a7ee765
3 changed files with 7 additions and 0 deletions
|
@ -69,6 +69,7 @@ type BridgeConfig struct {
|
||||||
|
|
||||||
InviteOwnPuppetForBackfilling bool `yaml:"invite_own_puppet_for_backfilling"`
|
InviteOwnPuppetForBackfilling bool `yaml:"invite_own_puppet_for_backfilling"`
|
||||||
PrivateChatPortalMeta bool `yaml:"private_chat_portal_meta"`
|
PrivateChatPortalMeta bool `yaml:"private_chat_portal_meta"`
|
||||||
|
BridgeNotices bool `yaml:"bridge_notices"`
|
||||||
ResendBridgeInfo bool `yaml:"resend_bridge_info"`
|
ResendBridgeInfo bool `yaml:"resend_bridge_info"`
|
||||||
|
|
||||||
WhatsappThumbnail bool `yaml:"whatsapp_thumbnail"`
|
WhatsappThumbnail bool `yaml:"whatsapp_thumbnail"`
|
||||||
|
@ -129,6 +130,7 @@ func (bc *BridgeConfig) setDefaults() {
|
||||||
|
|
||||||
bc.InviteOwnPuppetForBackfilling = true
|
bc.InviteOwnPuppetForBackfilling = true
|
||||||
bc.PrivateChatPortalMeta = false
|
bc.PrivateChatPortalMeta = false
|
||||||
|
bc.BridgeNotices = true
|
||||||
}
|
}
|
||||||
|
|
||||||
type umBridgeConfig BridgeConfig
|
type umBridgeConfig BridgeConfig
|
||||||
|
|
|
@ -177,6 +177,8 @@ bridge:
|
||||||
# chat portal rooms. This can be useful if the previous field works fine,
|
# chat portal rooms. This can be useful if the previous field works fine,
|
||||||
# but causes room avatar/name bugs.
|
# but causes room avatar/name bugs.
|
||||||
private_chat_portal_meta: false
|
private_chat_portal_meta: false
|
||||||
|
# Whether or not Matrix m.notice-type messages should be bridged.
|
||||||
|
bridge_notices: true
|
||||||
# Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
|
# 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,
|
# This field will automatically be changed back to false after it,
|
||||||
# except if the config file is not writable.
|
# except if the config file is not writable.
|
||||||
|
|
|
@ -2029,6 +2029,9 @@ func (portal *Portal) convertMatrixMessage(sender *User, evt *event.Event) (*waP
|
||||||
switch content.MsgType {
|
switch content.MsgType {
|
||||||
case event.MsgText, event.MsgEmote, event.MsgNotice:
|
case event.MsgText, event.MsgEmote, event.MsgNotice:
|
||||||
text := content.Body
|
text := content.Body
|
||||||
|
if content.MsgType == event.MsgNotice && !portal.bridge.Config.Bridge.BridgeNotices {
|
||||||
|
return nil, sender
|
||||||
|
}
|
||||||
if content.Format == event.FormatHTML {
|
if content.Format == event.FormatHTML {
|
||||||
text, ctxInfo.MentionedJid = portal.bridge.Formatter.ParseMatrix(content.FormattedBody)
|
text, ctxInfo.MentionedJid = portal.bridge.Formatter.ParseMatrix(content.FormattedBody)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue