Avatar performance enhancements

Issue #124 closed
Markus KARG created an issue

Avatar handling is great in Babbler, but it write to disk / pulls from server more often than essentially needed. Hence I'd like to propose two small improvements. I can implement both of them, but I need to be sure that you like to have it. :-)

(1) Store JID's HASH on disk, so userHashes can be preloaded before talking to the server.

This essentially prevents server roundtrips just to learn that we already have the avatar on disk... The solution is as simple as naming the files not only like the SHA1, but to add the bare JID.

(2) Do not overwrite .avatar files as long as SHA1 does not change.

It makes no sense to overwrite an .avatar file as long as the SHA1 is the same. This can simply get prevented by a short check whether a file with that name already exists.

Comments (3)

  1. Log in to comment