IRCServer should handle ping_sent, not IRCSocket

This commit is contained in:
jesopo 2019-02-11 21:23:52 +00:00
parent a8d9365442
commit b37a50ed7a
2 changed files with 5 additions and 2 deletions

View file

@ -230,7 +230,11 @@ class Server(IRCObject.Object):
return self.until_read_timeout == 0
def read(self) -> typing.Optional[typing.List[str]]:
return self.socket.read()
lines = self.socket.read()
if lines:
self.ping_sent = False
return lines
def send(self, line: str):
results = self.events.on("preprocess.send").call_unsafe(
server=self, line=line)

View file

@ -115,7 +115,6 @@ class Socket(IRCObject.Object):
decoded_lines.append(decoded_line)
self.last_read = time.monotonic()
self.ping_sent = False
return decoded_lines
def send(self, line: IRCLine.Line):