Issue 3428: Autocompletion now always show user@domain.tld
This commit is contained in:
parent
8d97bc61f5
commit
e11ff8bde5
|
@ -543,7 +543,7 @@ function acl_lookup(App $a, $out_type = 'json') {
|
||||||
|
|
||||||
if ($type == '') {
|
if ($type == '') {
|
||||||
|
|
||||||
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `forum`, `prv` FROM `contact`
|
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `addr`, `forum`, `prv` FROM `contact`
|
||||||
WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `notify` != ''
|
WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `notify` != ''
|
||||||
AND NOT (`network` IN ('%s', '%s'))
|
AND NOT (`network` IN ('%s', '%s'))
|
||||||
$sql_extra2
|
$sql_extra2
|
||||||
|
@ -552,7 +552,7 @@ function acl_lookup(App $a, $out_type = 'json') {
|
||||||
dbesc(NETWORK_OSTATUS), dbesc(NETWORK_STATUSNET)
|
dbesc(NETWORK_OSTATUS), dbesc(NETWORK_STATUSNET)
|
||||||
);
|
);
|
||||||
} elseif ($type == 'c') {
|
} elseif ($type == 'c') {
|
||||||
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `forum`, `prv` FROM `contact`
|
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `addr`, `forum`, `prv` FROM `contact`
|
||||||
WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `notify` != ''
|
WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `notify` != ''
|
||||||
AND NOT (`network` IN ('%s'))
|
AND NOT (`network` IN ('%s'))
|
||||||
$sql_extra2
|
$sql_extra2
|
||||||
|
@ -562,7 +562,7 @@ function acl_lookup(App $a, $out_type = 'json') {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif ($type == 'm') {
|
elseif ($type == 'm') {
|
||||||
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag` FROM `contact`
|
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `addr` FROM `contact`
|
||||||
WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `pending` AND NOT `archive`
|
WHERE `uid` = %d AND NOT `self` AND NOT `blocked` AND NOT `pending` AND NOT `archive`
|
||||||
AND `network` IN ('%s','%s','%s')
|
AND `network` IN ('%s','%s','%s')
|
||||||
$sql_extra2
|
$sql_extra2
|
||||||
|
@ -573,7 +573,7 @@ function acl_lookup(App $a, $out_type = 'json') {
|
||||||
dbesc(NETWORK_DIASPORA)
|
dbesc(NETWORK_DIASPORA)
|
||||||
);
|
);
|
||||||
} elseif ($type == 'a') {
|
} elseif ($type == 'a') {
|
||||||
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `forum`, `prv` FROM `contact`
|
$r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `addr`, `forum`, `prv` FROM `contact`
|
||||||
WHERE `uid` = %d AND `pending` = 0
|
WHERE `uid` = %d AND `pending` = 0
|
||||||
$sql_extra2
|
$sql_extra2
|
||||||
ORDER BY `name` ASC ",
|
ORDER BY `name` ASC ",
|
||||||
|
@ -617,6 +617,7 @@ function acl_lookup(App $a, $out_type = 'json') {
|
||||||
'network' => $g['network'],
|
'network' => $g['network'],
|
||||||
'link' => $g['url'],
|
'link' => $g['url'],
|
||||||
'nick' => htmlentities(($g['attag']) ? $g['attag'] : $g['nick']),
|
'nick' => htmlentities(($g['attag']) ? $g['attag'] : $g['nick']),
|
||||||
|
'addr' => htmlentities(($g['addr']) ? $g['addr'] : $g['url']),
|
||||||
'forum' => ((x($g, 'forum') || x($g, 'prv')) ? 1 : 0),
|
'forum' => ((x($g, 'forum') || x($g, 'prv')) ? 1 : 0),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -661,6 +662,7 @@ function acl_lookup(App $a, $out_type = 'json') {
|
||||||
'network' => $contact['network'],
|
'network' => $contact['network'],
|
||||||
'link' => $contact['url'],
|
'link' => $contact['url'],
|
||||||
'nick' => htmlentities($contact['nick'] ? : $contact['addr']),
|
'nick' => htmlentities($contact['nick'] ? : $contact['addr']),
|
||||||
|
'addr' => htmlentities(($contact['addr']) ? $contact['addr'] : $contact['url']),
|
||||||
'forum' => $contact['forum']
|
'forum' => $contact['forum']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,22 +78,26 @@ function contact_format(item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function editor_replace(item) {
|
function editor_replace(item) {
|
||||||
if(typeof item.replace !== 'undefined') {
|
if (typeof item.replace !== 'undefined') {
|
||||||
return '$1$2' + item.replace;
|
return '$1$2' + item.replace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof item.addr !== 'undefined') {
|
||||||
|
return '$1$2' + item.addr + ' ';
|
||||||
|
}
|
||||||
|
|
||||||
// $2 ensures that prefix (@,@!) is preserved
|
// $2 ensures that prefix (@,@!) is preserved
|
||||||
var id = item.id;
|
var id = item.id;
|
||||||
|
|
||||||
// don't add the id if it is empty (the id empty eg. if there are unknow contacts in thread)
|
// don't add the id if it is empty (the id empty eg. if there are unknow contacts in thread)
|
||||||
if(id.length < 1)
|
if (id.length < 1) {
|
||||||
return '$1$2' + item.nick.replace(' ', '') + ' ';
|
return '$1$2' + item.nick.replace(' ', '') + ' ';
|
||||||
|
}
|
||||||
// 16 chars of hash should be enough. Full hash could be used if it can be done in a visually appealing way.
|
// 16 chars of hash should be enough. Full hash could be used if it can be done in a visually appealing way.
|
||||||
// 16 chars is also the minimum length in the backend (otherwise it's interpreted as a local id).
|
// 16 chars is also the minimum length in the backend (otherwise it's interpreted as a local id).
|
||||||
if(id.length > 16)
|
if (id.length > 16) {
|
||||||
id = item.id.substring(0,16);
|
id = item.id.substring(0,16);
|
||||||
|
}
|
||||||
return '$1$2' + item.nick.replace(' ', '') + '+' + id + ' ';
|
return '$1$2' + item.nick.replace(' ', '') + '+' + id + ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user