aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Hq.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Hq.php')
-rw-r--r--Zotlabs/Module/Hq.php47
1 files changed, 23 insertions, 24 deletions
diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php
index a2c4100ad..4d55b76b0 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'],
@@ -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')
]
);
@@ -153,9 +139,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 +253,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);
+ }
+
}