From f188b299119fba911b31e8ee77195b8cd6be98df Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 23 Mar 2017 23:37:24 -0700 Subject: [PATCH] plugins: migrate to server capabilities --- plugins/commands.py | 2 +- plugins/relay_clientbot.py | 2 +- plugins/servermaps.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/commands.py b/plugins/commands.py index 7d53fa3..654c5b3 100644 --- a/plugins/commands.py +++ b/plugins/commands.py @@ -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)) diff --git a/plugins/relay_clientbot.py b/plugins/relay_clientbot.py index 7e78f23..8a300d6 100644 --- a/plugins/relay_clientbot.py +++ b/plugins/relay_clientbot.py @@ -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 ' % target) return elif relay is None: diff --git a/plugins/servermaps.py b/plugins/servermaps.py index e9f9420..42fab69 100644 --- a/plugins/servermaps.py +++ b/plugins/servermaps.py @@ -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)