track all channel list modes, not just ban and maybe quiet
This commit is contained in:
parent
5258b8cc8f
commit
897c6df794
1 changed files with 13 additions and 10 deletions
|
@ -398,10 +398,8 @@ class Module(ModuleManager.BaseModule):
|
||||||
|
|
||||||
@utils.hook("new.channel")
|
@utils.hook("new.channel")
|
||||||
def new_channel_lists(self, event):
|
def new_channel_lists(self, event):
|
||||||
event["channel"].mode_lists = {"b": []}
|
event["channel"].mode_lists = {
|
||||||
quiet = self._quiet_method(event["server"])
|
m: [] for m in event["server"].channel_list_modes}
|
||||||
if quiet and not quiet[0] == "b":
|
|
||||||
event["channel"].mode_lists[quiet[0]] = []
|
|
||||||
|
|
||||||
# RPL_BANLIST
|
# RPL_BANLIST
|
||||||
@utils.hook("received.367")
|
@utils.hook("received.367")
|
||||||
|
@ -434,12 +432,17 @@ class Module(ModuleManager.BaseModule):
|
||||||
temp_key = "~%s" % mode
|
temp_key = "~%s" % mode
|
||||||
channel.mode_lists[mode] = channel.mode_lists.pop(temp_key, [])
|
channel.mode_lists[mode] = channel.mode_lists.pop(temp_key, [])
|
||||||
|
|
||||||
|
@utils.hook("received.mode.channel")
|
||||||
|
def channel_mode_lists(self, event):
|
||||||
|
for mode, arg in event["modes"]:
|
||||||
|
if mode[1] in event["server"].channel_list_modes:
|
||||||
|
if mode[0] == "+":
|
||||||
|
event["channel"].mode_lists[mode[1]].add(arg)
|
||||||
|
else:
|
||||||
|
event["channel"].mode_lists[mode[1]].discard(arg)
|
||||||
|
|
||||||
@utils.hook("self.join")
|
@utils.hook("self.join")
|
||||||
def self_join(self, event):
|
def self_join(self, event):
|
||||||
list_modes = ["b"]
|
event["channel"].send_mode("+%s" %
|
||||||
|
"".join(event["server"].channel_list_modes))
|
||||||
|
|
||||||
quiet = self._quiet_method(event["server"])
|
|
||||||
if quiet and not quiet[0] == "b":
|
|
||||||
list_modes.append(quiet[0])
|
|
||||||
|
|
||||||
event["channel"].send_mode("+%s" % "".join(list_modes))
|
|
||||||
|
|
Loading…
Reference in a new issue