aboutsummaryrefslogtreecommitdiffstats
path: root/include/bb2diaspora.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-20 19:06:36 -0700
committerredmatrix <git@macgirvin.com>2016-04-20 19:06:36 -0700
commitd2f67bf2497e4992e08ecbd2432f29ce1fd4c516 (patch)
tree8508b4b252a56c88e3ed559f1901633e699d22c8 /include/bb2diaspora.php
parent8f64b28fb998558378d1a14c744a275cc19f1d55 (diff)
parent0d91f363ccda100ccf6b35f7fb46a4352d00326a (diff)
downloadvolse-hubzilla-d2f67bf2497e4992e08ecbd2432f29ce1fd4c516.tar.gz
volse-hubzilla-d2f67bf2497e4992e08ecbd2432f29ce1fd4c516.tar.bz2
volse-hubzilla-d2f67bf2497e4992e08ecbd2432f29ce1fd4c516.zip
Merge branch 'dmeta' into dev
several diaspora changes/fixes
Diffstat (limited to 'include/bb2diaspora.php')
-rw-r--r--include/bb2diaspora.php34
1 files changed, 28 insertions, 6 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']);