Commit f9a1144a authored by Mario's avatar Mario Committed by Mario

diaspora: provide xchan_url if we have no xchan_addr for mentions


(cherry picked from commit 150901ff)
parent e80a173c
......@@ -1189,12 +1189,14 @@ function diaspora_bb_to_markdown_bb(&$x) {
function diaspora_bb_to_markdown_mention_callback($match) {
$r = q("select xchan_addr from xchan where xchan_url = '%s'",
$r = q("select xchan_addr, xchan_url from xchan where xchan_url = '%s'",
dbesc($match[2])
);
if($r)
return '@{' . $r[0]['xchan_addr'] . '}';
if($r) {
$addr = (($r[0]['xchan_addr']) ? $r[0]['xchan_addr'] : $r[0]['xchan_url']);
return '@{' . $addr . '}';
}
return '@' . $match[3];
}
......@@ -1202,12 +1204,14 @@ function diaspora_bb_to_markdown_mention_callback($match) {
function diaspora_bb_to_markdown_fmention_callback($match) {
$r = q("select xchan_addr from xchan where xchan_url = '%s'",
$r = q("select xchan_addr, xchan_url from xchan where xchan_url = '%s'",
dbesc($match[2])
);
if($r)
return '!{' . $r[0]['xchan_addr'] . '}';
if($r) {
$addr = (($r[0]['xchan_addr']) ? $r[0]['xchan_addr'] : $r[0]['xchan_url']);
return '!{' . $addr . '}';
}
return '!' . $match[3];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment