aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-10-19 19:20:25 -0700
committerfriendica <info@friendica.com>2014-10-19 19:20:25 -0700
commit8227be0ab0018866cb3a1a5d597b8712ba547d7f (patch)
treeeaec91079ff62dc02cf711b454ab57b796e3ea06 /include
parentfd492386bf13152750c4db7306950d52b1105af1 (diff)
downloadvolse-hubzilla-8227be0ab0018866cb3a1a5d597b8712ba547d7f.tar.gz
volse-hubzilla-8227be0ab0018866cb3a1a5d597b8712ba547d7f.tar.bz2
volse-hubzilla-8227be0ab0018866cb3a1a5d597b8712ba547d7f.zip
show true author of wall-to-wall comments to Diaspora viewers just like we did for wall-to-wall posts.
Diffstat (limited to 'include')
-rw-r--r--include/bb2diaspora.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 76708143b..9a87de5b2 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -286,6 +286,19 @@ function bb2diaspora_itemwallwall(&$item) {
. '[url=' . $item['author']['xchan_url'] . ']' . $item['author']['xchan_name'] . '[/url]' . "\n\n"
. $item['body'];
}
+
+ // We have to do something similar for wall-to-wall comments. ITEM_WALL|ITEM_ORIGIN indicates that it was posted on this site.
+ // Regular matrix comments may have one of these bits set, but not both.
+
+ if(($item['mid'] != $item['parent_mid']) && ($item['author_xchan'] != $item['owner_xchan']) && ($item['item_flags'] & (ITEM_WALL|ITEM_ORIGIN)) && (is_array($item['author'])) && $item['author']['xchan_url'] && $item['author']['xchan_name'] && $item['author']['xchan_photo_m']) {
+ logger('bb2diaspora_itemwallwall: wall to wall comment',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"
+ . '[img]' . $item['author']['xchan_photo_m'] . '[/img]'
+ . '[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)