mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
limit rtc to parties
This commit is contained in:
@@ -58,8 +58,6 @@ angular.module('habitrpg')
|
|||||||
api.socketId = api.pusher.connection.socket_id;
|
api.socketId = api.pusher.connection.socket_id;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!partyId) return;
|
|
||||||
|
|
||||||
var partyChannelName = 'presence-group-' + partyId;
|
var partyChannelName = 'presence-group-' + partyId;
|
||||||
var partyChannel = api.pusher.subscribe(partyChannelName);
|
var partyChannel = api.pusher.subscribe(partyChannelName);
|
||||||
|
|
||||||
@@ -132,7 +130,7 @@ angular.module('habitrpg')
|
|||||||
|
|
||||||
// Connect the user to Pusher and to the party's chat channel
|
// Connect the user to Pusher and to the party's chat channel
|
||||||
partyId = user && $rootScope.user.party && $rootScope.user.party._id;
|
partyId = user && $rootScope.user.party && $rootScope.user.party._id;
|
||||||
// if (!partyId) return;
|
if (!partyId) return;
|
||||||
|
|
||||||
// See if another tab is already connected to Pusher
|
// See if another tab is already connected to Pusher
|
||||||
if (!localStorage.getItem(tabIdKey)) {
|
if (!localStorage.getItem(tabIdKey)) {
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ api.pusherAuth = {
|
|||||||
// Channel names are in the form of {presence|private}-{group|...}-{resourceId}
|
// Channel names are in the form of {presence|private}-{group|...}-{resourceId}
|
||||||
let [channelType, resourceType, ...resourceId] = channelName.split('-');
|
let [channelType, resourceType, ...resourceId] = channelName.split('-');
|
||||||
|
|
||||||
if (['presence'].indexOf(channelType) === -1) { // presence is used only for parties, private for guilds too
|
if (['presence'].indexOf(channelType) === -1) { // presence is used only for parties, private for guilds
|
||||||
throw new BadRequest('Invalid Pusher channel type.');
|
throw new BadRequest('Invalid Pusher channel type.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user