mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-04 20:53:09 -06:00
Copy invites as well as bans
This commit is contained in:
parent
4693f00a26
commit
5d62b8f2cd
|
|
@ -346,11 +346,18 @@ func (r *Upgrader) generateInitialEvents(ctx context.Context, oldRoom *api.Query
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if event.Type() == gomatrixserverlib.MRoomMember && !event.StateKeyEquals(userID) {
|
if event.Type() == gomatrixserverlib.MRoomMember && !event.StateKeyEquals(userID) {
|
||||||
// With the exception of bans which we do want to copy, we should ignore
|
// With the exception of bans and invites which we do want to copy, we
|
||||||
// membership events that aren't our own, as event auth will prevent us
|
// should ignore membership events that aren't our own, as event auth will
|
||||||
// from being able to create membership events on behalf of other users
|
// prevent us from being able to create membership events on behalf of other
|
||||||
// anyway unless they are invites or bans.
|
// users anyway unless they are invites or bans.
|
||||||
if membership, err := event.Membership(); err == nil && membership != gomatrixserverlib.Ban {
|
membership, err := event.Membership()
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
switch membership {
|
||||||
|
case gomatrixserverlib.Ban:
|
||||||
|
case gomatrixserverlib.Invite:
|
||||||
|
default:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue