public XmppProtocolManager(Session session)
: base(session)
{
Trace.Call(session);
Contacts = new Dictionary<Jid, XmppPersonModel>();
DiscoCache = new Dictionary<string, DiscoInfo>();
ShowChatStates = true;
OpenNewChatOnChatState = true;
JabberClient = new XmppClientConnection();
JabberClient.AutoRoster = true;
JabberClient.AutoPresence = true;
JabberClient.OnMessage += OnMessage;
JabberClient.OnClose += OnClose;
JabberClient.OnLogin += OnLogin;
JabberClient.OnError += OnError;
JabberClient.OnStreamError += OnStreamError;
JabberClient.OnPresence += OnPresence;
JabberClient.OnRosterItem += OnRosterItem;
JabberClient.OnReadXml += OnReadXml;
JabberClient.OnWriteXml += OnWriteXml;
JabberClient.OnAuthError += OnAuthError;
JabberClient.SendingServiceUnavailable += OnSendingServiceUnavailable;
JabberClient.AutoAgents = false; // outdated feature
JabberClient.EnableCapabilities = true;
JabberClient.Capabilities.Node = "https://smuxi.im";
JabberClient.ClientVersion = Engine.VersionString;
// identify smuxi
var ident = JabberClient.DiscoInfo.AddIdentity();
ident.Category = "client";
ident.Type = "pc";
ident.Name = Engine.VersionString;
// add features here (this is just for notification of other clients)
JabberClient.DiscoInfo.AddFeature().Var = "http://jabber.org/protocol/caps";
JabberClient.DiscoInfo.AddFeature().Var = "jabber:iq:last";
JabberClient.DiscoInfo.AddFeature().Var = "http://jabber.org/protocol/muc";
JabberClient.DiscoInfo.AddFeature().Var = "http://jabber.org/protocol/disco#info";
JabberClient.DiscoInfo.AddFeature().Var = "http://jabber.org/protocol/xhtml-im";
Disco = new DiscoManager(JabberClient);
Disco.AutoAnswerDiscoInfoRequests = true;
MucManager = new MucManager(JabberClient);
}