diff options
author | friendica <info@friendica.com> | 2014-01-29 02:25:21 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-01-29 02:25:21 -0800 |
commit | 10b51a9471bba2a1b058eee2d362d3d2189627be (patch) | |
tree | ee53aa7e6a106efc85ca5a32f1ab9db14411ed24 /include/chat.php | |
parent | f84ba95e870ce5b63e5af4cc7be43b516d4c163d (diff) | |
download | volse-hubzilla-10b51a9471bba2a1b058eee2d362d3d2189627be.tar.gz volse-hubzilla-10b51a9471bba2a1b058eee2d362d3d2189627be.tar.bz2 volse-hubzilla-10b51a9471bba2a1b058eee2d362d3d2189627be.zip |
issues uncovered whilst testing the chatroom API
Diffstat (limited to 'include/chat.php')
-rw-r--r-- | include/chat.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/include/chat.php b/include/chat.php index cb910bd62..8011fdb5b 100644 --- a/include/chat.php +++ b/include/chat.php @@ -23,8 +23,8 @@ function chatroom_create($channel,$arr) { $created = datetime_convert(); $x = q("insert into chatroom ( cr_aid, cr_uid, cr_name, cr_created, cr_edited, allow_cid, allow_gid, deny_cid, deny_gid ) - values ( %d, %d , '%s' '%s', '%s', '%s', '%s', '%s', '%s' ) ", - intval($channel['account_id']), + values ( %d, %d , '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ", + intval($channel['channel_account_id']), intval($channel['channel_id']), dbesc($name), dbesc($created), @@ -34,6 +34,7 @@ function chatroom_create($channel,$arr) { dbesc($arr['deny_cid']), dbesc($arr['deny_gid']) ); + if($x) $ret['success'] = true; @@ -74,8 +75,8 @@ function chatroom_destroy($channel,$arr) { } -function chatroom_enter($observer_xchan,$room_id,$status) { - if(! $room_id || ! $observer) +function chatroom_enter($observer_xchan,$room_id,$status,$client) { + if(! $room_id || ! $observer_xchan) return; $r = q("select * from chatpresence where cp_xchan = '%s' and cp_room = %d limit 1", dbesc($observer_xchan), @@ -90,19 +91,20 @@ function chatroom_enter($observer_xchan,$room_id,$status) { return true; } - $r = q("insert into chatpresence ( cp_room, cp_xchan, cp_last, cp_status ) - values ( %d, '%s', '%s', '%s' )", + $r = q("insert into chatpresence ( cp_room, cp_xchan, cp_last, cp_status, cp_client ) + values ( %d, '%s', '%s', '%s', '%s' )", intval($room_id), dbesc($observer_xchan), dbesc(datetime_convert()), - dbesc($status) + dbesc($status), + dbesc($client) ); return $r; } function chatroom_leave($observer_xchan,$room_id,$status) { - if(! $room_id || ! $observer) + if(! $room_id || ! $observer_xchan) return; $r = q("select * from chatpresence where cp_xchan = '%s' and cp_room = %d limit 1", dbesc($observer_xchan), |