mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-10 23:53:09 -06:00
Rename Invalite -> InvalidateLazyLoadedUser
This commit is contained in:
parent
93442c6558
commit
b889ae9bb0
|
|
@ -14,7 +14,7 @@ type lazyLoadingCacheKey struct {
|
||||||
type LazyLoadCache interface {
|
type LazyLoadCache interface {
|
||||||
StoreLazyLoadedUser(device *userapi.Device, roomID, userID, eventID string)
|
StoreLazyLoadedUser(device *userapi.Device, roomID, userID, eventID string)
|
||||||
IsLazyLoadedUserCached(device *userapi.Device, roomID, userID string) (string, bool)
|
IsLazyLoadedUserCached(device *userapi.Device, roomID, userID string) (string, bool)
|
||||||
Invalidate(device *userapi.Device, roomID, userID string)
|
InvalidateLazyLoadedUser(device *userapi.Device, roomID, userID string)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Caches) StoreLazyLoadedUser(device *userapi.Device, roomID, userID, eventID string) {
|
func (c Caches) StoreLazyLoadedUser(device *userapi.Device, roomID, userID, eventID string) {
|
||||||
|
|
@ -35,7 +35,7 @@ func (c Caches) IsLazyLoadedUserCached(device *userapi.Device, roomID, userID st
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Caches) Invalidate(device *userapi.Device, roomID, userID string) {
|
func (c Caches) InvalidateLazyLoadedUser(device *userapi.Device, roomID, userID string) {
|
||||||
c.LazyLoading.Unset(lazyLoadingCacheKey{
|
c.LazyLoading.Unset(lazyLoadingCacheKey{
|
||||||
UserID: device.UserID,
|
UserID: device.UserID,
|
||||||
DeviceID: device.ID,
|
DeviceID: device.ID,
|
||||||
|
|
|
||||||
|
|
@ -104,12 +104,12 @@ func (p *PDUStreamProvider) CompleteSync(
|
||||||
req.Log.WithError(err).Error("unable to update event filter with ignored users")
|
req.Log.WithError(err).Error("unable to update event filter with ignored users")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Invalidate the lazyLoadCache, otherwise we end up with missing displaynames/avatars
|
// InvalidateLazyLoadedUser the lazyLoadCache, otherwise we end up with missing displaynames/avatars
|
||||||
// TODO: This might be inefficient, when joined to many and/or large rooms.
|
// TODO: This might be inefficient, when joined to many and/or large rooms.
|
||||||
for _, roomID := range joinedRoomIDs {
|
for _, roomID := range joinedRoomIDs {
|
||||||
joinedUsers := p.notifier.JoinedUsers(roomID)
|
joinedUsers := p.notifier.JoinedUsers(roomID)
|
||||||
for _, sharedUser := range joinedUsers {
|
for _, sharedUser := range joinedUsers {
|
||||||
p.lazyLoadCache.Invalidate(req.Device, roomID, sharedUser)
|
p.lazyLoadCache.InvalidateLazyLoadedUser(req.Device, roomID, sharedUser)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue