aboutsummaryrefslogtreecommitdiffstats
path: root/include/bb2diaspora.php
diff options
context:
space:
mode:
authorhabeascodice <habeascodice@federated.social>2014-10-11 05:34:11 -0700
committerhabeascodice <habeascodice@federated.social>2014-10-11 05:34:11 -0700
commitbde8c6d39e1ccf7a53569cc652a62b5447d3243f (patch)
tree598928300196120d90a28aac79e57d213dd61779 /include/bb2diaspora.php
parent7a106cf60cfa005ec6d8c35f922dc57b9af0175e (diff)
parent3d0d36b2bc6d134e1140b9fc8c40206be5bd7d2d (diff)
downloadvolse-hubzilla-bde8c6d39e1ccf7a53569cc652a62b5447d3243f.tar.gz
volse-hubzilla-bde8c6d39e1ccf7a53569cc652a62b5447d3243f.tar.bz2
volse-hubzilla-bde8c6d39e1ccf7a53569cc652a62b5447d3243f.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'include/bb2diaspora.php')
-rw-r--r--include/bb2diaspora.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 65f4311a0..a80b3343b 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -263,8 +263,15 @@ function bb2dmention_callback($match) {
function bb2diaspora_itemwallwall(&$item) {
+ $author_exists = true;
if(! array_key_exists('author',$item)) {
+ $author_exists = false;
logger('bb2diaspora_itemwallwall: no author');
+ $r = q("select * from xchan where xchan_hash = '%s' limit 1",
+ dbesc($item['author_xchan'])
+ );
+ if($r)
+ $item['author'] = $r[0];
}
if(($item['mid'] == $item['parent_mid']) && ($item['author_xchan'] != $item['owner_xchan']) && (is_array($item['author']))) {
@@ -279,6 +286,11 @@ function bb2diaspora_itemwallwall(&$item) {
. '[url=' . $item['author']['xchan_url'] . ']' . $item['author']['xchan_name'] . '[/url]' . "\n\n"
. $item['body'];
}
+ // $item['author'] might cause a surprise further down the line if it wasn't expected to be here.
+
+ if(! $author_exists)
+ $unset($item['author']);
+
}