aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-06-17 07:33:45 +0000
committerMario <mario@mariovavti.com>2021-06-17 07:33:45 +0000
commitb55676d08914d58927b5503a1bfa283397cd6d44 (patch)
tree34827895f126f9afe0c1db284e089632e19984c6 /Zotlabs/Module
parentb5a8ca6ef72366d355c99702f0a775ccc36734d5 (diff)
downloadvolse-hubzilla-b55676d08914d58927b5503a1bfa283397cd6d44.tar.gz
volse-hubzilla-b55676d08914d58927b5503a1bfa283397cd6d44.tar.bz2
volse-hubzilla-b55676d08914d58927b5503a1bfa283397cd6d44.zip
New landing page HQ with separate views for direct messages, public/limited messages and starred messages if the feature is enabled
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Acl.php4
-rw-r--r--Zotlabs/Module/Home.php2
-rw-r--r--Zotlabs/Module/Hq.php52
-rw-r--r--Zotlabs/Module/Network.php4
-rw-r--r--Zotlabs/Module/Notify.php34
-rw-r--r--Zotlabs/Module/Sse_bs.php12
6 files changed, 59 insertions, 49 deletions
diff --git a/Zotlabs/Module/Acl.php b/Zotlabs/Module/Acl.php
index 862a97bdc..7373de899 100644
--- a/Zotlabs/Module/Acl.php
+++ b/Zotlabs/Module/Acl.php
@@ -222,6 +222,7 @@ class Acl extends \Zotlabs\Web\Controller {
WHERE (abook_channel = %d $extra_channels_sql) AND abook_blocked = 0 and abook_pending = 0 and xchan_deleted = 0 $sql_extra2 order by $order_extra2 xchan_name asc" ,
intval(local_channel())
);
+
if($r2)
$r = array_merge($r2,$r);
@@ -282,13 +283,12 @@ class Acl extends \Zotlabs\Web\Controller {
}
}
elseif($type == 'm') {
-
$r = array();
$z = q("SELECT xchan_hash as hash, xchan_name as name, xchan_network as net, xchan_addr as nick, xchan_photo_s as micro, xchan_url as url
FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d
and xchan_deleted = 0
- and xchan_network IN ('zot', 'diaspora', 'friendica-over-diaspora')
+ and not xchan_network IN ('rss', 'anon', 'unknown')
$sql_extra3
ORDER BY xchan_name ASC ",
intval(local_channel())
diff --git a/Zotlabs/Module/Home.php b/Zotlabs/Module/Home.php
index 2bfab986f..315d05af6 100644
--- a/Zotlabs/Module/Home.php
+++ b/Zotlabs/Module/Home.php
@@ -40,7 +40,7 @@ class Home extends Controller {
if (!$dest)
$dest = get_config('system', 'startpage');
if (!$dest)
- $dest = z_root() . '/network';
+ $dest = z_root() . '/hq';
goaway($dest);
}
diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php
index a2c4100ad..a8d321b24 100644
--- a/Zotlabs/Module/Hq.php
+++ b/Zotlabs/Module/Hq.php
@@ -1,6 +1,10 @@
<?php
namespace Zotlabs\Module;
+use App;
+use Zotlabs\Widget\Messages;
+
+
require_once("include/bbcode.php");
require_once('include/security.php');
require_once('include/conversation.php');
@@ -14,23 +18,7 @@ class Hq extends \Zotlabs\Web\Controller {
if(! local_channel())
return;
- \App::$profile_uid = local_channel();
- }
-
- function post() {
-
- if(!local_channel())
- return;
-
- if($_REQUEST['notify_id']) {
- q("update notify set seen = 1 where id = %d and uid = %d",
- intval($_REQUEST['notify_id']),
- intval(local_channel())
- );
- }
-
- killme();
-
+ App::$profile_uid = local_channel();
}
function get($update = 0, $load = false) {
@@ -42,8 +30,9 @@ class Hq extends \Zotlabs\Web\Controller {
$item_hash = argv(1);
}
- if($_REQUEST['mid'])
+ if(isset($_REQUEST['mid'])) {
$item_hash = $_REQUEST['mid'];
+ }
$item_normal = item_normal();
$item_normal_update = item_normal_update();
@@ -55,7 +44,6 @@ class Hq extends \Zotlabs\Web\Controller {
ORDER BY created DESC LIMIT 1",
intval(local_channel())
);
-
if($r[0]['mid']) {
$item_hash = 'b64.' . base64url_encode($r[0]['mid']);
}
@@ -96,7 +84,7 @@ class Hq extends \Zotlabs\Web\Controller {
}
if(! $update) {
- $channel = \App::get_channel();
+ $channel = App::get_channel();
$channel_acl = [
'allow_cid' => $channel['channel_allow_cid'],
@@ -116,7 +104,7 @@ class Hq extends \Zotlabs\Web\Controller {
'bang' => '',
'visitor' => true,
'profile_uid' => local_channel(),
- 'return_path' => 'hq',
+ 'return_path' => 'hq', //(($dm_mode) ? 'dm' : 'hq'),
'expanded' => true,
'editor_autocomplete' => true,
'bbco_autocomplete' => 'bbcode',
@@ -127,8 +115,6 @@ class Hq extends \Zotlabs\Web\Controller {
$o = replace_macros(get_markup_template("hq.tpl"),
[
- '$no_messages' => (($target_item) ? false : true),
- '$no_messages_label' => [ t('Welcome to Hubzilla!'), t('You have got no unseen posts...') ],
'$editor' => status_editor($a,$x,false,'Hq')
]
);
@@ -137,6 +123,7 @@ class Hq extends \Zotlabs\Web\Controller {
if(! $update && ! $load) {
+ //$app = (($dm_mode) ? 'Direct Messages' : 'Start');
nav_set_selected('HQ');
if($target_item) {
@@ -153,11 +140,11 @@ class Hq extends \Zotlabs\Web\Controller {
$o .= '<div id="live-hq"></div>' . "\r\n";
$o .= "<script> var profile_uid = " . local_channel()
- . "; var netargs = '?f='; var profile_page = " . \App::$pager['page'] . ";</script>\r\n";
+ . "; var netargs = '?f='; var profile_page = " . App::$pager['page'] . ";</script>\r\n";
- \App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),[
+ App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),[
'$baseurl' => z_root(),
- '$pgtype' => 'hq',
+ '$pgtype' => 'hq', //(($dm_mode) ? 'dm' : 'hq'),
'$uid' => local_channel(),
'$gid' => '0',
'$cid' => '0',
@@ -267,4 +254,17 @@ class Hq extends \Zotlabs\Web\Controller {
}
+ function post() {
+ if (!local_channel())
+ return;
+
+ $options['offset'] = $_REQUEST['offset'];
+ $options['dm'] = $_REQUEST['dm'];
+ $options['type'] = $_REQUEST['type'];
+
+ $ret = Messages::get_messages_page($options);
+
+ json_return_and_die($ret);
+ }
+
}
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php
index a21095940..be954cbfd 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -388,6 +388,10 @@ class Network extends \Zotlabs\Web\Controller {
if ($dm) {
$sql_extra .= " AND item_private = 2 ";
}
+ else {
+ $sql_extra .= " AND item_private IN (0, 1) ";
+ }
+
if($conv) {
$item_thread_top = '';
diff --git a/Zotlabs/Module/Notify.php b/Zotlabs/Module/Notify.php
index cffcc8099..5bfcec4f7 100644
--- a/Zotlabs/Module/Notify.php
+++ b/Zotlabs/Module/Notify.php
@@ -8,7 +8,15 @@ class Notify extends \Zotlabs\Web\Controller {
function init() {
if(! local_channel())
return;
-
+
+ if($_REQUEST['notify_id']) {
+ q("update notify set seen = 1 where id = %d and uid = %d",
+ intval($_REQUEST['notify_id']),
+ intval(local_channel())
+ );
+ killme();
+ }
+
if(argc() > 2 && argv(1) === 'view' && intval(argv(2))) {
$r = q("select * from notify where id = %d and uid = %d limit 1",
intval(argv(2)),
@@ -29,24 +37,24 @@ class Notify extends \Zotlabs\Web\Controller {
}
goaway(z_root());
}
-
-
+
+
}
-
-
+
+
function get() {
if(! local_channel())
return login();
-
+
$notif_tpl = get_markup_template('notifications.tpl');
-
+
$not_tpl = get_markup_template('notify.tpl');
require_once('include/bbcode.php');
-
+
$r = q("SELECT * from notify where uid = %d and seen = 0 order by created desc",
intval(local_channel())
);
-
+
if($r) {
foreach ($r as $it) {
$notif_content .= replace_macros($not_tpl,array(
@@ -56,18 +64,18 @@ class Notify extends \Zotlabs\Web\Controller {
'$item_when' => relative_date($it['created'])
));
}
- }
+ }
else {
$notif_content .= t('No more system notifications.');
}
-
+
$o .= replace_macros($notif_tpl,array(
'$notif_header' => t('System Notifications'),
'$tabs' => '', // $tabs,
'$notif_content' => $notif_content,
));
-
+
return $o;
-
+
}
}
diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php
index 3316a6beb..ca86f4f1f 100644
--- a/Zotlabs/Module/Sse_bs.php
+++ b/Zotlabs/Module/Sse_bs.php
@@ -37,7 +37,7 @@ class Sse_bs extends Controller {
self::$vnotify = get_pconfig(self::$uid, 'system', 'vnotify', -1);
self::$evdays = intval(get_pconfig(self::$uid, 'system', 'evdays'));
- self::$limit = 50;
+ self::$limit = 30;
self::$offset = 0;
self::$xchans = '';
@@ -57,8 +57,6 @@ class Sse_bs extends Controller {
if(intval(argv(2)) > 0)
self::$offset = argv(2);
- else
- $_SESSION['sse_loadtime'] = datetime_convert();
$network = false;
$dm = false;
@@ -178,7 +176,7 @@ class Sse_bs extends Controller {
$sql_extra2
ORDER BY created DESC LIMIT $limit OFFSET $offset",
intval(self::$uid),
- dbescdate($_SESSION['sse_loadtime']),
+ dbescdate($_SESSION['page_loadtime']),
dbesc(self::$ob_hash)
);
@@ -254,7 +252,7 @@ class Sse_bs extends Controller {
$sql_extra2
ORDER BY created DESC LIMIT $limit OFFSET $offset",
intval(self::$uid),
- dbescdate($_SESSION['sse_loadtime']),
+ dbescdate($_SESSION['page_loadtime']),
dbesc(self::$ob_hash)
);
@@ -330,7 +328,7 @@ class Sse_bs extends Controller {
$sql_extra2
ORDER BY created DESC LIMIT $limit OFFSET $offset",
intval(self::$uid),
- dbescdate($_SESSION['sse_loadtime']),
+ dbescdate($_SESSION['page_loadtime']),
dbesc(self::$ob_hash)
);
@@ -417,7 +415,7 @@ class Sse_bs extends Controller {
$sql_extra2
ORDER BY created DESC LIMIT $limit OFFSET $offset",
intval($sys['channel_id']),
- dbescdate($_SESSION['sse_loadtime']),
+ dbescdate($_SESSION['page_loadtime']),
dbesc(self::$ob_hash),
dbescdate($_SESSION['static_loadtime'])
);