/// <summary> /// Performs the gateway registration process /// </summary> /// <param name = "username"></param> /// <param name = "password"></param> public void Register(string username, string password) { var query = new RegisterQuery(); var iq = new IQ(); iq.ID = XmppIdentifierGenerator.Generate(); iq.Type = IQType.Set; iq.From = Session.UserId; iq.To = Identifier; iq.Items.Add(query); query.UserName = username; query.Password = password; PendingMessages.Add(iq.ID); Session.Send(iq); }
/// <summary> /// Performs the gateway unregistration process /// </summary> public void Unregister() { var query = new RegisterQuery(); var iq = new IQ(); iq.ID = XmppIdentifierGenerator.Generate(); iq.Type = IQType.Set; iq.From = Session.UserId; iq.To = Identifier; iq.Items.Add(query); query.Remove = ""; PendingMessages.Add(iq.ID); Session.Send(iq); }