diff options
author | Mario <mario@mariovavti.com> | 2020-01-15 21:43:47 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-01-15 21:43:47 +0000 |
commit | 2a0a06d74aa1e51b0e50459f90167ab35ba1411b (patch) | |
tree | e078f0a93779cb5f156c0f56b9df574bdad744ab | |
parent | ccaa93655a6b44834d04c536d809c4b2c69c354b (diff) | |
download | volse-hubzilla-2a0a06d74aa1e51b0e50459f90167ab35ba1411b.tar.gz volse-hubzilla-2a0a06d74aa1e51b0e50459f90167ab35ba1411b.tar.bz2 volse-hubzilla-2a0a06d74aa1e51b0e50459f90167ab35ba1411b.zip |
some work on zot6 DMs
-rw-r--r-- | Zotlabs/Lib/Activity.php | 8 | ||||
-rw-r--r-- | Zotlabs/Lib/Libzot.php | 4 | ||||
-rw-r--r-- | Zotlabs/Module/Channel.php | 1 | ||||
-rw-r--r-- | Zotlabs/Module/Display.php | 1 | ||||
-rw-r--r-- | Zotlabs/Module/Hq.php | 1 | ||||
-rw-r--r-- | Zotlabs/Module/Network.php | 6 | ||||
-rw-r--r-- | Zotlabs/Module/Pubstream.php | 1 | ||||
-rw-r--r-- | Zotlabs/Module/Search.php | 1 | ||||
-rw-r--r-- | Zotlabs/Widget/Activity_filter.php | 14 | ||||
-rwxr-xr-x | view/tpl/build_query.tpl | 2 |
10 files changed, 35 insertions, 4 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index a99bb36e4..43315a87f 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -1989,9 +1989,15 @@ class Activity { $s['plink'] = $s['mid']; } - if($act->recips && (! in_array(ACTIVITY_PUBLIC_INBOX,$act->recips))) + if ($act->recips && (! in_array(ACTIVITY_PUBLIC_INBOX,$act->recips))) $s['item_private'] = 1; + if (is_array($act->obj)) { + if (array_key_exists('directMessage',$act->obj) && intval($act->obj['directMessage'])) { + $s['item_private'] = 2; + } + } + set_iconfig($s,'activitypub','recips',$act->raw_recips); $parent = (($s['parent_mid'] && $s['parent_mid'] === $s['mid']) ? true : false); diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 100d45c05..ad00aa97a 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -1220,8 +1220,8 @@ class Libzot { $arr['owner_xchan'] = $env['sender']; } - if($private) { - $arr['item_private'] = true; + if ($private && (! intval($arr['item_private']))) { + $arr['item_private'] = 1; } if ($arr['mid'] === $arr['parent_mid']) { diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 5529db70e..170b81787 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -419,6 +419,7 @@ class Channel extends Controller { '$nouveau' => '0', '$wall' => '1', '$fh' => '0', + '$dm' => '0', '$static' => $static, '$page' => ((App::$pager['page'] != 1) ? App::$pager['page'] : 1), '$search' => $search, diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index cf38aba1a..777d183e1 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -224,6 +224,7 @@ class Display extends \Zotlabs\Web\Controller { '$conv' => '0', '$spam' => '0', '$fh' => '0', + '$dm' => '0', '$nouveau' => '0', '$wall' => '0', '$static' => $static, diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index d8c540fb9..5b331f4c1 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -179,6 +179,7 @@ class Hq extends \Zotlabs\Web\Controller { '$conv' => '0', '$spam' => '0', '$fh' => '0', + '$dm' => '0', '$nouveau' => '0', '$wall' => '0', '$static' => $static, diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 1c16e34ef..a8efd0d9e 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -69,6 +69,7 @@ class Network extends \Zotlabs\Web\Controller { $category = ((x($_REQUEST,'cat')) ? $_REQUEST['cat'] : ''); $hashtags = ((x($_REQUEST,'tag')) ? $_REQUEST['tag'] : ''); $verb = ((x($_REQUEST,'verb')) ? $_REQUEST['verb'] : ''); + $dm = ((x($_REQUEST,'dm')) ? $_REQUEST['dm'] : 0); $order = get_pconfig(local_channel(), 'mod_network', 'order', 0); @@ -363,6 +364,7 @@ class Network extends \Zotlabs\Web\Controller { '$conv' => (($conv) ? $conv : '0'), '$spam' => (($spam) ? $spam : '0'), '$fh' => '0', + '$dm' => (($dm) ? $dm : '0'), '$nouveau' => (($nouveau) ? $nouveau : '0'), '$wall' => '0', '$static' => $static, @@ -418,6 +420,10 @@ class Network extends \Zotlabs\Web\Controller { if(strlen($file)) { $sql_extra .= term_query('item',$file,TERM_FILE); } + + if ($dm) { + $sql_extra .= " AND item_private = 2 "; + } if($conv) { $item_thread_top = ''; diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php index 282c10989..92ef44696 100644 --- a/Zotlabs/Module/Pubstream.php +++ b/Zotlabs/Module/Pubstream.php @@ -144,6 +144,7 @@ class Pubstream extends \Zotlabs\Web\Controller { '$conv' => '0', '$spam' => '0', '$fh' => '1', + '$dm' => '0', '$nouveau' => '0', '$wall' => '0', '$list' => '0', diff --git a/Zotlabs/Module/Search.php b/Zotlabs/Module/Search.php index 214ece9a3..686afb2d2 100644 --- a/Zotlabs/Module/Search.php +++ b/Zotlabs/Module/Search.php @@ -128,6 +128,7 @@ class Search extends \Zotlabs\Web\Controller { '$conv' => '0', '$spam' => '0', '$fh' => '0', + '$dm' => '0', '$nouveau' => '0', '$wall' => '0', '$static' => $static, diff --git a/Zotlabs/Widget/Activity_filter.php b/Zotlabs/Widget/Activity_filter.php index 32ab10c77..84b9ec24a 100644 --- a/Zotlabs/Widget/Activity_filter.php +++ b/Zotlabs/Widget/Activity_filter.php @@ -15,8 +15,20 @@ class Activity_filter { $filter_active = false; $tabs = []; +/* leave this commented out until ready for primetime + if(x($_GET,'dm')) { + $dm_active = (($_GET['dm'] == 1) ? 'active' : ''); + $filter_active = 'dm'; + } - + $tabs[] = [ + 'label' => t('Direct Messages'), + 'icon' => 'envelope-o', + 'url' => z_root() . '/' . $cmd . '/?f=&dm=1', + 'sel' => $dm_active, + 'title' => t('Show direct (private) messages') + ]; +*/ if(Apps::system_app_installed(local_channel(), 'Privacy Groups')) { $groups = q("SELECT * FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", intval(local_channel()) diff --git a/view/tpl/build_query.tpl b/view/tpl/build_query.tpl index fcb22b605..bbe0ac7ee 100755 --- a/view/tpl/build_query.tpl +++ b/view/tpl/build_query.tpl @@ -17,6 +17,7 @@ var bParam_wall = {{$wall}}; var bParam_list = {{$list}}; var bParam_fh = {{$fh}}; + var bParam_dm = {{$dm}}; var bParam_static = {{$static}}; var bParam_search = "{{$search}}"; @@ -50,6 +51,7 @@ if(bParam_wall != 0) bCmd = bCmd + "&wall=" + bParam_wall; if(bParam_list != 0) bCmd = bCmd + "&list=" + bParam_list; if(bParam_fh != 0) bCmd = bCmd + "&fh=" + bParam_fh; + if(bParam_dm != 0) bCmd = bCmd + "&dm=" + bParam_dm; if(bParam_search != "") bCmd = bCmd + "&search=" + bParam_search; if(bParam_xchan != "") bCmd = bCmd + "&xchan=" + bParam_xchan; if(bParam_order != "") bCmd = bCmd + "&order=" + bParam_order; |