Add method to load devices of specific user from server

This commit is contained in:
Tulir Asokan 2020-07-24 23:49:55 +03:00
commit fab44b8317

View file

@ -23,6 +23,10 @@ var (
InvalidKeySignature = errors.New("invalid signature on device keys")
)
func (mach *OlmMachine) LoadDevices(user id.UserID) map[id.DeviceID]*DeviceIdentity {
return mach.fetchKeys([]id.UserID{user}, "", true)[user]
}
func (mach *OlmMachine) fetchKeys(users []id.UserID, sinceToken string, includeUntracked bool) (data map[id.UserID]map[id.DeviceID]*DeviceIdentity) {
req := &mautrix.ReqQueryKeys{
DeviceKeys: mautrix.DeviceKeysRequest{},