aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/items.php25
1 files changed, 16 insertions, 9 deletions
diff --git a/include/items.php b/include/items.php
index 272ce5a69..63edae972 100644
--- a/include/items.php
+++ b/include/items.php
@@ -702,7 +702,6 @@ function get_item_elements($x,$allow_code = false) {
$arr['mid'] = (($x['message_id']) ? htmlspecialchars($x['message_id'], ENT_COMPAT,'UTF-8',false) : '');
$arr['parent_mid'] = (($x['message_top']) ? htmlspecialchars($x['message_top'], ENT_COMPAT,'UTF-8',false) : '');
$arr['thr_parent'] = (($x['message_parent']) ? htmlspecialchars($x['message_parent'], ENT_COMPAT,'UTF-8',false) : '');
-
$arr['plink'] = (($x['permalink']) ? htmlspecialchars($x['permalink'], ENT_COMPAT,'UTF-8',false) : '');
$arr['location'] = (($x['location']) ? htmlspecialchars($x['location'], ENT_COMPAT,'UTF-8',false) : '');
$arr['coord'] = (($x['longlat']) ? htmlspecialchars($x['longlat'], ENT_COMPAT,'UTF-8',false) : '');
@@ -718,18 +717,12 @@ function get_item_elements($x,$allow_code = false) {
$arr['comment_policy'] = (($x['comment_scope']) ? htmlspecialchars($x['comment_scope'], ENT_COMPAT,'UTF-8',false) : 'contacts');
$arr['sig'] = (($x['signature']) ? htmlspecialchars($x['signature'], ENT_COMPAT,'UTF-8',false) : '');
-
$arr['obj'] = activity_sanitise($x['object']);
$arr['target'] = activity_sanitise($x['target']);
-
$arr['attach'] = activity_sanitise($x['attach']);
$arr['term'] = decode_tags($x['tags']);
$arr['iconfig'] = decode_item_meta($x['meta']);
-
- $private_state = (($x['allow_cid'] && !$x['allow_gid']) ? 2 : 1);
- $arr['item_private'] = ((array_key_exists('flags',$x) && is_array($x['flags']) && in_array('private',$x['flags'])) ? $private_state : 0);
-
- $arr['item_flags'] = 0;
+ $arr['item_flags'] = 0;
if(array_key_exists('flags',$x)) {
@@ -750,6 +743,12 @@ function get_item_elements($x,$allow_code = false) {
if(in_array('hidden',$x['flags']))
$arr['item_hidden'] = 1;
+ if(in_array('private', $x['flags']))
+ $arr['item_private'] = 1;
+
+ if(in_array('private', $x['flags']) && in_array('direct', $x['flags']))
+ $arr['item_private'] = 2;
+
}
// Here's the deal - the site might be down or whatever but if there's a new person you've never
@@ -1338,7 +1337,13 @@ function encode_item_xchan($xchan) {
$ret['id_sig'] = $xchan['xchan_guid_sig'];
$ret['key'] = $xchan['xchan_pubkey'];
- return $ret;
+ $hookdata = [
+ 'encoded_xchan' => $ret
+ ];
+
+ call_hooks('encode_item_xchan', $hookdata);
+
+ return $hookdata['encoded_xchan'];
}
function encode_item_terms($terms,$mirror = false) {
@@ -1553,6 +1558,8 @@ function encode_item_flags($item) {
$ret[] = 'obscured';
if(intval($item['item_private']))
$ret[] = 'private';
+ if(intval($item['item_private']) === 2)
+ $ret[] = 'direct';
return $ret;
}