fix(core): update
This commit is contained in:
@ -42,12 +42,12 @@ export class ClientUniverse {
|
||||
throw new Error('channel exists');
|
||||
}
|
||||
|
||||
const clientUniverseChannel = await ClientUniverseChannel.createClientUniverseChannel(
|
||||
// lets create the channel
|
||||
ClientUniverseChannel.createClientUniverseChannel(
|
||||
this,
|
||||
channelNameArg,
|
||||
passphraseArg
|
||||
);
|
||||
this.channelCache.add(clientUniverseChannel);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7,12 +7,19 @@ export class ClientUniverseChannel implements interfaces.IUniverseChannel {
|
||||
// ======
|
||||
// STATIC
|
||||
// ======
|
||||
/**
|
||||
* creates a channel and adds it to the cache of clientUniverseArg
|
||||
* @param clientUniverseArg
|
||||
* @param channelNameArg
|
||||
* @param passphraseArg
|
||||
*/
|
||||
public static async createClientUniverseChannel(
|
||||
clientUniverseArg: ClientUniverse,
|
||||
channelName: string,
|
||||
channelNameArg: string,
|
||||
passphraseArg: string
|
||||
): Promise<ClientUniverseChannel> {
|
||||
const clientChannel = new ClientUniverseChannel(clientUniverseArg, passphraseArg);
|
||||
const clientChannel = new ClientUniverseChannel(clientUniverseArg, channelNameArg, passphraseArg);
|
||||
clientUniverseArg.channelCache.add(clientChannel);
|
||||
await clientChannel.subscribe();
|
||||
return clientChannel;
|
||||
}
|
||||
|
@ -83,8 +83,8 @@ export class UniverseChannel {
|
||||
*/
|
||||
public authenticate(universeMessageArg: UniverseMessage): boolean {
|
||||
return (
|
||||
this.name === universeMessageArg.requestedChannelName &&
|
||||
this.passphrase === universeMessageArg.requestedChannelPassphrase
|
||||
this.name === universeMessageArg.targetChannelName &&
|
||||
this.passphrase === universeMessageArg.passphrase
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user