Beispiel #1
0
        private void SetMyVcard()
        {
            var viq = new VcardIq {
                Type = Matrix.Xmpp.IqType.Set
            };

            if (!string.IsNullOrEmpty(txtName.Text))
            {
                viq.Vcard.Fullname = txtName.Text;
            }

            if (!string.IsNullOrEmpty(txtNickname.Text))
            {
                viq.Vcard.Nickname = txtNickname.Text;
            }

            if (!string.IsNullOrEmpty(txtEmail.Text))
            {
                viq.Vcard.AddEmail(new Email {
                    IsInternet = true, Address = txtEmail.Text
                });
            }

            xmppClient.IqFilter.SendIq(viq, VcardUpdateResponse);
        }
Beispiel #2
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);
            }
        }
Beispiel #3
0
        private void GetMyVcard()
        {
            var viq = new VcardIq {
                Type = Matrix.Xmpp.IqType.Get
            };

            xmppClient.IqFilter.SendIq(viq, VcardResponse);
        }
Beispiel #4
0
 public frmVcard(Jid jid, XmppClientConnection con)
 {
     this.InitializeComponent();
     this._connection = con;
     this.Text = "名片 : " + jid.get_Bare();
     VcardIq iq = new VcardIq(0, new Jid(jid.get_Bare()));
     this.packetId = iq.get_Id();
     con.get_IqGrabber().SendIq(iq, new IqCB(this, (IntPtr) this.VcardResult), null);
 }
Beispiel #5
0
 //Get Vcard of user
 static private void vcardAll()
 {
     foreach (var uRoster in _userRoster)
     {
         VcardIq viq = new VcardIq(IqType.get, new Jid(uRoster.Jid));
         uRoster.UVcard = viq.Vcard;
         //xmpp.IqGrabber.SendIq(viq, new IqCB(VcardResult), null);
     }
 }
Beispiel #6
0
        private void GetMyVcard(ListViewItem group)
        {
            Group = group;
            var viq = new VcardIq {
                Type = Matrix.Xmpp.IqType.Get
            };

            xmppClient.IqFilter.SendIq(viq, VcardResponse);
        }
Beispiel #7
0
		public frmVcard(Jid jid, XmppClientConnection con)
		{

			InitializeComponent();

			_connection = con;

			this.Text = "Vcard from: " + jid.Bare;

			VcardIq viq = new VcardIq(IqType.get, new Jid(jid.Bare));
			packetId = viq.Id;
			con.IqGrabber.SendIq(viq, new IqCB(VcardResult), null);
		}
Beispiel #8
0
        private void _connection_OnLogin(object sender)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new ObjectHandler(_connection_OnLogin), new[] { sender });
                return;
            }
            VcardIq myIq = new VcardIq(IqType.get, null, _connection.MyJID);

            _packetId = myIq.Id;
            _connection.IqGrabber.SendIq(myIq, OnVcardResult, null);
            _discoManager.DiscoverItems(new Jid(_connection.Server), OnDiscoServerResult, null);
        }
Beispiel #9
0
 /// <summary>
 /// Retrieves vCard with another users profile information
 /// </summary>
 /// <param name="to">jid of user</param>
 /// <param name="callback">delegate or callback function for result</param>
 public void GetVCard(string to, EventHandler <IqEventArgs> callback)
 {
     try
     {
         var vIq = new VcardIq {
             To = to, Type = IqType.Get
         };
         xmppClient.IqFilter.SendIq(vIq, callback);
     }
     catch (Exception ex)
     {
         Log.Error(ex.ToString());
     }
 }
Beispiel #10
0
 /// <summary>
 /// Stores vCard with current users profile information ie avatar, nickname, first/last
 /// </summary>
 /// <param name="vCard"></param>
 public void SetMyVCard(Matrix.Xmpp.Vcard.Vcard vCard)
 {
     try
     {
         var vIq = new VcardIq {
             Type = Matrix.Xmpp.IqType.Set
         };
         vIq.Vcard = vCard;
         xmppClient.IqFilter.SendIq(vIq, null);
     }
     catch (Exception ex)
     {
         Log.Error(ex.ToString());
     }
 }
Beispiel #11
0
        private void SetMyVcard()
        {
            var viq = new VcardIq { Type = Matrix.Xmpp.IqType.set };

            if (!string.IsNullOrEmpty(txtName.Text))
                viq.Vcard.Fullname = txtName.Text;

            if (!string.IsNullOrEmpty(txtNickname.Text))
            viq.Vcard.Nickname = txtNickname.Text;

            if (!string.IsNullOrEmpty(txtEmail.Text))
                viq.Vcard.AddEmail(new Email {IsInternet = true, Address = txtEmail.Text});

            xmppClient.IqFilter.SendIq(viq, VcardUpdateResponse);
        }
Beispiel #12
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);
            }
        }
Beispiel #13
0
 private void GetVcard(Jid jid)
 {
     var viq = new VcardIq {To = jid, Type = Matrix.Xmpp.IqType.get};
     xmppClient.IqFilter.SendIq(viq, VcardResponse);
 }
Beispiel #14
0
 private void GetMyVcard(ListViewItem group)
 {
     Group = group;
     var viq = new VcardIq { Type = Matrix.Xmpp.IqType.Get };
     xmppClient.IqFilter.SendIq(viq, VcardResponse);
 }
Beispiel #15
0
 private void GetMyVcard()
 {
     var viq = new VcardIq {Type = Matrix.Xmpp.IqType.Get };
     xmppClient.IqFilter.SendIq(viq, VcardResponse);
 }
Beispiel #16
0
        public void GetVCard(Jid jid)
        {
            VcardIq viq = new VcardIq(IqType.get, jid);

            connection.Send(viq);
        }
Beispiel #17
0
        //get MY Vcard
        static public void GetMyVcard()
        {
            VcardIq viq = new VcardIq(IqType.get);

            xmpp.IqGrabber.SendIq(viq, new IqCB(VcardResult), null);
        }