Handles conversation delete service response.

@param conversationId Unique identifier of an conversation.
@param result         Service call response.
@return Observable emitting result of operations.
769469
Observable<ChatResult> handleConversationDeleted(String conversationId, ComapiResult<Void> result) {
        if (result.getCode() != ETAG_NOT_VALID) {
            return persistenceController.deleteConversation(conversationId).map(success -> adapter.adaptResult(result, success));
        } else {
            return checkState().flatMap(client -> client.service().messaging().getConversation(conversationId)
                    .flatMap(newResult -> {
                        if (newResult.isSuccessful()) {
                            return persistenceController.upsertConversation(ChatConversation.builder().populate(newResult.getResult(), newResult.getETag()).build())
                                    .flatMap(success -> Observable.fromCallable(() -> new ChatResult(false, success ? new ChatResult.Error(ETAG_NOT_VALID, "Conversation updated, try delete again.", "Conversation "+conversationId+" updated in response to  wrong eTag error when deleting.") : new ChatResult.Error(0, "Error updating custom store.", null))));
                        } else {
                            return Observable.fromCallable(() -> adapter.adaptResult(newResult));
                        }
                    }));
        }
    }
764905
Observable<ChatResult> synchroniseConversation(String conversationId) {

        return checkState().flatMap(client -> client.service().messaging()
                .queryMessages(conversationId, null, 1)
                .map(result -> {
                    if (result.isSuccessful() && result.getResult() != null) {
                        return (long) result.getResult().getLatestEventId();
                    }
                    return -1L;
                })
                .flatMap(result -> persistenceController.getConversation(conversationId).map(loaded -> compare(result, loaded)))
                .flatMap(this::updateLocalConversationList)
                .flatMap(result -> lookForMissingEvents(client, result))
                .map(result -> new ChatResult(result.isSuccessful, null)));
    }
1209750
public Observable<Boolean> handleMessage(final ChatMessage message) {

        String sender = message.getSentBy();

        Observable<Boolean> replaceMessages = persistenceController.updateStoreWithNewMessage(message, noConversationListener);

        if (!TextUtils.isEmpty(sender) && !sender.equals(getProfileId())) {

            final Set<String> ids = new HashSet<>();
            ids.add(message.getMessageId());

            return Observable.zip(replaceMessages, markDelivered(message.getConversationId(), ids), (saved, result) -> saved && result.isSuccessful());

        } else {

            return replaceMessages;
        }
    }
618453
def handle_call_response(self, result, node):
        
        if not result[0]:
            log.warning("no response from %s, removing from router", node)
            self.router.remove_contact(node)
            return result

        log.info("got successful response from %s", node)
        self.welcome_if_new(node)
        return result
771014
public <T> void notifySuccess(final Callback<T> callback, final T result) {
    invokeLater(new Runnable() {
      public void run() {
        callback.onSuccess(result);
      }
    });
  }
588855
function(conversationId, operations, callback) {
      conversationId = utils.toUUID(conversationId);
      if (!conversationId) return callback(new Error(utils.i18n.conversations.id));
      if (!utils.isArray(operations)) return callback(new Error(utils.i18n.conversations.operations));
      utils.debug('Conversation edit: ' + conversationId);

      edit(conversationId, operations, callback);
    }
725228
public Observable<ServiceResponse<Void>> deleteIterationWithServiceResponseAsync(UUID projectId, UUID iterationId) {
        if (projectId == null) {
            throw new IllegalArgumentException("Parameter projectId is required and cannot be null.");
        }
        if (iterationId == null) {
            throw new IllegalArgumentException("Parameter iterationId is required and cannot be null.");
        }
        if (this.client.apiKey() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null.");
        }
        return service.deleteIteration(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
                @Override
                public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<Void> clientResponse = deleteIterationDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
1116707
public void onDeleteResponseEvent(ResponseEvent event,
			ActivityContextInterface aci) {
		if (event.getException() != null) {
			if (tracer.isInfoEnabled()) {
				tracer.info("Failed to delete " + event.getURI(),
						event.getException());
			}

			getParent().deleteResponse(event.getURI(), 500, null, null);
		} else {
			final XcapResponse response = event.getResponse();
			if (tracer.isInfoEnabled()) {
				if (response.getCode() == 200) {
					tracer.info("Deleted " + event.getURI() + ". ETag:"
							+ response.getETag());
				} else {
					tracer.info("Failed to delete " + event.getURI()
							+ ". Response: " + response);
				}
			}
			getParent().deleteResponse(event.getURI(), response.getCode(),
					response.getEntity().getContentAsString(),
					response.getETag());
		}
	}
1074876
Observable<ComapiResult<Void>> markDelivered(String conversationId, Set<String> ids) {

        final List<MessageStatusUpdate> updates = new ArrayList<>();
        updates.add(MessageStatusUpdate.builder().setMessagesIds(ids).setStatus(MessageStatus.delivered).setTimestamp(DateHelper.getCurrentUTC()).build());

        return checkState().flatMap(client -> client.service().messaging().updateMessageStatus(conversationId, updates)
                .retryWhen(observable -> {
                    return observable.zipWith(Observable.range(1, 3), (Func2<Throwable, Integer, Integer>) (throwable, integer) -> integer).flatMap(new Func1<Integer, Observable<Long>>() {
                        @Override
                        public Observable<Long> call(Integer retryCount) {
                            return Observable.timer((long) Math.pow(1, retryCount), TimeUnit.SECONDS);
                        }
                    });
                }
                ));
    }
111841
public void onOperationCompleted(String clientId, String conversationId, int requestId,
                                   Conversation.AVIMOperation operation, Throwable throwable) {
    if (AVIMOperation.CONVERSATION_QUERY == operation) {
      AVCallback callback = RequestCache.getInstance().getRequestCallback(clientId, null, requestId);
      if (null != callback) {
        // internal query conversation.
        callback.internalDone(null, AVIMException.wrapperAVException(throwable));
        RequestCache.getInstance().cleanRequestCallback(clientId, null, requestId);
        return;
      }
    }
    IntentUtil.sendIMLocalBroadcast(clientId, conversationId, requestId, throwable, operation);
  }
216606
@Override
    public java.util.concurrent.Future<DeleteMessageResult> deleteMessageAsync(String queueUrl, String receiptHandle) {

        return deleteMessageAsync(new DeleteMessageRequest().withQueueUrl(queueUrl).withReceiptHandle(receiptHandle));
    }
1229333
private Observable<ChatResult> handleMessageError(MessageProcessor mp, Throwable t) {
        return persistenceController.updateStoreForSentError(mp.getConversationId(), mp.getTempId(), mp.getSender())
                .map(success -> new ChatResult(false, new ChatResult.Error(0, t)));
    }
684288
public void removeParticipants(@NonNull final String conversationId, @NonNull final List<String> ids, @Nullable Callback<ComapiResult<Void>> callback) {
        adapter.adapt(removeParticipants(conversationId, ids), callback);
    }
677990
protected void processResult(RO result) {
        for (ResultHandler<RO> resultHandler : resultHandlers) {
            resultHandler.handleResult(result);
        }
    }
61834
public void deleteMessage(final String id) throws UnauthorizedException, GeneralException, NotFoundException {
        if (id == null) {
            throw new IllegalArgumentException("Message ID must be specified.");
        }
        messageBirdService.deleteByID(MESSAGESPATH, id);
    }
169879
@Override
    public void handleResult(RHI result) {
        for (ResultHandler<RHI> resultHandler : resultHandlers) {
            resultHandler.handleResult(result);
        }
    }
713869
public static ReplyObject success(final String name, final Object result) {
        final ReplyObject ret = new ReplyObject(name, result);
        ret.success = true;
        return ret;
    }