aboutsummaryrefslogtreecommitdiffstats
path: root/mod/chatsvc.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-03-31 16:06:03 -0700
committerredmatrix <git@macgirvin.com>2016-03-31 16:06:03 -0700
commit9abd95fad3784a10fc48bc40f9b8a75d7d74edda (patch)
tree3cf2eec6a29f384b80a8c607aa97172b84e37e62 /mod/chatsvc.php
parent256c228efd249f2ce93405db8e36f52030aa4876 (diff)
downloadvolse-hubzilla-9abd95fad3784a10fc48bc40f9b8a75d7d74edda.tar.gz
volse-hubzilla-9abd95fad3784a10fc48bc40f9b8a75d7d74edda.tar.bz2
volse-hubzilla-9abd95fad3784a10fc48bc40f9b8a75d7d74edda.zip
static App
Diffstat (limited to 'mod/chatsvc.php')
-rw-r--r--mod/chatsvc.php36
1 files changed, 18 insertions, 18 deletions
diff --git a/mod/chatsvc.php b/mod/chatsvc.php
index 829fef6f8..f0497bfd9 100644
--- a/mod/chatsvc.php
+++ b/mod/chatsvc.php
@@ -8,16 +8,16 @@ function chatsvc_init(&$a) {
$ret = array('success' => false);
- $a->data['chat']['room_id'] = intval($_REQUEST['room_id']);
+ App::$data['chat']['room_id'] = intval($_REQUEST['room_id']);
$x = q("select cr_uid from chatroom where cr_id = %d and cr_id != 0 limit 1",
- intval($a->data['chat']['room_id'])
+ intval(App::$data['chat']['room_id'])
);
if(! $x)
json_return_and_die($ret);
- $a->data['chat']['uid'] = $x[0]['cr_uid'];
+ App::$data['chat']['uid'] = $x[0]['cr_uid'];
- if(! perm_is_allowed($a->data['chat']['uid'],get_observer_hash(),'chat')) {
+ if(! perm_is_allowed(App::$data['chat']['uid'],get_observer_hash(),'chat')) {
json_return_and_die($ret);
}
@@ -27,22 +27,22 @@ function chatsvc_post(&$a) {
$ret = array('success' => false);
- $room_id = $a->data['chat']['room_id'];
+ $room_id = App::$data['chat']['room_id'];
$text = escape_tags($_REQUEST['chat_text']);
if(! $text)
return;
- $sql_extra = permissions_sql($a->data['chat']['uid']);
+ $sql_extra = permissions_sql(App::$data['chat']['uid']);
$r = q("select * from chatroom where cr_uid = %d and cr_id = %d $sql_extra",
- intval($a->data['chat']['uid']),
- intval($a->data['chat']['room_id'])
+ intval(App::$data['chat']['uid']),
+ intval(App::$data['chat']['room_id'])
);
if(! $r)
json_return_and_die($ret);
$arr = array(
- 'chat_room' => $a->data['chat']['room_id'],
+ 'chat_room' => App::$data['chat']['room_id'],
'chat_xchan' => get_observer_hash(),
'chat_text' => $text
);
@@ -51,7 +51,7 @@ function chatsvc_post(&$a) {
$x = q("insert into chat ( chat_room, chat_xchan, created, chat_text )
values( %d, '%s', '%s', '%s' )",
- intval($a->data['chat']['room_id']),
+ intval(App::$data['chat']['room_id']),
dbesc(get_observer_hash()),
dbesc(datetime_convert()),
dbesc($arr['chat_text'])
@@ -64,13 +64,13 @@ function chatsvc_post(&$a) {
function chatsvc_content(&$a) {
$status = strip_tags($_REQUEST['status']);
- $room_id = intval($a->data['chat']['room_id']);
+ $room_id = intval(App::$data['chat']['room_id']);
$stopped = ((x($_REQUEST,'stopped') && intval($_REQUEST['stopped'])) ? true : false);
if($status && $room_id) {
$x = q("select channel_address from channel where channel_id = %d limit 1",
- intval($a->data['chat']['uid'])
+ intval(App::$data['chat']['uid'])
);
$r = q("update chatpresence set cp_status = '%s', cp_last = '%s' where cp_room = %d and cp_xchan = '%s' and cp_client = '%s'",
@@ -90,11 +90,11 @@ function chatsvc_content(&$a) {
$ret = array('success' => false);
- $sql_extra = permissions_sql($a->data['chat']['uid']);
+ $sql_extra = permissions_sql(App::$data['chat']['uid']);
$r = q("select * from chatroom where cr_uid = %d and cr_id = %d $sql_extra",
- intval($a->data['chat']['uid']),
- intval($a->data['chat']['room_id'])
+ intval(App::$data['chat']['uid']),
+ intval(App::$data['chat']['room_id'])
);
if(! $r)
json_return_and_die($ret);
@@ -102,7 +102,7 @@ function chatsvc_content(&$a) {
$inroom = array();
$r = q("select * from chatpresence left join xchan on xchan_hash = cp_xchan where cp_room = %d order by xchan_name",
- intval($a->data['chat']['room_id'])
+ intval(App::$data['chat']['room_id'])
);
if($r) {
foreach($r as $rr) {
@@ -125,7 +125,7 @@ function chatsvc_content(&$a) {
$chats = array();
$r = q("select * from chat left join xchan on chat_xchan = xchan_hash where chat_room = %d and chat_id > %d order by created",
- intval($a->data['chat']['room_id']),
+ intval(App::$data['chat']['room_id']),
intval($lastseen)
);
if($r) {
@@ -145,7 +145,7 @@ function chatsvc_content(&$a) {
$r = q("update chatpresence set cp_last = '%s' where cp_room = %d and cp_xchan = '%s' and cp_client = '%s'",
dbesc(datetime_convert()),
- intval($a->data['chat']['room_id']),
+ intval(App::$data['chat']['room_id']),
dbesc(get_observer_hash()),
dbesc($_SERVER['REMOTE_ADDR'])
);