From 0f3afe0ef6684e8c2870a974e1d654b3f0c727ef Mon Sep 17 00:00:00 2001 From: Malte E Date: Fri, 9 Aug 2024 22:10:55 +0200 Subject: [PATCH] update mautrix-go --- go.mod | 7 ------- go.sum | 5 ----- pkg/connector/handlematrix.go | 11 ++++++++++- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index e7b3e390..c49fa0ff 100644 --- a/go.mod +++ b/go.mod @@ -44,10 +44,3 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect maunium.net/go/mauflag v1.0.0 // indirect ) -<<<<<<< HEAD -======= - -//replace maunium.net/go/mautrix => ../mautrix-go -//replace go.mau.fi/util => ../../Go/go-util -replace maunium.net/go/mautrix => github.com/maltee1/mautrix-go v0.0.0-20240808204140-9598e29d1124 ->>>>>>> aec8c02 (fixes) diff --git a/go.sum b/go.sum index ca3f9472..4972d7b5 100644 --- a/go.sum +++ b/go.sum @@ -25,11 +25,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -<<<<<<< HEAD -======= -github.com/maltee1/mautrix-go v0.0.0-20240808204140-9598e29d1124 h1:zgSOHfcfq6NXuHL+mo/IexMGksBmrZcVyPjipTjEILc= -github.com/maltee1/mautrix-go v0.0.0-20240808204140-9598e29d1124/go.mod h1:ZWyxoQxRTBxzWIMs0kQCVogZIY0clTu33h102veCT/Q= ->>>>>>> aec8c02 (fixes) github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= diff --git a/pkg/connector/handlematrix.go b/pkg/connector/handlematrix.go index 173ed278..2c4cb8fe 100644 --- a/pkg/connector/handlematrix.go +++ b/pkg/connector/handlematrix.go @@ -351,6 +351,15 @@ func (s *SignalClient) HandleMatrixMembership(ctx context.Context, msg *bridgev2 var targetIntent bridgev2.MatrixAPI var targetSignalID uuid.UUID var err error + if msg.Portal.RoomType == database.RoomTypeDM { + //TODO: this probably needs to revert some changes and clean up the portal on leaves + switch msg.Type { + case bridgev2.Invite: + return false, fmt.Errorf("cannot invite additional user to dm") + default: + return false, nil + } + } if msg.TargetGhost != nil { targetIntent = msg.TargetGhost.Intent targetSignalID, err = signalid.ParseUserID(msg.TargetGhost.ID) @@ -421,7 +430,7 @@ func (s *SignalClient) HandleMatrixMembership(ctx context.Context, msg *bridgev2 }} case bridgev2.RetractKnock, bridgev2.RejectKnock: gc.DeleteRequestingMembers = []*uuid.UUID{&targetSignalID} - case bridgev2.BanKnocked, bridgev2.BanInvited, bridgev2.BanJoined, bridgev2.Ban: + case bridgev2.BanKnocked, bridgev2.BanInvited, bridgev2.BanJoined, bridgev2.BanLeft: gc.AddBannedMembers = []*signalmeow.BannedMember{{ ServiceID: libsignalgo.NewACIServiceID(targetSignalID), Timestamp: uint64(time.Now().UnixMilli()),