I've noticed that avatars don't seem to update when a contact changes their VCard-based avatar, or even when exiting/opening Xabber (I noticed this using contacts connected with Pidgin and a custom chatbot).
I can only get the avatar to update if I manually open the contact and open the 'Contact Info' pane, or if I clear the Xabber app data and re-add my account, causing all my contacts to be re-populated.
Xabber logs show that the VCard is being requested and sent, but for whatever reason it's not updating the UI or not detecting the new VCard. The logging isn't verbose enough to tell me exactly what is happening in Xabber code though.
On startup:
(Avatar does not update to the data contained within the VCard)
2017-07-08_15-14-12 D/Smack﹕ RECV (0): <presence to='jorticus@server.net' from='potatobot@server.net/mem'><priority>1</priority><c hash='sha-1' ver='I22W7CegORwdbnu0ZiQwGpxr0Go=' node='http://pidgin.im/' xmlns='http://jabber.org/protocol/caps'/><x xmlns='vcard-temp:x:update'><photo>4f456ae06efc61d4e4c798775ff5a2099457df95</photo></x></presence>
2017-07-08_15-14-12 D/Smack﹕ SENT (0): <iq to='potatobot@server.net' id='FJTr9-384' type='get'><vCard xmlns='vcard-temp'/></iq>
2017-07-08_15-14-13 D/Smack﹕ RECV (0): <iq id='FJTr9-384' type='result' to='jorticus@server.net/Xabber_KO5ePDhw' from='potatobot@server.net'><vCard prodid='-//HandGen//NONSGML vGen v1.0//EN' version='2.1' xmlns='vcard-temp'><NICKNAME>potatobot</NICKNAME><FN/><URL>--snip--</URL><ADR><WORK/><HOME/></ADR><DESC>Add me to your contacts!</DESC><PHOTO><TYPE>image/png</TYPE><BINVAL>--snip--</BINVAL></PHOTO></vCard></iq>
On avatar changed:
2017-07-08_15-15-16 D/Smack﹕ RECV (0): <presence to='jorticus@server.net' from='potatobot@server.net/mem'><priority>1</priority><c hash='sha-1' ver='I22W7CegORwdbnu0ZiQwGpxr0Go=' node='http://pidgin.im/' xmlns='http://jabber.org/protocol/caps'/><x xmlns='vcard-temp:x:update'><photo>4141ddacd1d9b7da2212ed218e2bbc5060d0e0e9</photo></x></presence>
2017-07-08_15-15-16 W/com.xabber.android.data.extension.avatar.AvatarStorage@ea7ca06: java.io.FileNotFoundException: /data/user/0/com.xabber.android/files/avatars/4141ddacd1d9b7da2212ed218e2bbc5060d0e0e9 (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at com.xabber.android.data.extension.avatar.AvatarStorage.read(Unknown Source)
at com.xabber.android.data.extension.avatar.AvatarManager.loadBitmap(Unknown Source)
at com.xabber.android.data.extension.avatar.AvatarManager.access$100(Unknown Source)
at com.xabber.android.data.extension.avatar.AvatarManager$4.run(Unknown Source)
at com.xabber.android.data.Application$9.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
2017-07-08_15-15-16 E/com.xabber.android.data.extension.avatar.AvatarStorage@ea7ca06﹕ java.io.FileNotFoundException: /data/user/0/com.xabber.android/files/avatars/4141ddacd1d9b7da2212ed218e2bbc5060d0e0e9 (No such file or directory)
--snip additional stack trace--
2017-07-08_15-15-16 D/Smack﹕ SENT (0): <iq to='potatobot@server.net' id='FJTr9-391' type='get'><vCard xmlns='vcard-temp'/></iq>
2017-07-08_15-15-17 D/Smack﹕ RECV (0): <iq id='FJTr9-391' type='result' to='jorticus@server.net/Xabber_KO5ePDhw' from='potatobot@server.net'><vCard version='2.1' prodid='-//HandGen//NONSGML vGen v1.0//EN' xmlns='vcard-temp'><NICKNAME>potatobot</NICKNAME><FN/><URL>--snip--</URL><ADR><WORK/><HOME/></ADR><DESC>Add me to your contacts!</DESC><PHOTO><TYPE>image/png</TYPE><BINVAL>--snip: new base64 encoded image--</BINVAL></PHOTO></vCard></iq>
On opening 'Contact Info' pane:
(VCard is re-fetched even though content hasn't changed, but it actually updates the avatar image this time)
I've noticed that avatars don't seem to update when a contact changes their VCard-based avatar, or even when exiting/opening Xabber (I noticed this using contacts connected with Pidgin and a custom chatbot).
I can only get the avatar to update if I manually open the contact and open the 'Contact Info' pane, or if I clear the Xabber app data and re-add my account, causing all my contacts to be re-populated.
Xabber logs show that the VCard is being requested and sent, but for whatever reason it's not updating the UI or not detecting the new VCard. The logging isn't verbose enough to tell me exactly what is happening in Xabber code though.
On startup: (Avatar does not update to the data contained within the VCard)
On avatar changed:
On opening 'Contact Info' pane: (VCard is re-fetched even though content hasn't changed, but it actually updates the avatar image this time)
(In these logs,
jorticus@server.net
is the Xabber user, andpotatobot@server.net
is my bot account logged into Pidgin)