Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
Xtudio #1
Member since Jun 2011 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: How to retreive Someone's Avatar/Photo as Image
First, I searched this complete forum and I did not find a given solution to this problem.
This is what I have so far:

void xmppConnection_OnReadXml(object sender, string xml)
    {
        if (xml.Contains(XmlTags.PhotoOpen))
        {
            int startIndex = xml.IndexOf(XmlTags.PhotoOpen) + XmlTags.PhotoOpen.Length;
            int length = xml.IndexOf(XmlTags.PhotoClose) - startIndex;
            string photoHash = xml.Substring(startIndex, length);
        }
    }

Now how do I convert this hash into an Image, or am i doing it completely wrong?
Avatar
Alex #2
Member since Feb 2003 · 4327 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
yes you are completely wrong. The OnReadXml event is only to see the Xml which is sent and received over the wire, for nothing else.
The photo hash in the presence is only used to indicate if the photo/avatar you have cashed is still the current avatar. If the hashes don't match then you have cached an old image and should fetch it again.

Alex
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:
Forum: agsXMPP RSS