mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-02-07 03:24:27 -06:00
update
This commit is contained in:
parent
133c77d93b
commit
1f44a77037
|
@ -86,6 +86,9 @@ func Threads(
|
|||
headeredEvents, _, res.NextBatch, err = snapshot.ThreadsFor(
|
||||
req.Context(), roomID.String(), userID, from, limit,
|
||||
)
|
||||
if err != nil {
|
||||
return util.ErrorResponse(err)
|
||||
}
|
||||
|
||||
for _, event := range headeredEvents {
|
||||
ce, err := synctypes.ToClientEvent(event, synctypes.FormatAll, func(roomID spec.RoomID, senderID spec.SenderID) (*spec.UserID, error) {
|
||||
|
|
|
@ -834,7 +834,7 @@ func (d *DatabaseTransaction) ThreadsFor(ctx context.Context, roomID, userID str
|
|||
// First look up any threads from the database. We add one to the limit here
|
||||
// so that we can tell if we're overflowing, as we will only set the "next_batch"
|
||||
// in the response if we are.
|
||||
eventIDs, _, err := d.Relations.SelectThreads(ctx, d.txn, roomID, userID, from, limit+1)
|
||||
eventIDs, pos, err := d.Relations.SelectThreads(ctx, d.txn, roomID, userID, from, limit+1)
|
||||
|
||||
if err != nil {
|
||||
return nil, "", "", fmt.Errorf("d.Relations.SelectRelationsInRange: %w", err)
|
||||
|
@ -845,5 +845,5 @@ func (d *DatabaseTransaction) ThreadsFor(ctx context.Context, roomID, userID str
|
|||
return nil, "", "", fmt.Errorf("d.OutputEvents.SelectEvents: %w", err)
|
||||
}
|
||||
|
||||
return events, prevBatch, nextBatch, nil
|
||||
return events, prevBatch, fmt.Sprintf("%d", pos), nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue