mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-19 18:13:41 -05:00
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:
parent
3296c38454
commit
f5eeb8461a
2 changed files with 5 additions and 0 deletions
|
@ -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)
|
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)
|
err = h.DB.Event.FillLastEditRowIDs(ctx, roomID, events)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to fill last edit row IDs: %w", err)
|
return fmt.Errorf("failed to fill last edit row IDs: %w", err)
|
||||||
|
|
|
@ -430,6 +430,7 @@ func (h *HiClient) processEvent(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dbEvt := database.MautrixToEvent(evt)
|
dbEvt := database.MautrixToEvent(evt)
|
||||||
|
dbEvt.Reactions = make(map[string]int)
|
||||||
contentWithoutFallback := removeReplyFallback(evt)
|
contentWithoutFallback := removeReplyFallback(evt)
|
||||||
if contentWithoutFallback != nil {
|
if contentWithoutFallback != nil {
|
||||||
dbEvt.Content = contentWithoutFallback
|
dbEvt.Content = contentWithoutFallback
|
||||||
|
|
Loading…
Add table
Reference in a new issue