aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-10-22 20:39:49 -0700
committerfriendica <info@friendica.com>2014-10-22 20:39:49 -0700
commit58c692e3897a7807fed23e2633496c4960f022ca (patch)
tree38311cf84fc526f5a52cf2200f943b3590d0eba9 /include/items.php
parent902b5c52e5ca9359522f33bbecaf7f2f3c1ba90d (diff)
downloadvolse-hubzilla-58c692e3897a7807fed23e2633496c4960f022ca.tar.gz
volse-hubzilla-58c692e3897a7807fed23e2633496c4960f022ca.tar.bz2
volse-hubzilla-58c692e3897a7807fed23e2633496c4960f022ca.zip
improved wall-to-wall detection for comments so we can handle Diaspora signing and wall-to-wall attribution correctly.
Do it at the point of submission. This also fixes a potential bug in yesterday's wall-to-wall permission setting, if it was a local comment to a remote post.
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php
index a0c81f5ae..e3526b0a5 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2517,7 +2517,7 @@ function item_store_update($arr,$allow_exec = false) {
return $ret;
}
-function store_diaspora_comment_sig($datarray, $channel, $parent_item, $post_id) {
+function store_diaspora_comment_sig($datarray, $channel, $parent_item, $post_id, $walltowall = false) {
// We won't be able to sign Diaspora comments for authenticated visitors
// - we don't have their private key
@@ -2527,7 +2527,16 @@ function store_diaspora_comment_sig($datarray, $channel, $parent_item, $post_id)
require_once('include/bb2diaspora.php');
$signed_body = bb2diaspora_itembody($datarray);
- logger('mod_item: storing diaspora comment signature',LOGGER_DEBUG);
+ if($walltowall) {
+ logger('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.
+ $signed_body = "\n\n"
+ . '[img]' . $datarray['author']['xchan_photo_m'] . '[/img]'
+ . '[url=' . $datarray['author']['xchan_url'] . ']' . $datarray['author']['xchan_name'] . '[/url]' . "\n\n"
+ . $signed_body;
+ }
+
+ logger('storing diaspora comment signature',LOGGER_DEBUG);
$diaspora_handle = $channel['channel_address'] . '@' . get_app()->get_hostname();