added all tester
This commit is contained in:
parent
3b30708502
commit
cc7e2af850
@ -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;
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user