aboutsummaryrefslogtreecommitdiffstats
path: root/mod/chat.php
diff options
context:
space:
mode:
authormarijus <mario@localhost.localdomain>2014-02-05 14:48:42 +0100
committermarijus <mario@localhost.localdomain>2014-02-05 14:48:42 +0100
commit419e3b5024efec40c98e48c3bf213c4e60d39fae (patch)
treed3754aa1d251308eb6178fe4ab138463ceaaf135 /mod/chat.php
parentd7d2fff24b05bcb3ff3acc215e99f8f7d33d058d (diff)
parent0844110f7b154a0fb5102362fe732c2b091222d7 (diff)
downloadvolse-hubzilla-419e3b5024efec40c98e48c3bf213c4e60d39fae.tar.gz
volse-hubzilla-419e3b5024efec40c98e48c3bf213c4e60d39fae.tar.bz2
volse-hubzilla-419e3b5024efec40c98e48c3bf213c4e60d39fae.zip
Merge branch 'master' of https://github.com/friendica/red into upstream
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;
}