diff --git a/events/loginEvent.py b/events/loginEvent.py index 7115a52..f66db8e 100644 --- a/events/loginEvent.py +++ b/events/loginEvent.py @@ -117,7 +117,7 @@ def handle(tornadoRequest): # Output channels info for key, value in glob.channels.channels.items(): - if value.publicRead == True: + if value.publicRead == True and value.hidden == False: responseToken.enqueue(serverPackets.channelInfo(key)) # Send friends list diff --git a/objects/channel.py b/objects/channel.py index 70db719..b5289dc 100644 --- a/objects/channel.py +++ b/objects/channel.py @@ -3,16 +3,9 @@ from objects import glob class channel: """ A chat channel - - name -- channel name - description -- channel description - connectedUsers -- connected users IDs list - publicRead -- bool - publicWrite -- bool - moderated -- bool """ - def __init__(self, __name, __description, __publicRead, __publicWrite, temp): + def __init__(self, __name, __description, __publicRead, __publicWrite, temp, hidden): """ Create a new chat channel object @@ -20,7 +13,8 @@ class channel: __description -- channel description __publicRead -- bool, if true channel can be read by everyone, if false it can be read only by mods/admins __publicWrite -- bool, same as public read but relative to write permissions - temp -- if True, channel will be deleted when there's no one in the channel. Optional. Default = False. + temp -- if True, channel will be deleted when there's no one in the channel + hidden -- if True, channel won't be shown in channels list """ self.name = __name @@ -30,6 +24,7 @@ class channel: self.moderated = False self.temp = temp self.connectedUsers = [999] # Fokabot is always connected to every channels (otherwise it doesn't show up in IRC users list) + self.hidden = hidden # Client name (#spectator/#multiplayer) self.clientName = self.name diff --git a/objects/channelList.py b/objects/channelList.py index f6780a3..22b73a6 100644 --- a/objects/channelList.py +++ b/objects/channelList.py @@ -28,7 +28,7 @@ class channelList: self.addChannel(i["name"], i["description"], publicRead, publicWrite) - def addChannel(self, name, description, publicRead, publicWrite, temp = False): + def addChannel(self, name, description, publicRead, publicWrite, temp = False, hidden = False): """ Add a channel object to channels dictionary @@ -37,21 +37,23 @@ class channelList: publicRead -- bool, if true channel can be read by everyone, if false it can be read only by mods/admins publicWrite -- bool, same as public read but relative to write permissions temp -- if True, channel will be deleted when there's no one in the channel. Optional. Default = False. + hidden -- if True, channel will be hidden in channels list. Optional. Default = False. """ - self.channels[name] = channel.channel(name, description, publicRead, publicWrite, temp) + self.channels[name] = channel.channel(name, description, publicRead, publicWrite, temp, hidden) log.info("Created channel {}".format(name)) def addTempChannel(self, name): """ Add a temporary channel (like #spectator or #multiplayer), gets deleted when there's no one in the channel + and it's hidden in channels list name -- channel name return -- True if channel was created, False if failed """ if name in self.channels: return False - self.channels[name] = channel.channel(name, "Chat", True, True, True) + self.channels[name] = channel.channel(name, "Chat", True, True, True, True) log.info("Created temp channel {}".format(name)) def removeChannel(self, name): diff --git a/version b/version index 266146b..9edc58b 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.6.3 +1.6.4