mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 06:49:24 +01:00
Added RFE #1031748, optional password for Network.connect.
This commit is contained in:
parent
b8f2e97237
commit
20924ed87e
@ -62,12 +62,13 @@ class Network(callbacks.Privmsg):
|
||||
raise callbacks.Error, \
|
||||
'I\'m not currently connected to %s.' % network
|
||||
|
||||
def connect(self, irc, msg, args, network, server):
|
||||
"""<network> [<host[:port]>]
|
||||
def connect(self, irc, msg, args, network, server, password):
|
||||
"""<network> [<host[:port]>] [<password>]
|
||||
|
||||
Connects to another network (which will be represented by the name
|
||||
provided in <network>) at <host:port>. If port is not provided, it
|
||||
defaults to 6667, the default port for IRC.
|
||||
defaults to 6667, the default port for IRC. If password is
|
||||
provided, it will be sent to the server in a PASS command.
|
||||
"""
|
||||
try:
|
||||
otherIrc = self._getIrc(network)
|
||||
@ -93,7 +94,8 @@ class Network(callbacks.Privmsg):
|
||||
conf.supybot.networks().add(network)
|
||||
assert newIrc.callbacks is irc.callbacks, 'callbacks list is different'
|
||||
irc.replySuccess('Connection to %s initiated.' % network)
|
||||
connect = wrap(connect, ['owner', 'something', additional('something')])
|
||||
connect = wrap(connect, ['owner', 'something', additional('something'),
|
||||
additional('something', '')])
|
||||
|
||||
def disconnect(self, irc, msg, args, otherIrc, quitMsg):
|
||||
"""[<network>] [<quit message>]
|
||||
|
@ -286,7 +286,7 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
||||
callbacks.Privmsg._mores.clear()
|
||||
self.__parent.reset()
|
||||
|
||||
def _connect(self, network, serverPort=None):
|
||||
def _connect(self, network, serverPort=None, password=''):
|
||||
try:
|
||||
group = conf.supybot.networks.get(network)
|
||||
(server, port) = group.servers()[0]
|
||||
@ -294,7 +294,7 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
||||
if serverPort is None:
|
||||
raise ValueError, 'connect requires a (server, port) ' \
|
||||
'if the network is not registered.'
|
||||
conf.registerNetwork(network)
|
||||
conf.registerNetwork(network, password)
|
||||
serverS = '%s:%s' % serverPort
|
||||
conf.supybot.networks.get(network).servers.append(serverS)
|
||||
assert conf.supybot.networks.get(network).servers()
|
||||
|
Loading…
Reference in New Issue
Block a user