added all tester

This commit is contained in:
arzynik 2014-11-06 14:53:44 -08:00
parent 3b30708502
commit cc7e2af850
2 changed files with 12 additions and 1 deletions

View File

@ -3,7 +3,10 @@ class Controller_test_chat extends Crunchbutton_Controller_Account {
public function init() {
$message = Support_Message::o(2913);
$res = Chat::emit(['room' => 'ticket.'.$message->id_support], 'ticket.message', $message->exports());
$res = Chat::emit([
'room' => 'ticket.'.$message->id_support,
'room' => 'ticket.all',
], 'ticket.message', $message->exports());
echo $res;
}

View File

@ -89,6 +89,10 @@ NGApp.factory('TicketViewService', function($rootScope, $resource, $routeParams,
console.debug('Connected to socket.io');
service.socket.emit('token', $.cookie('token'));
service.socket.emit('event.subscribe', 'ticket.' + service.scope.viewTicket);
if (AccountService.user.id_admin == 1) {
service.socket.emit('event.subscribe', 'ticket.all');
}
});
service.send = function(message) {
@ -143,6 +147,10 @@ NGApp.factory('TicketViewService', function($rootScope, $resource, $routeParams,
}
}, 5000);
};
service.socket.on('event.response', function(payload) {
console.debug('event response: ',payload);
});
service.socket.on('ticket.message', function(payload) {