From 05e11844e5a0f90b7f45f27047b2926442484108 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 22 Mar 2018 17:17:00 -0700 Subject: make list mode work in cards and articles --- include/conversation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/conversation.php b/include/conversation.php index 6374267eb..64beb1b0e 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -838,11 +838,11 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa $item_object = new Zotlabs\Lib\ThreadItem($item); $conv->add_thread($item_object); - if($page_mode === 'list') { + if(($page_mode === 'list') || ($page_mode === 'pager_list')) { $item_object->set_template('conv_list.tpl'); $item_object->set_display_mode('list'); } - if($page_mode === 'cards') { + if($mode === 'cards' || $mode === 'articles') { $item_object->set_reload($jsreload); } @@ -857,7 +857,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa } } - if($page_mode === 'traditional' || $page_mode === 'preview') { + if(in_array($page_mode, [ 'traditional', 'preview', 'pager_list'] )) { $page_template = get_markup_template("threaded_conversation.tpl"); } elseif($update) { -- cgit v1.2.3 From 034032c7c27ca0e0ba0720aeea84ba6272eb6d36 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 22 Mar 2018 19:52:25 -0700 Subject: slight change in mail privacy implementation. If you initiate a private mail conversation and they respond, accept the reply. You can't hide behind your permissions or lack thereof. Often this will be accidental. If you truly want to block them from replying and your permissions otherwise would not allow them to reply, delete the conversation. --- include/zot.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index c11cace2a..25ea9b8fb 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2285,13 +2285,31 @@ function process_mail_delivery($sender, $arr, $deliveries) { continue; } + if(! perm_is_allowed($channel['channel_id'],$sender['hash'],'post_mail')) { - logger("permission denied for mail delivery {$channel['channel_id']}"); - $DR->update('permission denied'); - $result[] = $DR->get(); - continue; + + /* + * Always allow somebody to reply if you initiated the conversation. It's anti-social + * and a bit rude to send a private message to somebody and block their ability to respond. + * If you are being harrassed and want to put an end to it, delete the conversation. + */ + + $return = false; + if($arr['parent_mid']) { + $return = q("select * from mail where mid = '%s' and channel_id = %d limit 1", + dbesc($arr['parent_mid']), + intval($channel['channel_id']) + ); + } + if(! $return) { + logger("permission denied for mail delivery {$channel['channel_id']}"); + $DR->update('permission denied'); + $result[] = $DR->get(); + continue; + } } + $r = q("select id from mail where mid = '%s' and channel_id = %d limit 1", dbesc($arr['mid']), intval($channel['channel_id']) -- cgit v1.2.3 From af8cbf000fb1433b7c7d2c6c4543980f01ba69a9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 22 Mar 2018 21:23:12 -0700 Subject: tagadelic was being overly protective of permissions. --- include/taxonomy.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/taxonomy.php b/include/taxonomy.php index 393b8718e..4a3818096 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -182,11 +182,10 @@ function tagadelic($uid, $count = 0, $authors = '', $owner = '', $flags = 0, $re $sql_options .= " and owner_xchan = '" . dbesc($owner) . "' "; } - // Fetch tags $r = q("select term, count(term) as total from term left join item on term.oid = item.id where term.uid = %d and term.ttype = %d - and otype = %d and item_type = %d and item_private = 0 + and otype = %d and item_type = %d $sql_options $item_normal group by term order by total desc %s", intval($uid), @@ -196,6 +195,7 @@ function tagadelic($uid, $count = 0, $authors = '', $owner = '', $flags = 0, $re ((intval($count)) ? "limit $count" : '') ); + if(! $r) return array(); -- cgit v1.2.3