aboutsummaryrefslogtreecommitdiffstats
path: root/mod/chat.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/chat.php')
-rw-r--r--mod/chat.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/mod/chat.php b/mod/chat.php
index 54fa58092..e79973aef 100644
--- a/mod/chat.php
+++ b/mod/chat.php
@@ -91,7 +91,7 @@ function chat_content(&$a) {
}
if((argc() > 3) && intval(argv(2)) && (argv(3) === 'leave')) {
- chatroom_leave($observer,$room_id,$_SERVER['REMOTE_ADDR']);
+ chatroom_leave($observer,argv(2),$_SERVER['REMOTE_ADDR']);
goaway(z_root() . '/channel/' . argv(1));
}
@@ -101,10 +101,23 @@ function chat_content(&$a) {
$x = chatroom_enter($observer,$room_id,'online',$_SERVER['REMOTE_ADDR']);
if(! $x)
return;
+ $x = q("select * from chatroom where cr_id = %d and cr_uid = %d $sql_extra limit 1",
+ intval($room_id),
+ intval($a->profile['profile_uid'])
+ );
+ if($x) {
+ $room_name = $x[0]['cr_name'];
+ }
$o = replace_macros(get_markup_template('chat.tpl'),array(
- '$room_name' => '', // should we get this from the API?
+ '$room_name' => $room_name,
'$room_id' => $room_id,
- '$submit' => t('Submit')
+ '$baseurl' => z_root(),
+ '$nickname' => argv(1),
+ '$submit' => t('Submit'),
+ '$leave' => t('Leave Room'),
+ '$away' => t('I am away right now'),
+ '$online' => t('I am online')
+
));
return $o;
}