aboutsummaryrefslogtreecommitdiff
path: root/syncapi/storage/postgres/syncserver.go
diff options
context:
space:
mode:
Diffstat (limited to 'syncapi/storage/postgres/syncserver.go')
-rw-r--r--syncapi/storage/postgres/syncserver.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/syncapi/storage/postgres/syncserver.go b/syncapi/storage/postgres/syncserver.go
index f3f1aabc..ead1bf33 100644
--- a/syncapi/storage/postgres/syncserver.go
+++ b/syncapi/storage/postgres/syncserver.go
@@ -30,8 +30,8 @@ import (
// Import the postgres database driver.
_ "github.com/lib/pq"
"github.com/matrix-org/dendrite/common"
+ "github.com/matrix-org/dendrite/eduserver/cache"
"github.com/matrix-org/dendrite/syncapi/types"
- "github.com/matrix-org/dendrite/typingserver/cache"
"github.com/matrix-org/gomatrixserverlib"
)
@@ -53,7 +53,7 @@ type SyncServerDatasource struct {
events outputRoomEventsStatements
roomstate currentRoomStateStatements
invites inviteEventsStatements
- typingCache *cache.TypingCache
+ eduCache *cache.EDUCache
topology outputRoomEventsTopologyStatements
backwardExtremities backwardExtremitiesStatements
}
@@ -86,7 +86,7 @@ func NewSyncServerDatasource(dbDataSourceName string) (*SyncServerDatasource, er
if err := d.backwardExtremities.prepare(d.db); err != nil {
return nil, err
}
- d.typingCache = cache.NewTypingCache()
+ d.eduCache = cache.New()
return &d, nil
}
@@ -395,7 +395,7 @@ func (d *SyncServerDatasource) syncPositionTx(
maxEventID = maxInviteID
}
sp.PDUPosition = types.StreamPosition(maxEventID)
- sp.EDUTypingPosition = types.StreamPosition(d.typingCache.GetLatestSyncPosition())
+ sp.EDUTypingPosition = types.StreamPosition(d.eduCache.GetLatestSyncPosition())
return
}
@@ -468,7 +468,7 @@ func (d *SyncServerDatasource) addTypingDeltaToResponse(
var ok bool
var err error
for _, roomID := range joinedRoomIDs {
- if typingUsers, updated := d.typingCache.GetTypingUsersIfUpdatedAfter(
+ if typingUsers, updated := d.eduCache.GetTypingUsersIfUpdatedAfter(
roomID, int64(since.EDUTypingPosition),
); updated {
ev := gomatrixserverlib.ClientEvent{
@@ -719,7 +719,7 @@ func (d *SyncServerDatasource) RetireInviteEvent(
}
func (d *SyncServerDatasource) SetTypingTimeoutCallback(fn cache.TimeoutCallbackFn) {
- d.typingCache.SetTimeoutCallback(fn)
+ d.eduCache.SetTimeoutCallback(fn)
}
// AddTypingUser adds a typing user to the typing cache.
@@ -727,7 +727,7 @@ func (d *SyncServerDatasource) SetTypingTimeoutCallback(fn cache.TimeoutCallback
func (d *SyncServerDatasource) AddTypingUser(
userID, roomID string, expireTime *time.Time,
) types.StreamPosition {
- return types.StreamPosition(d.typingCache.AddTypingUser(userID, roomID, expireTime))
+ return types.StreamPosition(d.eduCache.AddTypingUser(userID, roomID, expireTime))
}
// RemoveTypingUser removes a typing user from the typing cache.
@@ -735,7 +735,7 @@ func (d *SyncServerDatasource) AddTypingUser(
func (d *SyncServerDatasource) RemoveTypingUser(
userID, roomID string,
) types.StreamPosition {
- return types.StreamPosition(d.typingCache.RemoveUser(userID, roomID))
+ return types.StreamPosition(d.eduCache.RemoveUser(userID, roomID))
}
func (d *SyncServerDatasource) addInvitesToResponse(