<commit_before><?php

namespace PragmaRX\Sdk\Services\FacebookMessenger\Listeners;

use PragmaRX\Sdk\Services\Chat\Events\EventPublisher;
use PragmaRX\Sdk\Services\Chat\Events\ChatMessageWasSent;
use PragmaRX\Sdk\Services\Chat\Events\ChatMessageWasDelivered;
use PragmaRX\Sdk\Services\FacebookMessenger\Data\Repositories\FacebookMessenger;
use PragmaRX\Sdk\Services\FacebookMessenger\Events\FacebookMessengerAudioWasCreated;

class SendFacebookMessengerMessage
{
    /**
     * @var EventPublisher
     */
    private $eventPublisher;
    /**
     * @var FacebookMessenger
     */
    private $facebookMessengerRepository;

    public function __construct(EventPublisher $eventPublisher, FacebookMessenger $facebookMessengerRepository)
    {
        $this->eventPublisher = $eventPublisher;
        $this->facebookMessengerRepository = $facebookMessengerRepository;
    }

    /**
     * Handle the event.
     *
     * @param FacebookMessengerAudioWasCreated $event
     */
    public function handle(ChatMessageWasSent $event)
    {
        $message = $event->data['message_model'];

        if ($message->chat->facebook_messenger_chat_id)
        {
            if ($this->facebookMessengerRepository->sendMessage($event->data['message_model']))
            {
                event(new ChatMessageWasDelivered($message));
            }
        }

        $this->eventPublisher->publish('ChatListWasUpdated');
    }
}<commit_msg>Remove message delivery for Facebook<commit_after><?php

namespace PragmaRX\Sdk\Services\FacebookMessenger\Listeners;

use PragmaRX\Sdk\Services\Chat\Events\EventPublisher;
use PragmaRX\Sdk\Services\Chat\Events\ChatMessageWasSent;
use PragmaRX\Sdk\Services\Chat\Events\ChatMessageWasDelivered;
use PragmaRX\Sdk\Services\FacebookMessenger\Data\Repositories\FacebookMessenger;
use PragmaRX\Sdk\Services\FacebookMessenger\Events\FacebookMessengerAudioWasCreated;

class SendFacebookMessengerMessage
{
    /**
     * @var EventPublisher
     */
    private $eventPublisher;
    /**
     * @var FacebookMessenger
     */
    private $facebookMessengerRepository;

    public function __construct(EventPublisher $eventPublisher, FacebookMessenger $facebookMessengerRepository)
    {
        $this->eventPublisher = $eventPublisher;
        $this->facebookMessengerRepository = $facebookMessengerRepository;
    }

    /**
     * Handle the event.
     *
     * @param FacebookMessengerAudioWasCreated $event
     */
    public function handle(ChatMessageWasSent $event)
    {
        $message = $event->data['message_model'];

        if ($message->chat->facebook_messenger_chat_id)
        {
            $this->facebookMessengerRepository->sendMessage($event->data['message_model'])
        }

        $this->eventPublisher->publish('ChatListWasUpdated');
    }
}
{'fraction_non_alphanumeric': 0.10329985652797705, 'fraction_numerical': 0.0, 'mean_word_length': 3.632890365448505, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 19, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1892554', 'n_tokens_mistral': 847, 'n_tokens_neox': 763, 'n_words': 105}