예제 #1
0
파일: Client.cs 프로젝트: Himorask/OCTGN
        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
파일: Vcard(2).cs 프로젝트: phiree/dzdocs
        /// <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
파일: Vcard(2).cs 프로젝트: phiree/dzdocs
 /// <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
파일: Client.cs 프로젝트: haslo/OCTGN
        /// <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);
            }
        }