status indication

This commit is contained in:
friendica 2014-02-01 01:00:26 -08:00
parent d14afc0ee4
commit 94e59d4770
2 changed files with 12 additions and 2 deletions

View File

@ -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);
}
}

View File

@ -66,7 +66,7 @@ function update_inroom(inroom) {
var count = inroom.length;
$.each( inroom, function(index, item) {
var newNode = document.createElement('div');
$(newNode).html('<img style="height: 32px; width: 32px;" src="' + item.img + '" alt="' + item.name + '" /><br />' + item.name + '<br/>');
$(newNode).html('<img style="height: 32px; width: 32px;" src="' + item.img + '" alt="' + item.name + '" /> ' + item.status + '<br />' + item.name + '<br/>');
html.appendChild(newNode);
});
$('#chatUsers').html(html);