So I’m thinking of adding a “last-updated” property to a contact to track when it was last updated/refreshed by the protocol and am wondering if it’s useful to others.
I’ve ran into an issue with twitch where I don’t get notification for avatar changes. So to check for an avatar change I need to hit a rest endpoint to get the user data and compare against what I have to detect the change. To avoid constantly spamming, I need to keep track of the last time I did this. I was thinking I could use a tag on the contact to do it, but then I realized other protocols might need this too.
The problem with that is that is much harder to remove api than it is to add it which is precisely why I’m looking for the opinions of other protocol authors.
WhatsApp uses an arbitrary id string for describing the profile picture (avatar) version. If the string changes, the client is inclined to request the current profile picture. WhatsApp employs a standard HTTP CDN for delivering the profile pictures. The default procedure is to request a profile picture with the If-Modified-Since header set to the local profile picture date. I think the latter is purely optional. I have never hit any form of rate-limiting.
I do have not looked into how Signal handles profile picture updates.
Is there still the ‘checksum’ property on the avatar? I’ve been using that for the last-modified/ETag and/or storing the URL to the image but sometimes need both
If it’s just the avatar then it could be handy to prevent re-downloads of URLs that we already have the avatar for. If the last-updated is on the contact, that could be handy for not updating names and contact details, and having the display name fighting with the backend
So I’m looking at creating a purple wide cache, but right now for twitch I’m just using the cache built in to libsoup which might take care of that for you?
And yeah, the last-updated idea was like yeah this is the time i last synced the user with the server, including names, avatars, etc.
Yes the cache is persistent. However shared .purple isn’t a thing anymore, user interfaces have their own config directory.
For twitch, my soup cache goes into purple_cache_dir which is the XDG_CACHE_DIR on linux, which is in my dev environment for builds, and looks like the following.
grim@spectre:~/p/pidgin-clean/build-3rd/cache/pidgin3/purple-spasm$ du -sh
52M .
As for portable builds, yeah should be fine if it’s the same user interface and therefore, same cache directory.