aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/chat.php9
-rw-r--r--mod/chatsvc.php12
-rw-r--r--mod/sources.php7
3 files changed, 26 insertions, 2 deletions
diff --git a/mod/chat.php b/mod/chat.php
index 54fa58092..612878cb2 100644
--- a/mod/chat.php
+++ b/mod/chat.php
@@ -101,8 +101,15 @@ 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')
));
diff --git a/mod/chatsvc.php b/mod/chatsvc.php
index f32ea56ce..0a69834f0 100644
--- a/mod/chatsvc.php
+++ b/mod/chatsvc.php
@@ -85,7 +85,17 @@ function chatsvc_content(&$a) {
);
if($r) {
foreach($r as $rr) {
- $inroom[] = array('img' => zid($rr['xchan_photo_m']), 'img_type' => $rr['xchan_photo_mimetype'],'name' => $rr['xchan_name']);
+ switch($rr['cp_status']) {
+ case 'away':
+ $status = t('Away');
+ break;
+ case 'online':
+ default:
+ $status = t('Online');
+ break;
+ }
+
+ $inroom[] = array('img' => zid($rr['xchan_photo_m']), 'img_type' => $rr['xchan_photo_mimetype'],'name' => $rr['xchan_name'], status => $status);
}
}
diff --git a/mod/sources.php b/mod/sources.php
index 87bab60df..f4b36508f 100644
--- a/mod/sources.php
+++ b/mod/sources.php
@@ -12,9 +12,13 @@ function sources_post(&$a) {
$abook = intval($_REQUEST['abook']);
$words = $_REQUEST['words'];
$frequency = $_REQUEST['frequency'];
+ $name = $_REQUEST['name'];
$channel = $a->get_channel();
+ if($name == '*')
+ $xchan = '*';
+
if($abook) {
$r = q("select abook_xchan from abook where abook_id = %d and abook_channel = %d limit 1",
intval($abook),
@@ -74,6 +78,9 @@ function sources_content(&$a) {
);
if($r) {
for($x = 0; $x < count($r); $x ++) {
+ if($r[$x]['src_xchan'] == '*') {
+ $r[$x]['xchan_name'] = t('*');
+ }
$r[$x]['src_patt'] = htmlspecialchars($r[$x]['src_patt'], ENT_COMPAT,'UTF-8');
}
}