From ae1f0ed424ce9d8b90c9a698afba55a6041525bd Mon Sep 17 00:00:00 2001 From: adator <85586985+adator85@users.noreply.github.com> Date: Thu, 21 Aug 2025 01:38:23 +0200 Subject: [PATCH] Fix removing a user when he leave a channel --- core/base.py | 3 +-- core/classes/channel.py | 5 ++--- core/classes/protocols/unreal6.py | 5 +---- core/irc.py | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/core/base.py b/core/base.py index b13d361..012d0e9 100644 --- a/core/base.py +++ b/core/base.py @@ -508,12 +508,11 @@ class Base: """Methode qui supprime les timers qui ont finis leurs job """ try: - for timer in self.running_timers: if not timer.is_alive(): timer.cancel() self.running_timers.remove(timer) - self.logs.info(f"-- Timer {str(timer)} removed") + self.logs.debug(f"-- Timer {str(timer)} removed") else: self.logs.debug(f"--* Timer {str(timer)} Still running ...") diff --git a/core/classes/channel.py b/core/classes/channel.py index ff74229..a643501 100644 --- a/core/classes/channel.py +++ b/core/classes/channel.py @@ -83,7 +83,7 @@ class Channel: return True - def delete_user_from_channel(self, channel_name: str, uid:str) -> bool: + def delete_user_from_channel(self, channel_name: str, uid: str) -> bool: """Delete a user from a channel Args: @@ -95,8 +95,7 @@ class Channel: """ try: result = False - - chan_obj = self.get_channel(channel_name.lower()) + chan_obj = self.get_channel(channel_name) if chan_obj is None: return result diff --git a/core/classes/protocols/unreal6.py b/core/classes/protocols/unreal6.py index c1c785f..ddae34b 100644 --- a/core/classes/protocols/unreal6.py +++ b/core/classes/protocols/unreal6.py @@ -726,13 +726,10 @@ class Unrealircd6: serverMsg (list[str]): Original server message """ try: - # ['@unrealircd.org/geoip=FR;unrealircd.org/userhost=50d6492c@80.214.73.44;unrealircd.org/userip=50d6492c@80.214.73.44;msgid=YSIPB9q4PcRu0EVfC9ci7y-/mZT0+Gj5FLiDSZshH5NCw;time=2024-08-15T15:35:53.772Z', - # ':001EPFBRD', 'PART', '#welcome', ':WEB', 'IRC', 'Paris'] - + # ['@unrealircd.org', ':001EPFBRD', 'PART', '#welcome', ':WEB', 'IRC', 'Paris'] uid = str(serverMsg[1]).lstrip(':') channel = str(serverMsg[3]).lower() self.__Irc.Channel.delete_user_from_channel(channel, uid) - return None except IndexError as ie: diff --git a/core/irc.py b/core/irc.py index 94f5b91..1c9c451 100644 --- a/core/irc.py +++ b/core/irc.py @@ -897,7 +897,7 @@ class Irc: self.Protocol.on_squit(serverMsg=original_response) case 'PART': - self.Protocol.on_part(serverMsg=parsed_protocol) + self.Protocol.on_part(serverMsg=original_response) case 'VERSION': self.Protocol.on_version_msg(serverMsg=original_response)