mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-18 17:53:42 -05:00
hicli/sync: ignore invites with no state
This commit is contained in:
parent
a656ebb2e2
commit
b754240715
1 changed files with 4 additions and 0 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue