예제 #1
0
        /// <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);
        }
예제 #2
0
        /// <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);
        }