Get only new messages from conversation.

@since 2.0.0
@access public

@param int $ConversationID Unique ID of conversation being viewed.
@param int $LastMessageID Unique ID of last message to be viewed.
@return Gdn_DataSet SQL results.
197965
public function GetNew($ConversationID, $LastMessageID) {
      $Session = Gdn::Session();
      $this->SQL->Where('MessageID > ', $LastMessageID);
      return $this->Get($ConversationID, $Session->UserID);
   }
253530
public function getMessageStatus($messageId)
    {
        if ($this->debug || !$messageId) {
            return '';
        }
        $result = $this->getClient()->GetMessageStatus(['MessageId' => $messageId]);

        return $result->GetMessageStatusResult;
    }
463868
protected function get_discussion($discussionid) {
        global $DB;

        if (empty($this->discussionsdata[$discussionid])) {
            $this->discussionsdata[$discussionid] = $DB->get_record('forum_discussions',
                array('id' => $discussionid), '*', MUST_EXIST);
        }
        return $this->discussionsdata[$discussionid];
    }
599587
public function getMessagesById($conversationId, $userId, $offset, $take)
    {
        return Conversation::with(
            [
                'messages' => function ($query) use ($userId, $offset, $take) {
                    $query->where(
                        function ($qr) use ($userId) {
                            $qr->where('user_id', '=', $userId)
                                ->where('deleted_from_sender', 0);
                        }
                    )
                        ->orWhere(
                            function ($q) use ($userId) {
                                $q->where('user_id', '!=', $userId)
                                    ->where('deleted_from_receiver', 0);
                            }
                        );

                    $query->offset($offset)->take($take);

                }
            ]
        )->with(['userone', 'usertwo'])->find($conversationId);

    }
254930
function(conversationId, callback) {
      conversationId = utils.toUUID(conversationId);
      if (!conversationId) return callback(new Error(utils.i18n.conversations.id));
      utils.debug('Conversation get: ' + conversationId);

      request.get({
        path: '/conversations/' + conversationId
      }, callback);
    }
121138
public function clear($chatId, array $chat)
    {
        $params = [
            'chatid' => $chatId,
            'chat'   => $chat,
        ];

        return $this->parseJSON('json', [self::API_CLEAR_NOTIFY, $params]);
    }
529108
public function getLastMessage()
    {
        if (($message = $this->getMessages()->orderBy(['created_at' => SORT_DESC])->limit(1)->one()) != null) {
            return $message;
        }
        return $this;
    }
334954
public function GetID($MessageID) {
      if (Gdn::Cache()->ActiveEnabled())
         return self::Messages($MessageID);
      else
         return parent::GetID($MessageID);
   }
618552
public function getConversationsAllById($conversationId, $offset = 0, $take = 20)
    {
        $conversations = $this->conversation->getMessagesAllById($conversationId, $offset, $take);

        return $this->makeMessageCollection($conversations);
    }
504580
protected function makeMessage($conversationId, $message)
    {
        $message = $this->message->create([
            'message' => $message,
            'conversation_id' => $conversationId,
            'user_id' => $this->authUserId,
            'is_seen' => 0,
        ]);

        $message->conversation->touch();

        $this->broadcast->transmission($message);

        return $message;
    }
849399
public function get(int $id, ConversationRequest $conversationRequest = null): Conversation
    {
        $conversationResource = $this->restClient->getResource(Conversation::class, sprintf('/v2/conversations/%d', $id));

        return $this->hydrateConversationWithSubEntities($conversationResource, $conversationRequest ?: new ConversationRequest());
    }
765255
public static function get_conversation_between_users(array $userids) {
        global $DB;

        $conversations = self::get_individual_conversations_between_users([$userids]);
        $conversation = $conversations[0];

        if ($conversation) {
            return $conversation->id;
        }

        return false;
    }
1245113
public function getConversationsById($conversationId, $offset = 0, $take = 20)
    {
        $conversations = $this->conversation->getMessagesById($conversationId, $this->authUserId, $offset, $take);

        return $this->makeMessageCollection($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));
            }
        });
    }
1067149
public String getConversationId() {
        return (data != null && data.payload != null) ? data.payload.conversationId : null;
    }
1255021
public static function enable_conversation(int $conversationid) {
        global $DB;

        $conversation = new \stdClass();
        $conversation->id = $conversationid;
        $conversation->enabled = self::MESSAGE_CONVERSATION_ENABLED;
        $conversation->timemodified = time();
        $DB->update_record('message_conversations', $conversation);
    }
374865
public function getGroupConversationMessageById($groupConversationId, $channel)
    {
        $conversation = $this->query()->with(['messages', 'messages.sender', 'messages.files', 'users', 'files'])->find($groupConversationId);

        $collection = (object) null;
        $collection->group_conversation = $conversation;
        $collection->channel_name = $channel;
        $collection->users = $conversation->users;
        $collection->messages = $conversation->messages;
        $collection->files = $conversation->files;

        return collect($collection);
    }