populate the channel model with only channels from the selected guild (if there is one)

This commit is contained in:
Adrian Edwards 2020-10-18 16:09:15 -07:00
parent 59d9b877c9
commit e145437c62

View file

@ -51,12 +51,19 @@ class TextSettingsWindow(SettingsWindow):
for guild in self.guild_list():
guild_id, guild_name = guild
self.channel_lookup.append('0')
c_model.append([guild_name, False])
self.guild_lookup.append(guild)
g_model.append([guild_name, True])
if self.guild == "0":
c_model.append([guild_name, False])
guilds_by_id = guild_id
else:
guilds_by_id = self.guild
for c in self.list_channels_keys:
chan = self.list_channels[c]
if chan['guild_id'] == guild_id:
if chan['guild_id'] == guilds_by_id:
c_model.append([chan["name"], True])
self.channel_lookup.append(c)