diff options
author | Mario Vavti <mario@mariovavti.com> | 2021-07-09 11:31:26 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2021-07-09 11:31:26 +0200 |
commit | 2dd47a9f596106bfe8ea5d95a5f20597ed8bf0cd (patch) | |
tree | 8fd238ebca4b124916eb31a6760bb227b7bb57ba /Zotlabs/Module/Hq.php | |
parent | 6de327402bb90b3f09ccb0c92ffb112755dbd5a0 (diff) | |
parent | a92ad512bbcfc367f17739886cdeada13c20e66a (diff) | |
download | volse-hubzilla-2dd47a9f596106bfe8ea5d95a5f20597ed8bf0cd.tar.gz volse-hubzilla-2dd47a9f596106bfe8ea5d95a5f20597ed8bf0cd.tar.bz2 volse-hubzilla-2dd47a9f596106bfe8ea5d95a5f20597ed8bf0cd.zip |
Merge branch '6.0RC'
Diffstat (limited to 'Zotlabs/Module/Hq.php')
-rw-r--r-- | Zotlabs/Module/Hq.php | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index a2c4100ad..8c126d154 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'], @@ -125,13 +113,7 @@ class Hq extends \Zotlabs\Web\Controller { 'reset' => t('Reset form') ]; - $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') - ] - ); + $o = status_editor($a, $x, true); } @@ -153,9 +135,9 @@ 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', '$uid' => local_channel(), @@ -267,4 +249,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); + } + } |