Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send Private message to receiver AND sender ONLY #335

Open
Axel-KIRK opened this issue Sep 13, 2018 · 1 comment
Open

Send Private message to receiver AND sender ONLY #335

Axel-KIRK opened this issue Sep 13, 2018 · 1 comment
Labels

Comments

@Axel-KIRK
Copy link

Axel-KIRK commented Sep 13, 2018

Hi we we to display the message to both of the sender and the receiver of the private message.
This code work to show only to the receiver :
`if ($topic->getId() === 'chat/private') {

            $receiver = $this->clientManipulator->findByUsername($topic, $event['receiver']);
            

            $topic->broadcast(
                [
                'sender' => $user->getUsername(),
                'message' => 'message privé: '. $event['message'],
                ],
                array(),
                array($receiver['connection']->WAMP->sessionId, )
                );`

But this code never work, we try to allow the sender of ther private message to see his own message :
` if ($topic->getId() === 'chat/private') {

            $receiver = $this->clientManipulator->findByUsername($topic, $event['receiver']);
            $senderMp = $this->clientManipulator->findByUsername($topic, $event[$user->getUsername()]);
        
        

            $topic->broadcast(
                [
                'sender' => $user->getUsername(),
                'message' => 'message privé: '. $event['message'],
                ],
                array(),
                array($receiver['connection']->WAMP->sessionId, $senderMp['connection']->WAMP->sessionId)
                );`

We also try to add 'somewhere', we don't know really where the $connection->event($topic->getId(), ['msg' => 'lol']); but never works too...

Have some idea about ?

@thehatami
Copy link

any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants