Move Channel.openSettings to GuildChannel.openSettings, rename defaultChannel to isDefaultChannel and add GroupChannel names

This commit is contained in:
Samuel Elliott 2018-04-30 19:14:34 +01:00
parent 85d5de9791
commit 6da58ef6bb
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
1 changed files with 11 additions and 10 deletions

View File

@ -131,15 +131,6 @@ export class Channel {
return DiscordApi.currentChannel === this;
}
/**
* Opens this channel's settings window.
* @param {String} section The section to open (see DiscordConstants.ChannelSettingsSections)
*/
openSettings(section = 'OVERVIEW') {
Modules.ChannelSettingsWindow.setSection(section);
Modules.ChannelSettingsWindow.open(this.id);
}
}
export class PermissionOverwrite {
@ -226,9 +217,18 @@ export class GuildChannel extends Channel {
/**
* Whether this channel is the guild's default channel.
*/
get defaultChannel() {
get isDefaultChannel() {
return Modules.GuildChannelsStore.getDefaultChannel(this.guildId).id === this.id;
}
/**
* Opens this channel's settings window.
* @param {String} section The section to open (see DiscordConstants.ChannelSettingsSections)
*/
openSettings(section = 'OVERVIEW') {
Modules.ChannelSettingsWindow.setSection(section);
Modules.ChannelSettingsWindow.open(this.id);
}
}
// Type 0 - GUILD_TEXT
@ -295,6 +295,7 @@ export class DirectMessageChannel extends PrivateChannel {
export class GroupChannel extends PrivateChannel {
get ownerId() { return this.discordObject.ownerId }
get type() { return 'GROUP_DM' }
get name() { return this.discordObject.name }
get icon() { return this.discordObject.icon }
/**