PrivateMessage sending . . .

@JohnTube Whenever I send a private message to any user it also sends a copy of it because of its implementation in IChatClientListener interface. How can I avoid sending message to myself?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited August 2018
    Hi @avimon,

    This is by design, in Photon Chat all messages are broadcasted and received by sender even private ones.

    Sorry for the delay.
  • This is very useful as it lets you know the message was received. Also, in your list of chat messages you want the user to see their own messages as well as everyone else's. So don't manually add the message to your message list add it when it is received via OnGetMessages etc. This keeps messages in order as they are received by the server.

    I use the Private Message service as a means to send Friend request and game invites. This lets both users know the message was received and I can edit GUI items to show this during the OnPrivateMessages callback. I add a check to see if sender == user to let my code know who actually sent the message. And I send a custom message class as the "object message" that has all the details of the request: sender, receiver, message, requestType, isSystemMessage, etc.