topic_setter should be stored as a Hostmask
This commit is contained in:
parent
7e67b07ada
commit
03892d0ae3
2 changed files with 4 additions and 10 deletions
|
@ -21,8 +21,7 @@ def handle_333(events, event):
|
||||||
topic_setter = utils.irc.seperate_hostmask(event["line"].args[2])
|
topic_setter = utils.irc.seperate_hostmask(event["line"].args[2])
|
||||||
topic_time = int(event["line"].args[3])
|
topic_time = int(event["line"].args[3])
|
||||||
|
|
||||||
channel.set_topic_setter(topic_setter.nickname, topic_setter.username,
|
channel.set_topic_setter(topic_setter)
|
||||||
topic_setter.hostname)
|
|
||||||
channel.set_topic_time(topic_time)
|
channel.set_topic_time(topic_time)
|
||||||
events.on("received.333").call(channel=channel,
|
events.on("received.333").call(channel=channel,
|
||||||
setter=topic_setter.nickname, set_at=topic_time, server=event["server"])
|
setter=topic_setter.nickname, set_at=topic_time, server=event["server"])
|
||||||
|
|
|
@ -14,9 +14,7 @@ class Channel(IRCObject.Object):
|
||||||
self.server = server
|
self.server = server
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.topic = ""
|
self.topic = ""
|
||||||
self.topic_setter_nickname = None # type: typing.Optional[str]
|
self.topic_setter = 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_time = 0
|
self.topic_time = 0
|
||||||
self.users = set([]) # type: typing.Set[IRCUser.User]
|
self.users = set([]) # type: typing.Set[IRCUser.User]
|
||||||
self.modes = {} # type: typing.Dict[str, typing.Set]
|
self.modes = {} # type: typing.Dict[str, typing.Set]
|
||||||
|
@ -33,11 +31,8 @@ class Channel(IRCObject.Object):
|
||||||
|
|
||||||
def set_topic(self, topic: str):
|
def set_topic(self, topic: str):
|
||||||
self.topic = topic
|
self.topic = topic
|
||||||
def set_topic_setter(self, nickname: str, username: str=None,
|
def set_topic_setter(self, hostmask: IRCLine.Hostmask):
|
||||||
hostname: str=None):
|
self.topic_setter = hostmask
|
||||||
self.topic_setter_nickname = nickname
|
|
||||||
self.topic_setter_username = username
|
|
||||||
self.topic_setter_hostname = hostname
|
|
||||||
def set_topic_time(self, unix_timestamp: int):
|
def set_topic_time(self, unix_timestamp: int):
|
||||||
self.topic_time = unix_timestamp
|
self.topic_time = unix_timestamp
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue