diff --git a/app/widgets/Notifs/Notifs.php b/app/widgets/Notifs/Notifs.php index 2de23c833..34912300a 100755 --- a/app/widgets/Notifs/Notifs.php +++ b/app/widgets/Notifs/Notifs.php @@ -29,17 +29,10 @@ class Notifs extends WidgetCommon $this->addcss('notifs.css'); $this->addjs('notifs.js'); - /* TODO remove Moxl Notification (inbox) actions - $this->registerEvent('notification', 'onNotification'); - $this->registerEvent('notificationdelete', 'onNotificationDelete'); - $this->registerEvent('notifications', 'displayNotifications'); - $this->registerEvent('nonotification', 'onNoNotification');*/ - $this->registerEvent('subscribe', 'onNotifs'); $this->registerEvent('roster_additem_handle', 'onNotifs'); $this->registerEvent('presence_subscribe_handle', 'onNotifs'); $this->registerEvent('presence_subscribed_handle', 'onNotifs'); - //$this->registerEvent('presence_unsubscribed_handle', 'onNotifs'); } function onNotifs($packet = false) diff --git a/app/widgets/Rooms/Rooms.php b/app/widgets/Rooms/Rooms.php index b5fb20455..3fcfce8b0 100644 --- a/app/widgets/Rooms/Rooms.php +++ b/app/widgets/Rooms/Rooms.php @@ -93,12 +93,14 @@ class Rooms extends WidgetCommon /** * @brief Join a chatroom */ - function ajaxJoin($jid, $nickname) + function ajaxJoin($jid, $nickname = false) { $p = new Muc; - $p->setTo($jid) - ->setNickname($nickname) - ->request(); + $p->setTo($jid); + + if($nickname != false) $p->setNickname($nickname); + + $p->request(); } /** @@ -176,6 +178,24 @@ class Rooms extends WidgetCommon ->request(); } + function checkConnected($room, $resource = false) + { + $pd = new \modl\PresenceDAO(); + + if($resource == false) { + $session = \Sessionx::start(); + $resource = $session->user; + } + + $presence = $pd->getPresence($room, $resource); + + if($presence != null) { + return true; + } else { + return false; + } + } + function prepareRooms() { $view = $this->tpl(); diff --git a/app/widgets/Rooms/_rooms.tpl b/app/widgets/Rooms/_rooms.tpl index 95de4472b..602d6e053 100644 --- a/app/widgets/Rooms/_rooms.tpl +++ b/app/widgets/Rooms/_rooms.tpl @@ -3,10 +3,11 @@ {$c->__('chatrooms.title')} {loop="$conferences"} + {$connected = $c->checkConnected($value->conference, $value->nick)}
  • status == 1"}online{/if}"> - {if="$value->status == 1"} + {if="$value->nick != null"} data-nick="{$value->nick}" {/if} + class="room {if="$connected"}online{/if}"> + {if="$connected"} {else} diff --git a/app/widgets/Rooms/_rooms_list.tpl b/app/widgets/Rooms/_rooms_list.tpl index 0b95ad505..263b861e4 100644 --- a/app/widgets/Rooms/_rooms_list.tpl +++ b/app/widgets/Rooms/_rooms_list.tpl @@ -1,10 +1,10 @@

    {$c->__('chatrooms.users')}


    -