void OnClose(object sender)
{
Trace.Call(sender);
foreach (var chat in Chats) {
// don't disable the protocol chat, else the user loses all
// control for the protocol manager! e.g. after a manual
// reconnect or server-side disconnect
if (chat.ChatType == ChatType.Protocol) {
continue;
}
Session.DisableChat(chat);
}
OnDisconnected(EventArgs.Empty);
// reset socket
JabberClient.ClientSocket.OnValidateCertificate -= ValidateCertificate;
JabberClient.SocketConnectionType = SocketConnectionType.Direct;
if (AutoReconnect) {
Reconnect(AutoReconnectDelay);
}
}