Not logged in. · Lost password · Register
Forum: XMPP Protocol RSS
Page: previous  1  2 
Avatar
Aatif Ali #16
Member since Feb 2007 · 19 posts · Location: Islamabd
Group memberships: Members
Show profile · Link to this post
In reply to post ID 1912
Subject: Hash for avators
<presence> <x xmlns='vcard-temp:x:update'><photo> hash value of image </photo></x></presence>

this xml worked at my end, thanks alex for your cooperation throught my problem.
Avatar
Alex #17
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hey cool,

Would be cool if you can post your final code. This would be helpful for many other developers as well.
Or a small HOWTO.

Thanks Alex
Avatar
Aatif Ali #18
Member since Feb 2007 · 19 posts · Location: Islamabd
Group memberships: Members
Show profile · Link to this post
Subject: Code For Avators
Hi
Sure here is Code  For  Setting avators

    OpenFileDialog of = new OpenFileDialog();

                if(of.ShowDialog() == DialogResult.OK)
                {
                string     StrPath = of.FileName;
                                        this.senderpic.Image=Image.FromFile(of.FileName);
                    Image img = Image.FromFile(of.FileName);
                    MessageBox.Show(of.FileName);
                    string hashofimage = "";
                   
//*******************
                   
                       
    hashofimage = IranianExperts.DTHasher.GetSHA1Hash(of.FileName).ToUpper();
                    MessageBox.Show (hashofimage);
                   
    //        txtSHA1HashData.Text = IranianExperts.DTHasher.GetSHA1Hash(MyOpenFileDialog.FileName).ToLower();
                   
                    //******************

            VcardIq viq = new VcardIq(IqType.set, new Jid(_connection.Server));
            viq.Id="vc1";
            viq.To=_connection.MyJID;
                           
            viq.Vcard.Photo=new Photo(senderpic.Image ,ImageFormat.Jpeg);//ImageFormat.Jpeg
       

            _connection.Send(viq);

        string temp = "<presence> <x xmlns='vcard-temp:x:update'><photo> " + hashofimage +"</photo></x></presence>";
        string aglay = m_Jid.ToString() ;
                    _connection.Send(temp);




//////////////////////////
Tak Care
Avatar
Jabberer #19
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
  • why do you pass the presence as a string. I would use all the agsXMPP objects to create the xml.
  • All the hashing stuff you need should be in the agsXMPP.util namespace. There is no need to use other libs.
Software Developer
AG-Software
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page: previous  1  2