Update conversations.

@param conversationsToUpdate List of conversations to apply an update.
@return Observable emitting result.
333295
public Observable<Boolean> updateConversations(List<ChatConversation> conversationsToUpdate) {

        return asObservable(new Executor<Boolean>() {
            @Override
            void execute(ChatStore store, Emitter<Boolean> emitter) {

                store.beginTransaction();

                boolean isSuccess = true;

                for (ChatConversationBase conversation : conversationsToUpdate) {
                    ChatConversationBase.Builder toSave = ChatConversationBase.baseBuilder();

                    ChatConversationBase saved = store.getConversation(conversation.getConversationId());
                    if (saved != null) {
                        toSave.setConversationId(saved.getConversationId());
                        toSave.setFirstLocalEventId(saved.getFirstLocalEventId());
                        toSave.setLastLocalEventId(saved.getLastLocalEventId());
                        if (conversation.getLastRemoteEventId() == null) {
                            toSave.setLastRemoteEventId(saved.getLastRemoteEventId());
                        } else {
                            toSave.setLastRemoteEventId(Math.max(saved.getLastRemoteEventId(), conversation.getLastRemoteEventId()));
                        }
                        if (conversation.getUpdatedOn() == null) {
                            toSave.setUpdatedOn(System.currentTimeMillis());
                        } else {
                            toSave.setUpdatedOn(conversation.getUpdatedOn());
                        }
                        toSave.setETag(conversation.getETag());
                    }
                    isSuccess = isSuccess && store.update(toSave.build());
                }

                store.endTransaction();

                emitter.onNext(isSuccess);
                emitter.onCompleted();
            }
        });

    }
806174
Observable<ComapiResult<List<Conversation>>> doGetConversations(@NonNull final String token, @NonNull final String profileId, @NonNull final Scope scope) {
        return wrapObservable(service.getConversations(AuthManager.addAuthPrefix(token), apiSpaceId, scope.getValue(), profileId).map(mapToComapiResult()), log, "Getting conversations " + profileId + " " + scope.name());
    }
204584
public int update(SQLiteDatabase db, ContentValues values) {
        assertTable();
        return db.update(mTable, values, getSelection(), getSelectionArgs());
    }
793448
public Observable<Boolean> upsertConversations(List<ChatConversation> conversationsToAdd) {

        return asObservable(new Executor<Boolean>() {
            @Override
            void execute(ChatStore store, Emitter<Boolean> emitter) {

                store.beginTransaction();

                boolean isSuccess = true;

                for (ChatConversation conversation : conversationsToAdd) {
                    ChatConversation.Builder toSave = ChatConversation.builder().populate(conversation);

                    ChatConversationBase saved = store.getConversation(conversation.getConversationId());
                    if (saved == null) {
                        toSave.setFirstLocalEventId(-1L);
                        toSave.setLastLocalEventId(-1L);
                        if (conversation.getLastRemoteEventId() == null) {
                            toSave.setLastRemoteEventId(-1L);
                        } else {
                            toSave.setLastRemoteEventId(conversation.getLastRemoteEventId());
                        }
                        if (conversation.getUpdatedOn() == null) {
                            toSave.setUpdatedOn(System.currentTimeMillis());
                        } else {
                            toSave.setUpdatedOn(conversation.getUpdatedOn());
                        }
                    } else {
                        toSave.setFirstLocalEventId(saved.getFirstLocalEventId());
                        toSave.setLastLocalEventId(saved.getLastLocalEventId());
                        if (conversation.getLastRemoteEventId() == null) {
                            toSave.setLastRemoteEventId(saved.getLastRemoteEventId());
                        } else {
                            toSave.setLastRemoteEventId(Math.max(saved.getLastRemoteEventId(), conversation.getLastRemoteEventId()));
                        }
                        if (conversation.getUpdatedOn() == null) {
                            toSave.setUpdatedOn(System.currentTimeMillis());
                        } else {
                            toSave.setUpdatedOn(conversation.getUpdatedOn());
                        }
                    }

                    isSuccess = isSuccess && store.upsert(toSave.build());
                }

                store.endTransaction();

                emitter.onNext(isSuccess);
                emitter.onCompleted();
            }
        });
    }
1165060
@Override
    public void update(double extrp, Handlables featurables)
    {
        for (final Updatable updatable : featurables.get(Updatable.class))
        {
            updatable.update(extrp);
        }
    }
87136
@Override
	public Response updateContact(String CorpNum, ContactInfo contactInfo, String UserID) throws PopbillException {
		String postData = toJsonString(contactInfo);

		return httppost("/IDs", CorpNum, postData, UserID, Response.class);
	}
229636
protected Map<String, NameWithUpdate> initUpdatesFromCurrentValues(Collection<MonolingualTextValue> currentValues) {
    	Map<String, NameWithUpdate> updates = new HashMap<>();
        for(MonolingualTextValue label: currentValues) {
            updates.put(label.getLanguageCode(),
                    new NameWithUpdate(label, false));
        }
        return updates;
    }
89532
public Observable<Boolean> upsertMessageStatuses(String conversationId, String profileId, List<MessageStatusUpdate> msgStatusList) {

        return asObservable(new Executor<Boolean>() {
            @Override
            void execute(ChatStore store, Emitter<Boolean> emitter) {

                store.beginTransaction();

                boolean isSuccess = false;
                for (MessageStatusUpdate statusUpdate : msgStatusList) {
                    for (String messageId : statusUpdate.getMessageIds()) {
                        LocalMessageStatus status = null;
                        if (MessageStatus.delivered.name().equals(statusUpdate.getStatus())) {
                            status = LocalMessageStatus.delivered;
                        } else if (MessageStatus.read.name().equals(statusUpdate.getStatus())) {
                            status = LocalMessageStatus.read;
                        }

                        if (status != null) {
                            isSuccess = store.update(ChatMessageStatus.builder().populate(conversationId, messageId, profileId, status, DateHelper.getUTCMilliseconds(statusUpdate.getTimestamp()), null).build());
                        }
                    }
                }

                store.endTransaction();

                emitter.onNext(isSuccess);
                emitter.onCompleted();
            }
        });
    }
1214818
public Conversation updateConversation(final String id, final ConversationStatus status)
            throws UnauthorizedException, GeneralException {
        if (id == null) {
            throw new IllegalArgumentException("Id must be specified.");
        }
        String url = String.format("%s%s/%s", CONVERSATIONS_BASE_URL, CONVERSATION_PATH, id);
        return messageBirdService.sendPayLoad("PATCH", url, status, Conversation.class);
    }
1188090
public Observable<Boolean> upsertConversation(ChatConversation conversation) {

        List<ChatConversation> conversations = new ArrayList<>();
        conversations.add(conversation);
        return upsertConversations(conversations);
    }
92797
public Observable<ChatResult> handleParticipantsAdded(final String conversationId) {
        return persistenceController.getConversation(conversationId).flatMap(conversation -> {
            if (conversation == null) {
                return handleNoLocalConversation(conversationId);
            } else {
                return Observable.fromCallable(() -> new ChatResult(true, null));
            }
        });
    }
1012778
public int addReply(int conversationId, String text) {
		return getResourceFactory()
				.getApiResource("/conversation/" + conversationId + "/reply")
				.entity(new MessageCreate(text),
						MediaType.APPLICATION_JSON_TYPE)
				.get(MessageCreateResponse.class).getMessageId();
	}
409681
@Override
    public void update() {
        mTotalValue = 0;
        for (PieModel slice : mPieData) {
            mTotalValue += slice.getValue();
        }
        onDataChanged();
    }
424952
public Response updateChatRoom(MUCRoomEntity chatRoom) {
		return restClient.put("chatrooms/" + chatRoom.getRoomName(), chatRoom, new HashMap<String, String>());
	}
445697
Observable<ChatResult> getPreviousMessages(final String conversationId) {

        return persistenceController.getConversation(conversationId)
                .map(conversation -> conversation != null ? conversation.getFirstLocalEventId() : null)
                .flatMap(from -> {

                    final Long queryFrom;

                    if (from != null) {

                        if (from == 0) {
                            return Observable.fromCallable(() -> new ChatResult(true, null));
                        } else if (from > 0) {
                            queryFrom = from - 1;
                        } else {
                            queryFrom = null;
                        }
                    } else {
                        queryFrom = null;
                    }

                    return checkState().flatMap(client -> client.service().messaging().queryMessages(conversationId, queryFrom, messagesPerQuery))
                            .flatMap(result -> persistenceController.processMessageQueryResponse(conversationId, result))
                            .flatMap(result -> persistenceController.processOrphanedEvents(result, orphanedEventsToRemoveListener))
                            .flatMap((Func1<ComapiResult<MessagesQueryResponse>, Observable<ChatResult>>) result -> (result.isSuccessful() && result.getResult().getMessages().isEmpty() && result.getResult().getEarliestEventId() > 0) ?
                                    getPreviousMessages(conversationId) :
                                    Observable.fromCallable(() -> new ChatResult(result.isSuccessful(), result.isSuccessful() ? null : new ChatResult.Error(result))));
                });
    }
145724
public Conversation conversation(Member author, String content, Map<String, Object> attributes) {
        Conversation conversation = new Conversation(instance);
        conversation.save();
        Expression expression = new Expression(instance);
        DateTime utcNow = new DateTime(DateTime.convertLocalToUtc(new Date()));
        expression.setAuthor(author);
        expression.setAuthoredAt(utcNow);
        expression.setContent(content);
        expression.setBelongsTo(conversation);
        addAttributes(expression, attributes);
        expression.save();
        return conversation;
    }
10934
@Override
    public void update(Object pData) throws APPErrorException {
        valid(pData);
        mDao.updateByPrimaryKey(pData);
    }