|
|
@ -1099,8 +1099,8 @@ define([
|
|
|
|
if (!val) {
|
|
|
|
if (!val) {
|
|
|
|
var $img = $('<img>', {
|
|
|
|
var $img = $('<img>', {
|
|
|
|
src: '/customize/images/avatar.png',
|
|
|
|
src: '/customize/images/avatar.png',
|
|
|
|
title: Messages.profile_avatar, // XXX
|
|
|
|
title: Messages.profile_defaultAlt,
|
|
|
|
alt: 'Avatar'
|
|
|
|
alt: Messages.profile_defaultAlt,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
var mt = h('media-tag', $img[0]);
|
|
|
|
var mt = h('media-tag', $img[0]);
|
|
|
|
$avatar.append(mt);
|
|
|
|
$avatar.append(mt);
|
|
|
@ -1323,16 +1323,23 @@ define([
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var isValidInvitationLinkContent = function (json) {
|
|
|
|
|
|
|
|
if (!json) { return false; }
|
|
|
|
|
|
|
|
if (json.error || !Object.keys(json).length) { return false; }
|
|
|
|
|
|
|
|
if (!json.author) { return false; }
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
nThen(function (waitFor) {
|
|
|
|
// Get preview content.
|
|
|
|
// Get preview content.
|
|
|
|
sframeChan.query('Q_ANON_GET_PREVIEW_CONTENT', { seeds: seeds }, waitFor(function (err, json) {
|
|
|
|
sframeChan.query('Q_ANON_GET_PREVIEW_CONTENT', { seeds: seeds }, waitFor(function (err, json) {
|
|
|
|
if (json && (json.error || !Object.keys(json).length)) { // XXX team invite links are triggering this every time for me?
|
|
|
|
if (!isValidInvitationLinkContent(json)) {
|
|
|
|
$(errorBlock).text(Messages.team_inviteInvalidLinkError).show();
|
|
|
|
$(errorBlock).text(Messages.team_inviteInvalidLinkError).show();
|
|
|
|
waitFor.abort();
|
|
|
|
waitFor.abort();
|
|
|
|
$div.empty();
|
|
|
|
$div.empty();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// XXX nothing guarantees that author, teamName, or message exist in json
|
|
|
|
// FIXME nothing guarantees that teamName or author.displayName exist in json
|
|
|
|
$div.empty();
|
|
|
|
$div.empty();
|
|
|
|
$div.append(h('div.cp-teams-invite-from', [
|
|
|
|
$div.append(h('div.cp-teams-invite-from', [
|
|
|
|
Messages.team_inviteFrom,
|
|
|
|
Messages.team_inviteFrom,
|
|
|
|