3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-24 11:42:51 +01:00

inspircd: implement /ALLTIME support (#228)

This commit is contained in:
James Lu 2016-08-12 19:36:40 -07:00
parent 94aee8f05c
commit c20dd07a2d

View File

@ -811,4 +811,13 @@ class InspIRCdProtocol(TS6BaseProtocol):
self.kick(server, channel, target, reason)
return {'channel': channel, 'target': target, 'text': reason}
def handle_alltime(self, source, command, args):
"""Handles /ALLTIME requests."""
# -> :9PYAAAAAA ENCAP * ALLTIME
# <- :70M PUSH 0ALAAAAAC ::midnight.vpn NOTICE PyLink-devel :System time is 2016-08-13 02:23:06 (1471054986) on midnight.vpn
# XXX: We override notice() here because that abstraction doesn't allow messages from servers.
timestring = '%s (%s)' % (time.strftime('%Y-%m-%d %H:%M:%S'), int(time.time()))
self._send(self.irc.sid, 'NOTICE %s :System time is %s on %s' % (source, timestring, self.irc.hostname()))
Class = InspIRCdProtocol