summaryrefslogtreecommitdiff
path: root/internal/storer/storer.go
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2021-03-18 03:01:46 +0300
committerAlexander Kiryukhin <a.kiryukhin@mail.ru>2021-03-18 03:01:46 +0300
commit37c250d538893ff8178bd9c9e4dde225a991ce76 (patch)
tree379350cdfe47d3691fef9c8c5ef91acddfba36d3 /internal/storer/storer.go
parent6f31f35c7b38fbf63d7a0c9322458e0b75828495 (diff)
pevent access from messengers
Diffstat (limited to 'internal/storer/storer.go')
-rw-r--r--internal/storer/storer.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/storer/storer.go b/internal/storer/storer.go
index b8b4ffd..99da8b8 100644
--- a/internal/storer/storer.go
+++ b/internal/storer/storer.go
@@ -65,7 +65,11 @@ func (s *Store) IsEncrypted(id string) (bool, error) {
var encrypted bool
return encrypted, s.db.View(func(txn *badger.Txn) error {
- value, err := txn.Get([]byte(id))
+ uid, err := xid.FromString(id)
+ if err != nil {
+ return err
+ }
+ value, err := txn.Get(uid.Bytes())
if err != nil {
return err
}