|
|
@ -156,7 +156,10 @@ define([
|
|
|
|
var metadataMgr = config.metadataMgr;
|
|
|
|
var metadataMgr = config.metadataMgr;
|
|
|
|
var userData = metadataMgr.getMetadata().users;
|
|
|
|
var userData = metadataMgr.getMetadata().users;
|
|
|
|
var viewers = metadataMgr.getViewers();
|
|
|
|
var viewers = metadataMgr.getViewers();
|
|
|
|
var origin = config.metadataMgr.getPrivateData().origin;
|
|
|
|
var priv = metadataMgr.getPrivateData();
|
|
|
|
|
|
|
|
var origin = priv.origin;
|
|
|
|
|
|
|
|
var friends = priv.friends;
|
|
|
|
|
|
|
|
var user = metadataMgr.getUserData();
|
|
|
|
|
|
|
|
|
|
|
|
// If we are using old pads (readonly unavailable), only editing users are in userList.
|
|
|
|
// If we are using old pads (readonly unavailable), only editing users are in userList.
|
|
|
|
// With new pads, we also have readonly users in userList, so we have to intersect with
|
|
|
|
// With new pads, we also have readonly users in userList, so we have to intersect with
|
|
|
@ -186,22 +189,20 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
// Editors
|
|
|
|
// Editors
|
|
|
|
// TODO iframe enable friends
|
|
|
|
// TODO iframe enable friends
|
|
|
|
//var pendingFriends = Cryptpad.getPendingInvites();
|
|
|
|
var pendingFriends = Common.getPendingFriends();
|
|
|
|
editUsersNames.forEach(function (data) {
|
|
|
|
editUsersNames.forEach(function (data) {
|
|
|
|
var name = data.name || Messages.anonymous;
|
|
|
|
var name = data.name || Messages.anonymous;
|
|
|
|
var $span = $('<span>', {'class': 'avatar'});
|
|
|
|
var $span = $('<span>', {'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 isMe = data.curvePublic === user.curvePublic;
|
|
|
|
//var isMe = data.curvePublic === proxy.curvePublic;
|
|
|
|
if (Common.isLoggedIn() && data.curvePublic) {
|
|
|
|
|
|
|
|
|
|
|
|
/*if (Cryptpad.isLoggedIn() && data.curvePublic) {
|
|
|
|
|
|
|
|
if (isMe) {
|
|
|
|
if (isMe) {
|
|
|
|
$span.attr('title', Messages._getKey('userlist_thisIsYou', [
|
|
|
|
$span.attr('title', Messages._getKey('userlist_thisIsYou', [
|
|
|
|
name
|
|
|
|
name
|
|
|
|
]));
|
|
|
|
]));
|
|
|
|
$nameSpan.text(name);
|
|
|
|
$nameSpan.text(name);
|
|
|
|
} else if (!proxy.friends || !proxy.friends[data.curvePublic]) {
|
|
|
|
} else if (!friends[data.curvePublic]) {
|
|
|
|
if (pendingFriends.indexOf(data.netfluxId) !== -1) {
|
|
|
|
if (pendingFriends.indexOf(data.netfluxId) !== -1) {
|
|
|
|
$('<span>', {'class': 'friend'}).text(Messages.userlist_pending)
|
|
|
|
$('<span>', {'class': 'friend'}).text(Messages.userlist_pending)
|
|
|
|
.appendTo($rightCol);
|
|
|
|
.appendTo($rightCol);
|
|
|
@ -213,11 +214,11 @@ define([
|
|
|
|
])
|
|
|
|
])
|
|
|
|
}).appendTo($rightCol).click(function (e) {
|
|
|
|
}).appendTo($rightCol).click(function (e) {
|
|
|
|
e.stopPropagation();
|
|
|
|
e.stopPropagation();
|
|
|
|
Cryptpad.inviteFromUserlist(Cryptpad, data.netfluxId);
|
|
|
|
Common.sendFriendRequest(data.netfluxId);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}*/
|
|
|
|
}
|
|
|
|
if (data.profile) {
|
|
|
|
if (data.profile) {
|
|
|
|
$span.addClass('clickable');
|
|
|
|
$span.addClass('clickable');
|
|
|
|
$span.click(function () {
|
|
|
|
$span.click(function () {
|
|
|
|