diff options
author | redmatrix <git@macgirvin.com> | 2016-04-20 19:06:36 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-04-20 19:06:36 -0700 |
commit | d2f67bf2497e4992e08ecbd2432f29ce1fd4c516 (patch) | |
tree | 8508b4b252a56c88e3ed559f1901633e699d22c8 | |
parent | 8f64b28fb998558378d1a14c744a275cc19f1d55 (diff) | |
parent | 0d91f363ccda100ccf6b35f7fb46a4352d00326a (diff) | |
download | volse-hubzilla-d2f67bf2497e4992e08ecbd2432f29ce1fd4c516.tar.gz volse-hubzilla-d2f67bf2497e4992e08ecbd2432f29ce1fd4c516.tar.bz2 volse-hubzilla-d2f67bf2497e4992e08ecbd2432f29ce1fd4c516.zip |
Merge branch 'dmeta' into dev
several diaspora changes/fixes
-rw-r--r-- | include/bb2diaspora.php | 34 | ||||
-rw-r--r-- | include/notifier.php | 2 |
2 files changed, 28 insertions, 8 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 1ed57bfd4..add580636 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -270,7 +270,14 @@ function bb2dmention_callback($match) { function bb2diaspora_itemwallwall(&$item) { + // We will provide wallwall (embedded author on the Diaspora side) if + // 1. It is a wall-to-wall post + // 2. A comment arrived which has no Diaspora signature info + + + $wallwall = false; $author_exists = true; + if(! array_key_exists('author',$item)) { $author_exists = false; logger('bb2diaspora_itemwallwall: no author'); @@ -281,11 +288,21 @@ function bb2diaspora_itemwallwall(&$item) { $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_DATA); + $has_meta = false; + if($item['diaspora_meta'] || get_iconfig($item,'diaspora','fields')) + $has_meta = true; + + if($item['author_xchan'] != $item['owner_xchan']) { + if($item['mid'] == $item['parent_mid']) + $wallwall = true; + else { + if(! $has_meta) { + $wallwall = true; + } + } } - if(($item['mid'] == $item['parent_mid']) && ($item['author_xchan'] != $item['owner_xchan']) && (is_array($item['author'])) && $item['author']['xchan_url'] && $item['author']['xchan_name'] && $item['author']['xchan_photo_m']) { + if(($wallwall) && (is_array($item['author'])) && $item['author']['xchan_url'] && $item['author']['xchan_name'] && $item['author']['xchan_photo_m']) { logger('bb2diaspora_itemwallwall: wall to wall post',LOGGER_DEBUG); // post will come across with the owner's identity. Throw a preamble onto the post to indicate the true author. $item['body'] = "\n\n" @@ -301,7 +318,12 @@ function bb2diaspora_itemwallwall(&$item) { } -function bb2diaspora_itembody($item, $force_update = false) { +function bb2diaspora_itembody($item, $force_update = false, $have_channel = false) { + + + if(! get_iconfig($item,'diaspora','fields')) { + $force_update = true; + } $matches = array(); @@ -339,8 +361,8 @@ function bb2diaspora_itembody($item, $force_update = false) { } } - - bb2diaspora_itemwallwall($newitem); + if(! $have_channel) + bb2diaspora_itemwallwall($newitem, $newpost); $title = $newitem['title']; $body = preg_replace('/\#\^http/i', 'http', $newitem['body']); diff --git a/include/notifier.php b/include/notifier.php index 628847d54..4435c7497 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -450,7 +450,6 @@ function notifier_run($argv, $argc){ 'target_item' => $target_item, 'top_level_post' => $top_level_post, 'private' => $private, - 'followup' => $followup, 'relay_to_owner' => $relay_to_owner, 'uplink' => $uplink, 'cmd' => $cmd, @@ -547,7 +546,6 @@ function notifier_run($argv, $argc){ 'hub' => $hub, 'top_level_post' => $top_level_post, 'private' => $private, - 'followup' => $followup, 'relay_to_owner' => $relay_to_owner, 'uplink' => $uplink, 'cmd' => $cmd, |