mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 21:02:25 +03:00
Federation fixes for virtual hosting
This commit is contained in:
parent
f4ee397734
commit
6650712a1c
73 changed files with 736 additions and 420 deletions
|
@ -364,11 +364,7 @@ func (s *OutputRoomEventConsumer) notifyJoinedPeeks(ctx context.Context, ev *gom
|
|||
// TODO: check that it's a join and not a profile change (means unmarshalling prev_content)
|
||||
if membership == gomatrixserverlib.Join {
|
||||
// check it's a local join
|
||||
_, domain, err := gomatrixserverlib.SplitID('@', *ev.StateKey())
|
||||
if err != nil {
|
||||
return sp, fmt.Errorf("gomatrixserverlib.SplitID: %w", err)
|
||||
}
|
||||
if domain != s.cfg.Matrix.ServerName {
|
||||
if _, _, err := s.cfg.Matrix.SplitLocalID('@', *ev.StateKey()); err != nil {
|
||||
return sp, nil
|
||||
}
|
||||
|
||||
|
@ -390,9 +386,7 @@ func (s *OutputRoomEventConsumer) onNewInviteEvent(
|
|||
if msg.Event.StateKey() == nil {
|
||||
return
|
||||
}
|
||||
if _, serverName, err := gomatrixserverlib.SplitID('@', *msg.Event.StateKey()); err != nil {
|
||||
return
|
||||
} else if serverName != s.cfg.Matrix.ServerName {
|
||||
if _, _, err := s.cfg.Matrix.SplitLocalID('@', *msg.Event.StateKey()); err != nil {
|
||||
return
|
||||
}
|
||||
pduPos, err := s.db.AddInviteEvent(ctx, msg.Event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue