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:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user