diff options
author | Alex Auvolat <alex@adnab.me> | 2020-02-21 19:36:16 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-02-21 19:36:45 +0100 |
commit | a14bacc9c13309593c6eab2d19b70bcd315d193d (patch) | |
tree | 4d2cee5b2d34b5539c86d9b30a369285e7fd0aaf /appservice | |
parent | b0644c3a17dfd1a55f4ed5f4f91fcc84e74359ed (diff) | |
download | easybridge-a14bacc9c13309593c6eab2d19b70bcd315d193d.tar.gz easybridge-a14bacc9c13309593c6eab2d19b70bcd315d193d.zip |
Keep in cache the Id of the last seen post for backlogging purposes
Diffstat (limited to 'appservice')
-rw-r--r-- | appservice/account.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/appservice/account.go b/appservice/account.go index e2f2ee9..e17c425 100644 --- a/appservice/account.go +++ b/appservice/account.go @@ -315,3 +315,17 @@ func (a *Account) eventInternal(event *Event) error { return nil } } + +// ---- + +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) +} + +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) +} |