/** * Update the URL preview status * * @param roomId the roomId * @param status the new status * @param callback the operation callback */ public void updateURLPreviewStatus(final String roomId, final boolean status, final ApiCallback<Void> callback) { final String description = "updateURLPreviewStatus : roomId " + roomId + " - status " + status; Map<String, Object> params = new HashMap<>(); params.put(AccountDataElement.ACCOUNT_DATA_KEY_URL_PREVIEW_DISABLE, !status); mApi.updateAccountData(getCredentials().userId, roomId, Event.EVENT_TYPE_URL_PREVIEW, params) .enqueue(new RestAdapterCallback<Void>(description, mUnsentEventsManager, callback, new RestAdapterCallback.RequestRetryCallBack() { @Override public void onRetry() { updateURLPreviewStatus(roomId, status, callback); } })); }
/** * Add a tag to a room. * Use this method to update the order of an existing tag. * * @param roomId the roomId * @param tag the new tag to add to the room. * @param order the order. * @param callback the operation callback */ public void addTag(final String roomId, final String tag, final Double order, final ApiCallback<Void> callback) { final String description = "addTag : roomId " + roomId + " - tag " + tag + " - order " + order; Map<String, Object> hashMap = new HashMap<>(); hashMap.put("order", order); mApi.addTag(getCredentials().userId, roomId, tag, hashMap) .enqueue(new RestAdapterCallback<Void>(description, mUnsentEventsManager, callback, new RestAdapterCallback.RequestRetryCallBack() { @Override public void onRetry() { addTag(roomId, tag, order, callback); } })); }
/** * Remove a tag to a room. * * @param roomId the roomId * @param tag the new tag to add to the room. * @param callback the operation callback */ public void removeTag(final String roomId, final String tag, final ApiCallback<Void> callback) { final String description = "removeTag : roomId " + roomId + " - tag " + tag; mApi.removeTag(getCredentials().userId, roomId, tag) .enqueue(new RestAdapterCallback<Void>(description, mUnsentEventsManager, callback, new RestAdapterCallback.RequestRetryCallBack() { @Override public void onRetry() { removeTag(roomId, tag, callback); } })); }