Entities vs. Services in domain driven design (DDD)


I wanted to get some feedback on the design of a chat application I recently developed. The application is written in PHP, but the language probably isn’t important here.

The main components are User, Conversation, and Message:

class User {
    public function getId(): int {}
    public function getUsername(): string {}
    public function getFirstName(): string {}
    public function getLastName(): string {}

    // token used with a 3rd party API for sending messages
    public function getToken(): ?string;
    
    // if a user doesn't have a token they can't be messaged
    public function isOnline(): bool {}

    public function __construct(int $id, string $username, ...) {}
}

class Conversation {
    public function getId(): int {}
    public function getUsers(): User() {}

    public function __construct(int $id, array $users) {}
}

class Message {
    public function getId(): int {}
    public function getText(): string {}
    public function getConversation(): Conversation {}
    public function getAuthor(): User {}

    public function __construct(int $id, string $text, Conversation $conversation) {}
}

I also have some services:

class MessageSender implements MessageSenderInterface
{
    private LoggerInterface $logger;

    public function send(Message $message): void {
        foreach ($message->getConversation()->getUsers() as $user) {
            if (!$user->isOnline()) {
                $this->logger->warn('User is offline and cannot be messaged');
            }

            if ($user->equals($message->getAuthor())) {
                // continue; don't send messages to authors
            }
            
            $messageData = (
                'to' => $user->getToken(),
                'from' => $message->getAuthor()->getUsername(),
                'text' => $message->getText(),
            );
            // send the message through some external API
        }
    }
}

Most of the work is done through the MessageSender, but I’m wondering if the domain might be better encapsulated with something like this:

class Message {
    public function getId(): int {}
    public function getText(): string {}

    public function __construct(int $id, string $text, Conversation $conversation) {}

    public function send(MessageSenderInterface $sender, LoggerInterface $logger) {
        ... send logic in here
    }
}

You can see that by moving the send functionality inside of the Message object we totally get rid of two exposed properties (getConversation and getAuthor are gone) and could effectively remove the service altogether. But as a result, the message object now knows about loggers and message senders, even if they are just interfaces.

What does DDD say about this? I tend to prefer exposing less data and like the encapsulation the second option provides.