fix(core): update

This commit is contained in:
2019-04-22 23:11:51 +02:00
parent 241182ed2e
commit 30a02ae48b
4 changed files with 19 additions and 12 deletions

View File

@ -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);
}
/**

View File

@ -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;
}

View File

@ -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
);
}