зеркало из https://github.com/nextcloud/spreed.git
Merge pull request #95 from nextcloud/leave-room
Add leave room functionality.
This commit is contained in:
Коммит
b4b238825b
|
@ -125,7 +125,18 @@
|
|||
console.log("share group", this.model.get('id'));
|
||||
},
|
||||
leaveGroup: function() {
|
||||
console.log("leave group", this.model.get('id'));
|
||||
//If user is in that room, it should leave that room first.
|
||||
if (this.model.get('active')) {
|
||||
OCA.SpreedMe.webrtc.leaveRoom();
|
||||
window.location.replace(window.location.href.slice(0, -window.location.hash.length));
|
||||
}
|
||||
|
||||
this.$el.slideUp();
|
||||
|
||||
$.ajax({
|
||||
url: OC.generateUrl('/apps/spreed/api/room/') + this.model.get('id'),
|
||||
type: 'DELETE'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ class Room {
|
|||
public function removeUser(IUser $user) {
|
||||
$query = $this->db->getQueryBuilder();
|
||||
$query->delete('spreedme_room_participants')
|
||||
->where($query->expr()->eq('id', $query->createNamedParameter($this->getId(), IQueryBuilder::PARAM_INT)))
|
||||
->where($query->expr()->eq('roomId', $query->createNamedParameter($this->getId(), IQueryBuilder::PARAM_INT)))
|
||||
->andWhere($query->expr()->eq('userId', $query->createNamedParameter($user->getUID())));
|
||||
$query->execute();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче