hicli/sync: ignore invites with no state
Some checks are pending
Go / Lint Go (old) (push) Waiting to run
Go / Lint Go (latest) (push) Waiting to run
JS / Lint JS (push) Waiting to run

This commit is contained in:
Tulir Asokan 2025-04-13 14:47:02 +03:00
parent a656ebb2e2
commit b754240715

View file

@ -274,6 +274,10 @@ func (h *HiClient) processSyncInvitedRoom(ctx context.Context, roomID id.RoomID,
CreatedAt: jsontime.UnixMilliNow(),
InviteState: room.State.Events,
}
if len(ir.InviteState) == 0 {
zerolog.Ctx(ctx).Warn().Stringer("room_id", roomID).Msg("Got invited room with no state, ignoring")
return nil
}
for _, evt := range room.State.Events {
if evt.Type == event.StateMember && evt.GetStateKey() == h.Account.UserID.String() && evt.Timestamp != 0 {
ir.CreatedAt = jsontime.UM(time.UnixMilli(evt.Timestamp))