1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-07 07:56:23 +00:00

Fix updating avatar menu element when new message is coming

This commit is contained in:
Loic Blot 2015-01-06 15:54:33 +00:00
parent 0e92aa3779
commit 0dfa6152ab

View File

@ -88,9 +88,8 @@ var checkNewMessages = function() {
}
if ($.inArray(peerLabel, bufferedContacts) == -1) {
$("div[mailbox-avatar='" + peerLabel + "']").remove();
$("a[mailbox-label='" + peerLabel + "']").remove();
peerListBuf = '<li><div class="ocsms-plavatar"';
$("li[peer-label='" + peerLabel + "']").remove();
peerListBuf = '<li peer-label="' + peerLabel + '"><div class="ocsms-plavatar"';
if (typeof jsondata['photos'][peerLabel] != 'undefined') {
peerListBuf += 'style="background-image: url(' + jsondata['photos'][peerLabel] + ');"';
}
@ -294,7 +293,7 @@ function fetchInitialPeerList(jsondata) {
peerLabel = fn;
}
if ($.inArray(peerLabel, bufferedContacts) == -1) {
peerListBuf += '<li><div class="ocsms-plavatar"';
peerListBuf += '<li peer-label="' + peerLabel + '"><div class="ocsms-plavatar"';
if (typeof jsondata['photos'][peerLabel] != 'undefined') {
peerListBuf += 'style="background-image: url(' + jsondata['photos'][peerLabel] + ');"';
}