aboutsummaryrefslogtreecommitdiffstats
path: root/include/bb2diaspora.php
diff options
context:
space:
mode:
authorPaolo T <tuscanhobbit@users.noreply.github.com>2014-10-12 09:15:39 +0200
committerPaolo T <tuscanhobbit@users.noreply.github.com>2014-10-12 09:15:39 +0200
commit56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41 (patch)
treec1376be525c85ab799f213ed79648d8c478da3d0 /include/bb2diaspora.php
parent9edaa2843b9982f52fb1ed93b1c6e3d9e53921d7 (diff)
parent44c4c9c5c271a5ad163a089b1dc271d108a59700 (diff)
downloadvolse-hubzilla-56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41.tar.gz
volse-hubzilla-56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41.tar.bz2
volse-hubzilla-56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41.zip
Merge pull request #6 from tuscanhobbit/master
Fast forward local hub
Diffstat (limited to 'include/bb2diaspora.php')
-rw-r--r--include/bb2diaspora.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 089838e97..a80b3343b 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -263,6 +263,17 @@ 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']))) {
logger('bb2diaspora_itemwallwall: author: ' . print_r($item['author'],true), LOGGER_DEBUG);
}
@@ -275,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']);
+
}