Protocol Zero / 0.9 (DRAFT)
MessageModel {
string ID { get; }
PersonModel Origin { get; }
DateTime TimeStamp { get; }
List<MessagePartModel> Parts { get; }
}
// for nicknames, then the view doesn't have to parse the messages anymore
PersonMessagePartModel {
}
ImageMessagePartModel {
}
UrlMessagePartModel {
}
TextMessagePartModel {
}
IChatRPC {
void Add(ChatModel);
void Update(ChatModel, ChatInfoModel);
void Remove(ChatModel);
}
ChatInfoModel {
string Title { get; set; }
EChatState State { get; set; }
}
enum EChatState {
Inactive, // the contact closed your window
Composing, // is typing right now
Active, // in the contact's chat client, your chat window is the active tab and the window is on top
Gone, // the contact has not been active in your chat window for some time
Paused // the contact was typing, but isn't anymore
}
IMessageRPC {
void Add(MessageModel, ChatModel);
}
IContactRPC {
// ChatModel and not GroupChatModel, as a contactlist is no groupchat
void Add(PersonModel, ChatModel);
void Remove(PersonModel, ChatModel);
// if id of PersonModel already exists, update it with new personmodel, if not -> ?
void Update(PersonModel, ChatModel);
}
PersonModel
{
string ID { get; }
string NickName { get; set; }
EPresence Presence { get; set; }
string StatusMessage { get; set; }
// this would be always none for irc, but xmpp, jabbr and twitter can make use of it
ESubscription Subscription { get; set; }
}
enum EPresence
{
Offline,
Available,
Away,
DoNotDisturb,
FreeForChat,
ExtendedAway
}
enum ESubscription
{
None,
Both,
To,
From,
ToAndRequesting,
FromAndRequesting
}
IPresenceRPC {
UpdateStatus(string message);
Update(EPresence);
Update(EPresence, string message);
}
IFileTransferRPC {
}