Implement devices API (#20)
small improvements Cargo fmt Simplify insert and update methods Review feedback Remove has_device method calls Load all devices with a single db call Remove device as in logout Put all metadata on the same tree Create userdevice key fucntion Implement devices API Implement all the devices endpoints. There's a couple of pending tasks: - Integrate the "logout" logic once it lands to master (this should remove the given device from the database). - Track and store last seen timestamp and IP. Co-authored-by: timokoesters <timo@koesters.xyz> Co-authored-by: Guillem Nieto <gnieto.talo@gmail.com>
This commit is contained in:
parent
720d48bd67
commit
ed9b544ace
4 changed files with 190 additions and 26 deletions
|
@ -56,10 +56,10 @@ impl Database {
|
|||
),
|
||||
users: users::Users {
|
||||
userid_password: db.open_tree("userid_password").unwrap(),
|
||||
userdeviceids: db.open_tree("userdeviceids").unwrap(),
|
||||
userid_displayname: db.open_tree("userid_displayname").unwrap(),
|
||||
userid_avatarurl: db.open_tree("userid_avatarurl").unwrap(),
|
||||
userdeviceid_token: db.open_tree("userdeviceid_token").unwrap(),
|
||||
userdeviceid_metadata: db.open_tree("userdeviceid_metadata").unwrap(),
|
||||
token_userdeviceid: db.open_tree("token_userdeviceid").unwrap(),
|
||||
onetimekeyid_onetimekeys: db.open_tree("onetimekeyid_onetimekeys").unwrap(),
|
||||
userdeviceid_devicekeys: db.open_tree("userdeviceid_devicekeys").unwrap(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue