42 $sendDelayInSeconds = (int)Option::get(static::MODULE_ID, self::SEND_DELAY_OPTION_NAME, self::DEFAULT_SEND_DELAY);
43 $sendDelayInSeconds = abs($sendDelayInSeconds);
44 $readDeadline = (
new DateTime())->add(
"-{$sendDelayInSeconds} seconds");
45 $query = MessageUnreadTable::query()
46 ->setSelect([
'MESSAGE_ID'])
47 ->where(
'MESSAGE_ID',
'>', $lastSend)
48 ->where(
'CHAT_TYPE', $type)
49 ->where(
'DATE_CREATE',
'<', $readDeadline)
54 $query->setLimit($limit);