more testing of chatroom interfaces, also corrected a function call that should have been a class instantiation in reddav

This commit is contained in:
friendica 2014-01-29 16:02:02 -08:00
parent 1915add7c1
commit 677f5f641e
4 changed files with 7 additions and 4 deletions

View File

@ -88,8 +88,8 @@ function chatroom_enter($observer_xchan,$room_id,$status,$client) {
require_once('include/security.php'); require_once('include/security.php');
$sql_extra = permissions_sql($r[0]['cr_uid']); $sql_extra = permissions_sql($r[0]['cr_uid']);
$x = q("select * from chatroom where cr_id = %d and uid = %d $sql_extra limit 1", $x = q("select * from chatroom where cr_id = %d and cr_uid = %d $sql_extra limit 1",
intval($room_id) intval($room_id),
intval($r[0]['cr_uid']) intval($r[0]['cr_uid'])
); );
if(! $x) { if(! $x) {

View File

@ -628,7 +628,7 @@ function RedFileData($file, &$auth,$test = false) {
} }
if((! $file) || ($file === '/')) { if((! $file) || ($file === '/')) {
return RedDirectory('/',$auth); return new RedDirectory('/',$auth);
} }

View File

@ -580,8 +580,11 @@ function widget_menu_preview($arr) {
function widget_chatroom_list($arr) { function widget_chatroom_list($arr) {
require_once("include/chat.php"); require_once("include/chat.php");
$r = chatroom_list(local_user()); $r = chatroom_list(local_user());
$channel = get_app()->get_channel();
return replace_macros(get_markup_template('chatroomlist.tpl'),array( return replace_macros(get_markup_template('chatroomlist.tpl'),array(
'$header' => t('Chat Rooms'), '$header' => t('Chat Rooms'),
'$baseurl' => z_root(),
'$nickname' => $channel['channel_address'],
'$items' => $r, '$items' => $r,
)); ));
} }

View File

@ -3,7 +3,7 @@
{{if $items}} {{if $items}}
<table> <table>
{{foreach $items as $item}} {{foreach $items as $item}}
<tr><td>{{$item.cr_name}}</td><td>{{$item.cr_inroom}}</td></tr> <tr><td align="left"><a href="{{$baseurl}}/chat/{{$nickname}}/{{$item.cr_id}}">{{$item.cr_name}}</a></td><td align="right">{{$item.cr_inroom}}</td></tr>
{{/foreach}} {{/foreach}}
</table> </table>
{{/if}} {{/if}}