-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathIMessageServer.cs
30 lines (27 loc) · 1021 Bytes
/
IMessageServer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using DevExpress.DevAV.Chat.Commands;
using DevExpress.DevAV.Chat.Events;
using DevExpress.DevAV.Chat.Model;
namespace DevExpress.DevAV.Chat {
public interface IMessageServer {
Task<IChannel> Connect(string userName);
}
public interface IChannel : IDisposable {
// Common
void Subscribe(Action<ChannelEvent> onEvent);
string UserName { get; }
void Send(ChannelCommand command);
// Contacts
void Subscribe(Action<Dictionary<long, ContactEvent>> onEvents);
Task<UserInfo> GetUserInfo(string userName);
Task<UserInfo> GetUserInfo(long id);
Task<IReadOnlyCollection<Contact>> GetContacts();
void Send(ContactCommand command);
// Messages
void Subscribe(Action<Dictionary<long, MessageEvent>> onEvents);
Task<IReadOnlyCollection<Message>> GetHistory(Contact contact);
void Send(MessageCommand command);
}
}