Exemplo n.º 1
0
        public GroupsManager(MessagesManager messagesManager, ConnectionManager connectionManager, GroupChatsService groupChatsService)
        {
            this.messagesManager = messagesManager;
            this.connectionManager = connectionManager;
            this.groupChatsService = groupChatsService;

            groupChatsService.GroupChanged += OnGroupChanged;
        }
Exemplo n.º 2
0
	    private static async void StartChatting()
	    {
            connectionManager = new ConnectionManager(new WebSocketConnection(),
                new AdhocCredentialsProvider { AccessToken = "fake", DeviceId = myDeviceId, UserId = myUserId, PublicKey = new byte[] { 1, 2, 3 } });

            messagingService = new MessagingService(connectionManager);
            groupChatsService = new GroupChatsService(connectionManager);


	        connectionManager.Authenticated += OnAuthenticated;
            groupChatsService.GroupChanged += GroupChatsServiceOnGroupChanged;
            messagingService.IncomingMessage += MessagingServiceOnIncomingMessage;
            messagingService.IsTypingNotification += MessagingServiceOnIsTypingNotification;
            messagingService.DeliveryNotification += MessagingServiceOnDeliveryNotification;
            messagingService.SeenNotification += MessagingServiceOnSeenNotification;

	        await connectionManager.TryKeepConnectionAsync();
	    }