From 37c250d538893ff8178bd9c9e4dde225a991ce76 Mon Sep 17 00:00:00 2001 From: Alexander Kiryukhin Date: Thu, 18 Mar 2021 03:01:46 +0300 Subject: pevent access from messengers --- internal/storer/storer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'internal/storer') 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 } -- cgit v1.2.3