|
|
@ -208,12 +208,21 @@ define([
|
|
|
|
var name = data.name || Messages.anonymous;
|
|
|
|
var name = data.name || Messages.anonymous;
|
|
|
|
var $span = $('<span>', {'title': name, 'class': 'avatar'});
|
|
|
|
var $span = $('<span>', {'title': name, 'class': 'avatar'});
|
|
|
|
var $rightCol = $('<span>', {'class': 'right-col'});
|
|
|
|
var $rightCol = $('<span>', {'class': 'right-col'});
|
|
|
|
$('<span>', {'class': 'name'}).text(name).appendTo($rightCol);
|
|
|
|
var $nameSpan = $('<span>', {'class': 'name'}).text(name).appendTo($rightCol);
|
|
|
|
var proxy = Cryptpad.getProxy();
|
|
|
|
var proxy = Cryptpad.getProxy();
|
|
|
|
if (Cryptpad.isLoggedIn() && data.edPublic && data.edPublic !== proxy.edPublic) {
|
|
|
|
var isMe = data.edPublic === proxy.edPublic;
|
|
|
|
if (!proxy.friends || !proxy.friends[data.edPublic]) {
|
|
|
|
if (Cryptpad.isLoggedIn() && data.edPublic) {
|
|
|
|
var $button = $('<button>', {'class': 'friend'}).appendTo($rightCol);
|
|
|
|
if (isMe) {
|
|
|
|
$button.text('Add friend').click(function (e) {
|
|
|
|
$nameSpan.attr('title', Messages._getKey('userlist_thisIsYou', [
|
|
|
|
|
|
|
|
name
|
|
|
|
|
|
|
|
])).text(name);
|
|
|
|
|
|
|
|
} else if (!proxy.friends || !proxy.friends[data.edPublic]) {
|
|
|
|
|
|
|
|
$('<span>', {
|
|
|
|
|
|
|
|
'class': 'fa fa-user-plus friend',
|
|
|
|
|
|
|
|
'title': Messages._getKey('userlist_addAsFriendTitle', [
|
|
|
|
|
|
|
|
name
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
}).appendTo($rightCol).click(function (e) {
|
|
|
|
e.stopPropagation();
|
|
|
|
e.stopPropagation();
|
|
|
|
Cryptpad.inviteFromUserlist(Cryptpad, data.netfluxId);
|
|
|
|
Cryptpad.inviteFromUserlist(Cryptpad, data.netfluxId);
|
|
|
|
});
|
|
|
|
});
|
|
|
|