Do not add event twice

This commit is contained in:
Half-Shot 2020-05-08 16:16:14 +01:00
parent 872d5b93cd
commit bb163e3d3c

View file

@ -305,15 +305,15 @@ func buildInviteStrippedState(
if err != nil { if err != nil {
return nil, err return nil, err
} }
inputEventUnwrapped := input.Event.Unwrap()
inviteState := []gomatrixserverlib.InviteV2StrippedState{ inviteState := []gomatrixserverlib.InviteV2StrippedState{
gomatrixserverlib.NewInviteV2StrippedState(&input.Event.Event), gomatrixserverlib.NewInviteV2StrippedState(&inputEventUnwrapped),
} }
stateEvents = append(stateEvents, types.Event{Event: input.Event.Unwrap()}) // stateEvents = append(stateEvents, types.Event{Event: inputEventUnwrapped})
for _, event := range stateEvents { for _, event := range stateEvents {
inviteState = append(inviteState, gomatrixserverlib.NewInviteV2StrippedState(&event.Event)) inviteState = append(inviteState, gomatrixserverlib.NewInviteV2StrippedState(&event.Event))
} }
fmt.Printf("INVITE STATE: %v\n \n", inviteState)
return inviteState, nil return inviteState, nil
} }