mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-11-11 20:42:39 +01:00
Make showing identity change notices configurable
This commit is contained in:
parent
a8beec8754
commit
cae2b8afa1
4 changed files with 9 additions and 5 deletions
|
@ -32,10 +32,11 @@ type BridgeConfig struct {
|
||||||
UsernameTemplate string `yaml:"username_template"`
|
UsernameTemplate string `yaml:"username_template"`
|
||||||
DisplaynameTemplate string `yaml:"displayname_template"`
|
DisplaynameTemplate string `yaml:"displayname_template"`
|
||||||
|
|
||||||
DeliveryReceipts bool `yaml:"delivery_receipts"`
|
DeliveryReceipts bool `yaml:"delivery_receipts"`
|
||||||
PortalMessageBuffer int `yaml:"portal_message_buffer"`
|
PortalMessageBuffer int `yaml:"portal_message_buffer"`
|
||||||
CallStartNotices bool `yaml:"call_start_notices"`
|
CallStartNotices bool `yaml:"call_start_notices"`
|
||||||
ReactionNotices bool `yaml:"reaction_notices"`
|
IdentityChangeNotices bool `yaml:"identity_change_notices"`
|
||||||
|
ReactionNotices bool `yaml:"reaction_notices"`
|
||||||
|
|
||||||
HistorySync struct {
|
HistorySync struct {
|
||||||
CreatePortals bool `yaml:"create_portals"`
|
CreatePortals bool `yaml:"create_portals"`
|
||||||
|
|
|
@ -68,6 +68,7 @@ func (helper *UpgradeHelper) doUpgrade() {
|
||||||
helper.Copy(Bool, "bridge", "delivery_receipts")
|
helper.Copy(Bool, "bridge", "delivery_receipts")
|
||||||
helper.Copy(Int, "bridge", "portal_message_buffer")
|
helper.Copy(Int, "bridge", "portal_message_buffer")
|
||||||
helper.Copy(Bool, "bridge", "call_start_notices")
|
helper.Copy(Bool, "bridge", "call_start_notices")
|
||||||
|
helper.Copy(Bool, "bridge", "identity_change_notices")
|
||||||
helper.Copy(Bool, "bridge", "reaction_notices")
|
helper.Copy(Bool, "bridge", "reaction_notices")
|
||||||
helper.Copy(Bool, "bridge", "history_sync", "create_portals")
|
helper.Copy(Bool, "bridge", "history_sync", "create_portals")
|
||||||
helper.Copy(Int, "bridge", "history_sync", "max_age")
|
helper.Copy(Int, "bridge", "history_sync", "max_age")
|
||||||
|
|
|
@ -92,6 +92,8 @@ bridge:
|
||||||
delivery_receipts: false
|
delivery_receipts: false
|
||||||
# Should incoming calls send a message to the Matrix room?
|
# Should incoming calls send a message to the Matrix room?
|
||||||
call_start_notices: true
|
call_start_notices: true
|
||||||
|
# Should another user's cryptographic identity changing send a message to Matrix?
|
||||||
|
identity_change_notices: false
|
||||||
# Should a "reactions not yet supported" warning be sent to the Matrix room when a user reacts to a message?
|
# Should a "reactions not yet supported" warning be sent to the Matrix room when a user reacts to a message?
|
||||||
reaction_notices: true
|
reaction_notices: true
|
||||||
|
|
||||||
|
|
2
user.go
2
user.go
|
@ -439,7 +439,7 @@ func (user *User) HandleEvent(event interface{}) {
|
||||||
case *events.IdentityChange:
|
case *events.IdentityChange:
|
||||||
puppet := user.bridge.GetPuppetByJID(v.JID)
|
puppet := user.bridge.GetPuppetByJID(v.JID)
|
||||||
portal := user.GetPortalByJID(v.JID)
|
portal := user.GetPortalByJID(v.JID)
|
||||||
if len(portal.MXID) > 0 {
|
if len(portal.MXID) > 0 && user.bridge.Config.Bridge.IdentityChangeNotices {
|
||||||
portal.messages <- PortalMessage{
|
portal.messages <- PortalMessage{
|
||||||
fake: &fakeMessage{
|
fake: &fakeMessage{
|
||||||
Sender: v.JID,
|
Sender: v.JID,
|
||||||
|
|
Loading…
Reference in a new issue