@Override public void onRetry() { claimOneTimeKeysForUsersDevices(usersDevicesKeyTypesMap, callback); } }) {
@Override public void onRetry() { downloadKeysForUsers(userIds, token, callback); } }));
@Override public void onRetry() { uploadKeys(deviceKeys, oneTimeKeys, deviceId, callback); } }));
bobSession.getCryptoRestClient().uploadKeys(null, otks, "dev1", new TestApiCallback<KeysUploadResponse>(lock1) { @Override public void onSuccess(KeysUploadResponse keysUploadResponse) { aliceSession.getCryptoRestClient().claimOneTimeKeysForUsersDevices(usersDevicesKeyTypesMap, new TestApiCallback<MXUsersDevicesMap<MXKey>>(lock2) { @Override public void onSuccess(MXUsersDevicesMap<MXKey> usersDevicesMap) {
bobSession.getCryptoRestClient().uploadKeys(bobDevice.JSONDictionary(), null, "dev1", new TestApiCallback<KeysUploadResponse>(lock0) { @Override public void onSuccess(KeysUploadResponse keysUploadResponse) { bobSession.getCryptoRestClient().downloadKeysForUsers(Arrays.asList(bobSession.getMyUserId()), null, new TestApiCallback<KeysQueryResponse>(lock1) { @Override public void onSuccess(KeysQueryResponse keysQueryResponse) {
@Override public void onRetry() { sendToDevice(eventType, contentMap, callback); } }));
@Override public void onRetry() { deleteDevice(deviceId, params, callback); } }));
@Override public void onRetry() { getDevices(callback); } }));
/** * Set a device name. * * @param deviceId the device id * @param deviceName the device name * @param callback the asynchronous callback */ public void setDeviceName(final String deviceId, final String deviceName, final ApiCallback<Void> callback) { mCryptoRestClient.setDeviceName(deviceId, deviceName, callback); }
@Override public void onRetry() { getKeyChanges(from, to, callback); } }));
mCallRestClient = new CallRestClient(hsConfig); mAccountDataRestClient = new AccountDataRestClient(hsConfig); mCryptoRestClient = new CryptoRestClient(hsConfig); mLoginRestClient = new LoginRestClient(hsConfig); mGroupsRestClient = new GroupsRestClient(hsConfig);
mCallRestClient.setUnsentEventsManager(mUnsentEventsManager); mAccountDataRestClient.setUnsentEventsManager(mUnsentEventsManager); mCryptoRestClient.setUnsentEventsManager(mUnsentEventsManager); mLoginRestClient.setUnsentEventsManager(mUnsentEventsManager); mGroupsRestClient.setUnsentEventsManager(mUnsentEventsManager);
/** * Send an event to a specific list of devices * * @param eventType the type of event to send * @param contentMap content to send. Map from user_id to device_id to content dictionary. * @param callback the asynchronous callback. */ public void sendToDevice(final String eventType, final MXUsersDevicesMap<Map<String, Object>> contentMap, final ApiCallback<Void> callback) { sendToDevice(eventType, contentMap, (new Random()).nextInt(Integer.MAX_VALUE) + "", callback); }
stages.remove(0); mCryptoRestClient.deleteDevice(deviceId, params, new SimpleApiCallback<Void>(callback) { @Override public void onSuccess(Void info) {
/** * Retrieves the devices list * * @param callback the asynchronous callback */ public void getDevicesList(ApiCallback<DevicesListResponse> callback) { mCryptoRestClient.getDevices(callback); }
@Override public void onRetry() { setDeviceName(deviceId, deviceName, callback); } }));
@Override public void onRetry() { uploadKeys(deviceKeys, oneTimeKeys, deviceId, callback); } }));
.downloadKeysForUsers(filteredUsers, mxSession.getDataHandler().getStore().getEventStreamToken(), new ApiCallback<KeysQueryResponse>() { @Override public void onSuccess(final KeysQueryResponse keysQueryResponse) {
mSession.getCryptoRestClient().claimOneTimeKeysForUsersDevices(usersDevicesToClaim, new ApiCallback<MXUsersDevicesMap<MXKey>>() { @Override public void onSuccess(final MXUsersDevicesMap<MXKey> oneTimeKeys) {
/** * Send a RoomKeyRequest to a list of recipients * * @param message the message * @param recipients the recipients. * @param transactionId the transaction id * @param callback the asynchronous callback. */ private void sendMessageToDevices(final Map<String, Object> message, List<Map<String, String>> recipients, String transactionId, final ApiCallback<Void> callback) { MXUsersDevicesMap<Map<String, Object>> contentMap = new MXUsersDevicesMap<>(); for (Map<String, String> recipient : recipients) { contentMap.setObject(message, recipient.get("userId"), recipient.get("deviceId")); } mSession.getCryptoRestClient().sendToDevice(Event.EVENT_TYPE_ROOM_KEY_REQUEST, contentMap, transactionId, callback); } }