hicli/sync: enable reaction count collection for all events

The reaction aggregation probably needs to be redone to support finding
the entire event (to see senders and other content like shortcodes),
but this is good enough to get reactions rendering.
This commit is contained in:
Tulir Asokan 2024-10-21 23:11:02 +03:00
parent 3296c38454
commit f5eeb8461a
2 changed files with 5 additions and 0 deletions

View file

@ -220,6 +220,10 @@ func (h *HiClient) PaginateServer(ctx context.Context, roomID id.RoomID, limit i
return fmt.Errorf("failed to save session request for %s: %w", entry.SessionID, err)
}
}
err = h.DB.Event.FillReactionCounts(ctx, roomID, events)
if err != nil {
return fmt.Errorf("failed to fill last edit row IDs: %w", err)
}
err = h.DB.Event.FillLastEditRowIDs(ctx, roomID, events)
if err != nil {
return fmt.Errorf("failed to fill last edit row IDs: %w", err)

View file

@ -430,6 +430,7 @@ func (h *HiClient) processEvent(
}
}
dbEvt := database.MautrixToEvent(evt)
dbEvt.Reactions = make(map[string]int)
contentWithoutFallback := removeReplyFallback(evt)
if contentWithoutFallback != nil {
dbEvt.Content = contentWithoutFallback