[JDEV] Avatar images are per-resource

Julian Missig julian at jabber.org
Wed Sep 5 14:37:55 CDT 2001

But then the question arises... what happens when a user signs on with 
resource testing1378392432, the client automatically puts up the image 
which was already put up for resource MyCoolJabberClient, and then the 
user changes the resource back to MyCoolJabberClient and never logs in 
with testing1378392432 ever again. I know that there are quite a few 
people making use of resources to show their locations - even when 
they're temporary. If the avatar is *not* per-resource, all we'll have 
to do is write it up in the spec that clients *must* check for an 
existing avatar before uploading a new one... and show that avatar to 
the user. If it *is* per-resource, we're going to waste a lot of server 
space. - Unless we up the complexity one notch and have some sort of 
expiration of avatars, I guess. But my vote is for the simpler method.

We have to do something about clients overwriting existing vCards as 
well, so we might as well start saying that clients must checking for 
existing data on the server before spewing whatever they want. (This 
will be written up with the new vCard-XML for Jabber spec)


Jens Alfke wrote:

> One more note on the avatar spec. I realized while in the shower this 
> morning that it's important that the image be stored in the public XML 
> associated with the resource, not in the XML for the user itself. 
> Otherwise multiple logins trying to set different images will stomp over 
> the image stored on the server.
> I was unsure at the time (this was about while I was lathering my 
> armpits) whether the public-XML thingy supported per-resource storage, 
> but on looking at the very vague description 
> <http://docs.jabber.org/draft-proto/html/xml.html> it appears that it 
> does. The trick is to include your resource when sending the IQ 'set' to 
> yourself.
> So to use an example, the provider of the image would store it on the 
> server as follows:
> <iq id="1" type="set" to="me at myserver/myresource">
>     <query xmlns="jabber-storage:iq:avatar>
>         <data mimetype="image/jpeg"> ...Base64 image data goes here.. 
> </data>
>     </query>
> </iq>
> The important thing to note is that the "to" address contains the 
> sender's resource. The requester would also need to include the resource 
> (as is already shown in the current avatar proposal.)
> An additional thing I've done in the example is include a "mimetype" 
> attribute on the <data> element. I know I said earlier that the common 
> graphics formats are self-describing, but I think it's still safer to 
> tag the data. Not all OS's may have support for auto-detecting the image 
> type, and future image types may be harder to detect, and also this way 
> we could in the future include multiple <data> elements with different 
> MIME types and let the receiver easily pick out the best one.
> --Jens
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev

email: julian at jabber.org
jabber:julian at jabber.org

More information about the JDev mailing list