mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-27 21:19:31 +01:00
Merge branch 'master' into devel
Conflicts: plugins/networks.py
This commit is contained in:
commit
8969cfb74e
@ -1,7 +1,7 @@
|
|||||||
"""Networks plugin - allows you to manipulate connections to various configured networks."""
|
"""Networks plugin - allows you to manipulate connections to various configured networks."""
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from pylinkirc import utils, world
|
from pylinkirc import utils, world, conf, classes
|
||||||
from pylinkirc.log import log
|
from pylinkirc.log import log
|
||||||
|
|
||||||
@utils.add_cmd
|
@utils.add_cmd
|
||||||
@ -45,15 +45,9 @@ def connect(irc, source, args):
|
|||||||
return
|
return
|
||||||
if network.connection_thread.is_alive():
|
if network.connection_thread.is_alive():
|
||||||
irc.reply('Error: Network "%s" seems to be already connected.' % netname)
|
irc.reply('Error: Network "%s" seems to be already connected.' % netname)
|
||||||
else: # Reconnect the network!
|
else: # Recreate the IRC object.
|
||||||
network.connection_thread = threading.Thread(target=network.connect)
|
proto = utils.getProtocolModule(network.serverdata.get("protocol"))
|
||||||
network.connection_thread.start()
|
world.networkobjects[netname] = classes.Irc(netname, proto, conf.conf)
|
||||||
|
|
||||||
# And the plugins we have too.
|
|
||||||
for plugin in world.plugins.values():
|
|
||||||
if hasattr(plugin, 'main'):
|
|
||||||
log.debug('(%s) Calling main() function of plugin %r', irc.name, plugin)
|
|
||||||
plugin.main(irc)
|
|
||||||
|
|
||||||
irc.reply("Done.")
|
irc.reply("Done.")
|
||||||
|
|
||||||
|
@ -1127,7 +1127,8 @@ def handle_mode(irc, numeric, command, args):
|
|||||||
reversed_modes = irc.reverseModes(target, modes, oldobj=oldchan)
|
reversed_modes = irc.reverseModes(target, modes, oldobj=oldchan)
|
||||||
log.debug('(%s) relay.handle_mode: Reversing mode changes of %r with %r (CLAIM).',
|
log.debug('(%s) relay.handle_mode: Reversing mode changes of %r with %r (CLAIM).',
|
||||||
irc.name, modes, reversed_modes)
|
irc.name, modes, reversed_modes)
|
||||||
irc.proto.mode(irc.sid, target, reversed_modes)
|
if reversed_modes:
|
||||||
|
irc.proto.mode(irc.sid, target, reversed_modes)
|
||||||
break
|
break
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -627,7 +627,11 @@ class TS6Protocol(TS6BaseProtocol):
|
|||||||
Note: The core of WHOIS handling is done by coreplugin.py
|
Note: The core of WHOIS handling is done by coreplugin.py
|
||||||
(IRCd-independent), and not here."""
|
(IRCd-independent), and not here."""
|
||||||
# <- :42XAAAAAB WHOIS 5PYAAAAAA :pylink-devel
|
# <- :42XAAAAAB WHOIS 5PYAAAAAA :pylink-devel
|
||||||
return {'target': args[0]}
|
# First argument is the server that should reply to the WHOIS request
|
||||||
|
# or the server hosting the UID given. We can safely assume that any
|
||||||
|
# WHOIS commands received are for US, since we can't host any servers
|
||||||
|
# behind us to route it to.
|
||||||
|
return {'target': self.irc.nickToUid(args[-1])}
|
||||||
|
|
||||||
def handle_472(self, numeric, command, args):
|
def handle_472(self, numeric, command, args):
|
||||||
"""Handles the incoming 472 numeric.
|
"""Handles the incoming 472 numeric.
|
||||||
|
Loading…
Reference in New Issue
Block a user