diff --git a/modules/line_handler/channel.py b/modules/line_handler/channel.py index 2521beed..1c571ce4 100644 --- a/modules/line_handler/channel.py +++ b/modules/line_handler/channel.py @@ -21,8 +21,7 @@ def handle_333(events, event): topic_setter = utils.irc.seperate_hostmask(event["line"].args[2]) topic_time = int(event["line"].args[3]) - channel.set_topic_setter(topic_setter.nickname, topic_setter.username, - topic_setter.hostname) + channel.set_topic_setter(topic_setter) channel.set_topic_time(topic_time) events.on("received.333").call(channel=channel, setter=topic_setter.nickname, set_at=topic_time, server=event["server"]) diff --git a/src/IRCChannel.py b/src/IRCChannel.py index ddce0291..0f58af0e 100644 --- a/src/IRCChannel.py +++ b/src/IRCChannel.py @@ -14,9 +14,7 @@ class Channel(IRCObject.Object): self.server = server self.bot = bot self.topic = "" - self.topic_setter_nickname = None # type: typing.Optional[str] - self.topic_setter_username = None # type: typing.Optional[str] - self.topic_setter_hostname = None # type: typing.Optional[str] + self.topic_setter = None # type: typing.Optional[str] self.topic_time = 0 self.users = set([]) # type: typing.Set[IRCUser.User] self.modes = {} # type: typing.Dict[str, typing.Set] @@ -33,11 +31,8 @@ class Channel(IRCObject.Object): def set_topic(self, topic: str): self.topic = topic - def set_topic_setter(self, nickname: str, username: str=None, - hostname: str=None): - self.topic_setter_nickname = nickname - self.topic_setter_username = username - self.topic_setter_hostname = hostname + def set_topic_setter(self, hostmask: IRCLine.Hostmask): + self.topic_setter = hostmask def set_topic_time(self, unix_timestamp: int): self.topic_time = unix_timestamp