1

I am writing a client in c# and there is a problem. When I create a direct message on account A to communicate with account B, then account B does not receive any messages at all from the websocket itself. As I understand it, I need to subscribe to a certain event. If I restart the client, the new direct will be displayed at client B.

The code for creating direct messages and subscribing to message updates:

    internal class RoomSubscribeRequest : BaseRequest
    {
        public List<object> @params;
        public string name;

        public RoomSubscribeRequest(string roomID, string token)
        {
            msg = "sub";
            name = "stream-room-messages";
            @params = new List<object>
            {
                roomID, new { useCollection = false}, new { args = new List<RoomSubscribeArgs>(){ new RoomSubscribeArgs(token)} }
            };
        }
    }
    internal class CreateDirectMessageRequest : BaseRequest
    {
        public string[] @params;

        public CreateDirectMessageRequest(string username)
        {
            msg = "method";
            method = "createDirectMessage";
            @params = new string[1] { username };
        }
    }
Nik
  • 19
  • 3

0 Answers0