remove try-rejoin (on 477) logic. will move to a module later

This commit is contained in:
jesopo 2019-09-07 15:21:35 +01:00
parent 4c2c4a501c
commit dadefeb8f3
3 changed files with 2 additions and 20 deletions

View file

@ -247,11 +247,7 @@ class Module(ModuleManager.BaseModule):
# we need a registered nickname for this channel
@utils.hook("raw.received.477", default_event=True)
def handle_477(self, event):
channel_name = event["server"].irc_lower(event["line"].args[1])
if not channel_name in event["server"].channels:
key = event["server"].attempted_join[channel_name]
self.timers.add("rejoin", 5, channel_name=channe_name, key=key,
server_id=event["server"].id)
channel.handle_477(self.timers, event)
# someone's been kicked from a channel
@utils.hook("raw.received.kick")

View file

@ -90,8 +90,6 @@ def join(events, event):
user.join_channel(channel)
if is_self:
if channel.name in event["server"].attempted_join:
del event["server"].attempted_join[channel.name]
events.on("self.join").call(channel=channel, server=event["server"],
account=account, realname=realname)
channel.send_mode()
@ -132,11 +130,7 @@ def handle_329(event):
channel.creation_timestamp = int(event["line"].args[2])
def handle_477(timers, event):
channel_name = event["server"].irc_lower(event["line"].args[1])
if channel_name in event["server"].channels:
key = event["server"].attempted_join[channel_name]
timers.add("rejoin", 5, channel_name=channe_name, key=key,
server_id=event["server"].id)
pass
def kick(events, event):
user = event["server"].get_user(event["line"].source.nickname)

View file

@ -65,13 +65,9 @@ class Server(IRCObject.Object):
self.motd_lines = [] # type: typing.List[str]
self.motd_done = False
self.attempted_join = {} # type: typing.Dict[str, typing.Optional[str]]
self.ping_sent = False
self.send_enabled = True
self.events.on("timer.rejoin").hook(self.try_rejoin)
def __repr__(self) -> str:
return "IRCServer.Server(%s)" % self.__str__()
def __str__(self) -> str:
@ -342,10 +338,6 @@ class Server(IRCObject.Object):
def send_pong(self, nonce: str) -> typing.Optional[IRCLine.SentLine]:
return self.send(utils.irc.protocol.pong(nonce), immediate=True)
def try_rejoin(self, event: EventManager.Event):
if event["server_id"] == self.id and event["channel_name"
] in self.attempted_join:
self.send_join(event["channel_name"], [event["key"]])
def send_join(self, channel_name: str, keys: typing.List[str]=None
) -> typing.Optional[IRCLine.SentLine]:
return self.send(utils.irc.protocol.join(channel_name, keys))