@Override public void onRetry() { openIdToken(userId, callback); } }));
@Override public void onRetry() { setAccountData(userId, type, params, callback); } }));
mAccountDataRestClient = new AccountDataRestClient(hsConfig); mCryptoRestClient = new CryptoRestClient(hsConfig); mLoginRestClient = new LoginRestClient(hsConfig);
mThirdPidRestClient.setUnsentEventsManager(mUnsentEventsManager); mCallRestClient.setUnsentEventsManager(mUnsentEventsManager); mAccountDataRestClient.setUnsentEventsManager(mUnsentEventsManager); mCryptoRestClient.setUnsentEventsManager(mUnsentEventsManager); mLoginRestClient.setUnsentEventsManager(mUnsentEventsManager);
/** * Triggers a request to update the userIds to ignore * * @param userIds the userIds to ignore * @param callback the callback */ private void updateUsers(List<String> userIds, ApiCallback<Void> callback) { Map<String, Object> ignoredUsersDict = new HashMap<>(); for (String userId : userIds) { ignoredUsersDict.put(userId, new HashMap<>()); } Map<String, Object> params = new HashMap<>(); params.put(AccountDataElement.ACCOUNT_DATA_KEY_IGNORED_USERS, ignoredUsersDict); mAccountDataRestClient.setAccountData(getMyUserId(), AccountDataElement.ACCOUNT_DATA_TYPE_IGNORED_USER_LIST, params, callback); }
/** * Gets a bearer token from the homeserver that the user can * present to a third party in order to prove their ownership * of the Matrix account they are logged into. * * @param callback the asynchronous callback called when finished */ public void openIdToken(final ApiCallback<Map<Object, Object>> callback) { mAccountDataRestClient.openIdToken(getMyUserId(), callback); }
mAccountDataRestClient.setAccountData(getMyUserId(), AccountDataElement.ACCOUNT_DATA_TYPE_PREVIEW_URLS, params, new ApiCallback<Void>() { @Override public void onSuccess(Void info) {
Log.d(LOG_TAG, "## addUserWidget()"); mAccountDataRestClient.setAccountData(getMyUserId(), AccountDataElement.ACCOUNT_DATA_TYPE_WIDGETS, params, new ApiCallback<Void>() { @Override public void onSuccess(Void info) {
/** * Store and upload the provided direct chat rooms map. * * @param directChatRoomsMap the direct chats map * @param callback the asynchronous callback */ public void setDirectChatRoomsMap(Map<String, List<String>> directChatRoomsMap, ApiCallback<Void> callback) { Log.d(LOG_TAG, "## setDirectChatRoomsMap()"); IMXStore store = getStore(); if (null != store) { // update the store value // do not wait the server request echo to update the store store.setDirectChatRoomsDict(directChatRoomsMap); } else { Log.e(LOG_TAG, "## setDirectChatRoomsMap() : null store"); } mLocalDirectChatRoomIdsList = null; // Upload the new map mAccountDataRestClient.setAccountData(getMyUser().user_id, AccountDataElement.ACCOUNT_DATA_TYPE_DIRECT_MESSAGES, directChatRoomsMap, callback); }
mAccountDataRestClient.setAccountData(mCredentials.userId, AccountDataElement.ACCOUNT_DATA_TYPE_DIRECT_MESSAGES, updatedDirectChatRoomsDict, new ApiCallback<Void>() { @Override