Пример #1
0
        private void XmppOnOnRegistered(object sender)
        {
			Vcard v = new Vcard();
			Email e = new Email
			{
				UserId = _email,
				Type = EmailType.INTERNET,
				Value = _email
			};
			v.AddChild(e);
			v.JabberId = new Jid(this.Username + "@" + Host);
			VcardIq vc = new VcardIq(IqType.set, v);
			vc.To = Host;
			vc.GenerateId();
			Xmpp.Send(vc);
            if(OnRegisterComplete != null)
                OnRegisterComplete.Invoke(this,RegisterResults.Success);
        }
Пример #2
0
        /// <summary>
        /// Adds a new Email Adress object
        /// </summary>
        /// <param name="mail"></param>
        public void AddEmailAddress(Email mail)
        {
            Email e = GetEmailAddress(mail.Type);
            if (e != null)
                e.Remove();

            this.AddChild(mail);
        }
Пример #3
0
 /// <summary>
 /// Get all Email addresses
 /// </summary>
 /// <returns></returns>
 public Email[] GetEmailAddresses()
 {
     ElementList el = SelectElements(typeof(Email));
     int i = 0;
     Email[] result = new Email[el.Count];
     foreach (Email mail in el)
     {
         result[i] = mail;
         i++;
     }
     return result;
 }
Пример #4
0
        /// <summary>
        /// The xmpp on on registered.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        private void XmppOnOnRegistered(object sender)
        {
            this.myPresence.Type = PresenceType.available;
            this.myPresence.Show = ShowType.chat;
            this.MucManager = new MucManager(this.xmpp);
            var room = new Jid("lobby@conference." + this.Config.ChatHost);
            this.MucManager.AcceptDefaultConfiguration(room);

            // MucManager.JoinRoom(room,Username,Password,false);
            this.Me = new User(this.xmpp.MyJID);
            this.Me.SetStatus(UserStatus.Online);
            this.xmpp.PresenceManager.Subscribe(this.xmpp.MyJID);

            var v = new Vcard();
            var e = new Email { UserId = this.email, Type = EmailType.INTERNET, Value = this.email };
            v.AddChild(e);
            v.JabberId = new Jid(this.Username + "@" + this.Config.ChatHost);
            var vc = new VcardIq(IqType.set, v);
            vc.To = this.Config.ChatHost;
            vc.GenerateId();
            this.xmpp.Send(vc);
            if (this.OnRegisterComplete != null)
            {
                this.OnRegisterComplete.Invoke(this, RegisterResults.Success);
            }
        }