aboutsummaryrefslogtreecommitdiff
path: root/account.go
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-02-28 10:34:22 +0100
committerAlex Auvolat <alex@adnab.me>2020-02-28 10:34:22 +0100
commit8668b12a811c79e4ea759616daf645080d7d763d (patch)
treee6dcf357abc9f73bbb8054a4cbad9e097c0f1256 /account.go
parent30a5cdc2a3088995a6ab1521d6b97715ec0a36f5 (diff)
downloadeasybridge-8668b12a811c79e4ea759616daf645080d7d763d.tar.gz
easybridge-8668b12a811c79e4ea759616daf645080d7d763d.zip
Rename DbCache to DbKv
Diffstat (limited to 'account.go')
-rw-r--r--account.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/account.go b/account.go
index c975c6e..59809e7 100644
--- a/account.go
+++ b/account.go
@@ -291,7 +291,7 @@ func (a *Account) userInfoUpdatedInternal(user UserID, info *UserInfo) error {
if info.Avatar != nil {
cache_key := fmt.Sprintf("%s/user_avatar/%s", a.Protocol, user)
cache_val := info.Avatar.Filename()
- if cache_val == "" || dbCacheTestAndSet(cache_key, cache_val) {
+ if cache_val == "" || dbKvTestAndSet(cache_key, cache_val) {
err2 := mx.ProfileAvatar(mx_user_id, info.Avatar)
if err2 != nil {
err = err2
@@ -345,7 +345,7 @@ func (a *Account) roomInfoUpdatedInternal(roomId RoomID, author UserID, info *Ro
if info.Picture != nil {
cache_key := fmt.Sprintf("%s/room_picture/%s", a.Protocol, roomId)
cache_val := info.Picture.Filename()
- if cache_val == "" || dbCacheTestAndSet(cache_key, cache_val) {
+ if cache_val == "" || dbKvTestAndSet(cache_key, cache_val) {
err2 := mx.RoomAvatarAs(mx_room_id, info.Picture, as_mxid)
if err2 != nil {
err = err2
@@ -417,7 +417,7 @@ func (a *Account) eventInternal(event *Event) error {
if event.Id != "" {
cache_key := fmt.Sprintf("%s/event_seen/%s/%s",
a.Protocol, mx_room_id, event.Id)
- if !dbCacheTestAndSet(cache_key, "yes") {
+ if !dbKvTestAndSet(cache_key, "yes") {
// false: cache key was not modified, meaning we
// already saw the event
return nil
@@ -475,11 +475,11 @@ func (a *Account) eventInternal(event *Event) error {
func (a *Account) CacheGet(key string) string {
cache_key := fmt.Sprintf("%s/account/%s/%s/%s",
a.Protocol, a.MatrixUser, a.AccountName, key)
- return dbCacheGet(cache_key)
+ return dbKvGet(cache_key)
}
func (a *Account) CachePut(key string, value string) {
cache_key := fmt.Sprintf("%s/account/%s/%s/%s",
a.Protocol, a.MatrixUser, a.AccountName, key)
- dbCachePut(cache_key, value)
+ dbKvPut(cache_key, value)
}