3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 14:49:28 +01:00

plugins: migrate to server capabilities

This commit is contained in:
James Lu 2017-03-23 23:37:24 -07:00
parent ad00fdfa53
commit f188b29911
3 changed files with 3 additions and 3 deletions

View File

@ -108,7 +108,7 @@ def showchan(irc, source, args):
if c.topic:
f('\x02Channel topic\x02: %s' % c.topic)
if irc.protoname != 'clientbot':
if irc.proto.hasCap('has-ts'):
# Clientbot-specific hack: don't show channel TS because it's not properly tracked.
f('\x02Channel creation time\x02: %s (%s)' % (ctime(c.ts), c.ts))

View File

@ -204,7 +204,7 @@ def rpm(irc, source, args):
return
relay = world.plugins.get('relay')
if irc.protoname != 'clientbot':
if irc.proto.hasCap('can-spawn-clients'):
irc.error('This command is only supported on Clientbot networks. Try /msg %s <text>' % target)
return
elif relay is None:

View File

@ -78,7 +78,7 @@ def _map(irc, source, args, show_relay=True):
# This is a relay server - display the remote map of the network it represents
relay_server = serverlist[leaf].remote
remoteirc = world.networkobjects[relay_server]
if remoteirc.protoname != 'clientbot':
if remoteirc.proto.hasCap('can-track-servers'):
# Only ever show relay subservers once - this prevents infinite loops.
showall(remoteirc, remoteirc.sid, hops=hops, is_relay_server=True)