Fixes the sizes of the avatars.

This commit is contained in:
fo 2014-12-03 11:09:12 +02:00
parent 8bb5994715
commit 27eecff826
1 changed files with 6 additions and 5 deletions

View File

@ -14,7 +14,8 @@ var Avatar = (function(my) {
}
users[jid] = id;
}
var url = getGravatarUrl(users[jid] || jid);
var thumbUrl = getGravatarUrl(users[jid] || jid, 100);
var contactListUrl = getGravatarUrl(users[jid] || jid);
var resourceJid = Strophe.getResourceFromJid(jid);
var thumbnail = $('#participant_' + resourceJid);
var avatar = $('#avatar_' + resourceJid);
@ -22,25 +23,25 @@ var Avatar = (function(my) {
// set the avatar in the settings menu if it is local user and get the
// local video container
if(jid === connection.emuc.myroomjid) {
$('#avatar').get(0).src = url;
$('#avatar').get(0).src = thumbUrl;
thumbnail = $('#localVideoContainer');
}
// set the avatar in the contact list
var contact = $('#' + resourceJid + '>img');
if(contact && contact.length > 0) {
contact.get(0).src = url;
contact.get(0).src = contactListUrl;
}
// set the avatar in the thumbnail
if(avatar && avatar.length > 0) {
avatar[0].src = url;
avatar[0].src = thumbUrl;
} else {
if (thumbnail && thumbnail.length > 0) {
avatar = document.createElement('img');
avatar.id = 'avatar_' + resourceJid;
avatar.className = 'userAvatar';
avatar.src = url;
avatar.src = thumbUrl;
thumbnail.append(avatar);
}
}