mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-04-06 03:53:39 +00:00
Disable IncrementalSync stuff and re-assess
This commit is contained in:
parent
c7328cee41
commit
783fba2d6a
1 changed files with 21 additions and 17 deletions
|
@ -821,22 +821,25 @@ func (d *Database) getResponseWithPDUsForCompleteSync(
|
||||||
res.Rooms.Join[roomID] = *jr
|
res.Rooms.Join[roomID] = *jr
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract room state and recent events for all rooms the user has left
|
if filter.Room.IncludeLeave {
|
||||||
leaveRoomIDs, err := d.CurrentRoomState.SelectRoomIDsWithMembership(ctx, txn, userID, gomatrixserverlib.Leave)
|
var leaveRoomIDs []string
|
||||||
if err != nil {
|
// Extract room state and recent events for all rooms the user has left
|
||||||
return
|
leaveRoomIDs, err = d.CurrentRoomState.SelectRoomIDsWithMembership(ctx, txn, userID, gomatrixserverlib.Leave)
|
||||||
}
|
|
||||||
// Build up a /sync response. Add leave rooms.
|
|
||||||
for _, roomID := range leaveRoomIDs {
|
|
||||||
var lr *types.LeaveResponse
|
|
||||||
lr, err = d.getLeaveResponseForCompleteSync(
|
|
||||||
ctx, txn, roomID, r, filter, device,
|
|
||||||
)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// Build up a /sync response. Add leave rooms.
|
||||||
|
for _, roomID := range leaveRoomIDs {
|
||||||
|
var lr *types.LeaveResponse
|
||||||
|
lr, err = d.getLeaveResponseForCompleteSync(
|
||||||
|
ctx, txn, roomID, r, filter, device,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
res.Rooms.Leave[roomID] = *lr
|
res.Rooms.Leave[roomID] = *lr
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add peeked rooms.
|
// Add peeked rooms.
|
||||||
|
@ -909,7 +912,7 @@ func (d *Database) filterStreamEventsAccordingToHistoryVisibility(
|
||||||
}
|
}
|
||||||
// Default to spanning the rest of the array
|
// Default to spanning the rest of the array
|
||||||
sliceEnd := len(recentStreamEvents)
|
sliceEnd := len(recentStreamEvents)
|
||||||
// If there is a leaveEvent, then cut all events after the person left (exclude the leave itself too)
|
// If there is a leaveEvent, then cut all events after the person left (exclude the leave event too)
|
||||||
if leaveEventIndex != -1 {
|
if leaveEventIndex != -1 {
|
||||||
sliceEnd = leaveEventIndex
|
sliceEnd = leaveEventIndex
|
||||||
}
|
}
|
||||||
|
@ -1225,10 +1228,11 @@ func (d *Database) addRoomDeltaToResponse(
|
||||||
// "recentStreamEvents": fmt.Sprintf("%+v", events),
|
// "recentStreamEvents": fmt.Sprintf("%+v", events),
|
||||||
// }).Info("isync addRoomDeltaToResponse before")
|
// }).Info("isync addRoomDeltaToResponse before")
|
||||||
|
|
||||||
recentStreamEvents, limited, err = d.filterStreamEventsAccordingToHistoryVisibility(recentStreamEvents, device, limited)
|
// // asdf
|
||||||
if err != nil {
|
// recentStreamEvents, limited, err = d.filterStreamEventsAccordingToHistoryVisibility(recentStreamEvents, device, limited)
|
||||||
return err
|
// if err != nil {
|
||||||
}
|
// return err
|
||||||
|
// }
|
||||||
|
|
||||||
// events = make([]somematrixevent, len(recentStreamEvents))
|
// events = make([]somematrixevent, len(recentStreamEvents))
|
||||||
// for i, v := range recentStreamEvents {
|
// for i, v := range recentStreamEvents {
|
||||||
|
|
Loading…
Reference in a new issue