aboutsummaryrefslogtreecommitdiff
path: root/syncapi/storage/sqlite3/syncserver.go
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-03-30 15:02:20 +0100
committerGitHub <noreply@github.com>2020-03-30 15:02:20 +0100
commit11a8059bba9dbdc855f10e3b380c4a2f245635a2 (patch)
tree61b2ffaa53eecb6d4eef8e275f432734cbb9e606 /syncapi/storage/sqlite3/syncserver.go
parentf72b759426c1895b76c16ace526cc788713c2fea (diff)
Rename the typing server to EDU server (#948)
* Blunt move and sed rename * Rename common/ refs to typing * Rename internal stuff in eduserver * Rename docs and scripts * Rename constants/filenames, goimports everything to re-order imports
Diffstat (limited to 'syncapi/storage/sqlite3/syncserver.go')
-rw-r--r--syncapi/storage/sqlite3/syncserver.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/syncapi/storage/sqlite3/syncserver.go b/syncapi/storage/sqlite3/syncserver.go
index 8ff18900..30f77e54 100644
--- a/syncapi/storage/sqlite3/syncserver.go
+++ b/syncapi/storage/sqlite3/syncserver.go
@@ -33,8 +33,8 @@ import (
_ "github.com/mattn/go-sqlite3"
"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"
)
@@ -57,7 +57,7 @@ type SyncServerDatasource struct {
events outputRoomEventsStatements
roomstate currentRoomStateStatements
invites inviteEventsStatements
- typingCache *cache.TypingCache
+ eduCache *cache.EDUCache
topology outputRoomEventsTopologyStatements
backwardExtremities backwardExtremitiesStatements
}
@@ -84,7 +84,7 @@ func NewSyncServerDatasource(dataSourceName string) (*SyncServerDatasource, erro
if err = d.prepare(); err != nil {
return nil, err
}
- d.typingCache = cache.NewTypingCache()
+ d.eduCache = cache.New()
return &d, nil
}
@@ -429,7 +429,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
}
@@ -502,7 +502,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{
@@ -766,7 +766,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.
@@ -774,7 +774,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.
@@ -782,7 +782,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(