зеркало из https://github.com/nextcloud/spreed.git
Merge pull request #107 from nextcloud/fix_logerrors
Make sure there are no undefined index warnings
This commit is contained in:
Коммит
426228d5c1
|
@ -9,10 +9,12 @@ var sessionId = '';
|
|||
on: function(ev, fn) {
|
||||
var self = this;
|
||||
|
||||
var message = [{ev: ev}];
|
||||
$.post(OC.generateUrl('/apps/spreed/signalling'), {messages: JSON.stringify(message)}, function(data) {
|
||||
self.emit(fn, data);
|
||||
});
|
||||
if (ev !== 'message') {
|
||||
var message = [{ev: ev}];
|
||||
$.post(OC.generateUrl('/apps/spreed/signalling'), {messages: JSON.stringify(message)}, function (data) {
|
||||
self.emit(fn, data);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
emit: function(fn, data) {
|
||||
|
|
|
@ -69,9 +69,9 @@ class SignallingController extends Controller {
|
|||
$messages = json_decode($messages, true);
|
||||
foreach($messages as $message) {
|
||||
$ev = $message['ev'];
|
||||
$fn = $message['fn'];
|
||||
switch ($ev) {
|
||||
case 'message':
|
||||
$fn = $message['fn'];
|
||||
if (!is_string($fn)) {
|
||||
break;
|
||||
}
|
||||
|
@ -127,6 +127,12 @@ class SignallingController extends Controller {
|
|||
->execute()
|
||||
->fetchAll();
|
||||
|
||||
if ($currentRoom === []) {
|
||||
$eventSource->send('usersInRoom', []);
|
||||
sleep(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Send list to client of connected users in the current room
|
||||
$qb = $this->dbConnection->getQueryBuilder();
|
||||
$usersInRoom = $qb->select('*')
|
||||
|
|
Загрузка…
Ссылка в новой задаче