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:
parent
ad00fdfa53
commit
f188b29911
@ -108,7 +108,7 @@ def showchan(irc, source, args):
|
|||||||
if c.topic:
|
if c.topic:
|
||||||
f('\x02Channel topic\x02: %s' % 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.
|
# 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))
|
f('\x02Channel creation time\x02: %s (%s)' % (ctime(c.ts), c.ts))
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ def rpm(irc, source, args):
|
|||||||
return
|
return
|
||||||
|
|
||||||
relay = world.plugins.get('relay')
|
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)
|
irc.error('This command is only supported on Clientbot networks. Try /msg %s <text>' % target)
|
||||||
return
|
return
|
||||||
elif relay is None:
|
elif relay is None:
|
||||||
|
@ -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
|
# This is a relay server - display the remote map of the network it represents
|
||||||
relay_server = serverlist[leaf].remote
|
relay_server = serverlist[leaf].remote
|
||||||
remoteirc = world.networkobjects[relay_server]
|
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.
|
# Only ever show relay subservers once - this prevents infinite loops.
|
||||||
showall(remoteirc, remoteirc.sid, hops=hops, is_relay_server=True)
|
showall(remoteirc, remoteirc.sid, hops=hops, is_relay_server=True)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user