code: private boolean doUpdateConversationFromEvent(ChatStore store, String conversationId, Long eventId, Long updatedOn) {
  
          ChatConversationBase conversation = store.getConversation(conversationId);
  
          if (conversation != null) {
  
              ChatConversationBase.Builder builder = ChatConversationBase.baseBuilder().populate(conversation);
  
              if (eventId != null) {
                  if (conversation.getLastRemoteEventId() < eventId) {
                      builder.setLastRemoteEventId(eventId);
                  }
                  if (conversation.getLastLocalEventId() < eventId) {
                      builder.setLastLocalEventId(eventId);
                  }
                  if (conversation.getFirstLocalEventId() == -1) {
                      builder.setFirstLocalEventId(eventId);
                  }
                  if (conversation.getUpdatedOn() < updatedOn) {
                      builder.setUpdatedOn(updatedOn);
                  }
              }
  
              return store.update(builder.build());
          }
          return false;
      }
docs: Update conversation state with received event details. This should be called only inside transaction.
  
  @param store          Chat Store instance.
  @param conversationId Unique conversation id.
  @param eventId        Conversation event id.
  @param updatedOn      New timestamp of state update.
  @return True if successful.