3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-24 11:42:51 +01:00

Merge branch 'master' into devel

This commit is contained in:
James Lu 2016-06-20 16:38:33 -07:00
commit 0b9691c3c6
5 changed files with 31 additions and 8 deletions

View File

@ -27,6 +27,12 @@ You can also link remote channels to take a different name on your network. (Thi
Also, to list the available channels:
- `/msg PyLink linked`
To remove a relay channel that you've created:
- `/msg PyLink destroy #channelname`
To delink a channel linked to another network:
- `/msg PyLink delink #channelname`
### Claiming channels
PyLink offers channel claims similarly to Janus, except that it is on by default when you create a channel on any network. Unless the claimed network list of a channel is EMPTY, oper override (MODE, KICK, TOPIC) will only be allowed from networks on that list.

View File

@ -45,7 +45,7 @@ oplevel_upass,,,,,,U
opmoderated,U (extras/m_opmoderated),z,z,,,
owner,q (m_customprefix/m_chanprotect),,y (when enabled),q,,
permanent,P (m_permchannels),P,P,P,,z
private,p,p,p,p,,p
private,p,,,p,,p
quiet,,q,q,,,
redirect,L (m_redirect),f,f,L,,L
registered,r (m_services_account),,,r,r,R

1 Channel Mode / IRCd InspIRCd charybdis Elemental-IRCd UnrealIRCd IRCd-Hybrid Nefarious IRCu
45 opmoderated U (extras/m_opmoderated) z z
46 owner q (m_customprefix/m_chanprotect) y (when enabled) q
47 permanent P (m_permchannels) P P P z
48 private p p p p p
49 quiet q q
50 redirect L (m_redirect) f f L L
51 registered r (m_services_account) r r R

View File

@ -103,17 +103,22 @@ def normalizeNick(irc, netname, nick, separator=None, uid=''):
orig_nick = nick
protoname = irc.protoname
maxnicklen = irc.maxnicklen
if '/' not in separator or not protoname.startswith(('insp', 'unreal')):
# Charybdis doesn't allow / in usernames, and will SQUIT with
# a protocol violation if it sees one.
# Charybdis, IRCu, etc. don't allow / in nicks, and will SQUIT with a protocol
# violation if it sees one. Or it might just ignore the client introduction and
# cause bad desyncs.
protocol_allows_slashes = protoname.startswith(('insp', 'unreal')) or \
irc.serverdata.get('relay_force_slashes')
if '/' not in separator or not protocol_allows_slashes:
separator = separator.replace('/', '|')
nick = nick.replace('/', '|')
if nick.startswith(tuple(string.digits)):
# On TS6 IRCds, nicks that start with 0-9 are only allowed if
# they match the UID of the originating server. Otherwise, you'll
# get nasty protocol violation SQUITs!
nick = '_' + nick
tagnicks = True
suffix = separator + netname
nick = nick[:maxnicklen]
@ -1390,7 +1395,8 @@ def destroy(irc, source, args):
channel, irc.getHostmask(source))
irc.reply('Done.')
else:
irc.reply('Error: No such relay %r exists.' % channel)
irc.reply("Error: No such channel %r exists. If you're trying to delink a channel from "
"another network, use the DESTROY command." % channel)
return
@utils.add_cmd
@ -1405,25 +1411,36 @@ def link(irc, source, args):
except IndexError:
irc.reply("Error: Not enough arguments. Needs 2-3: remote netname, channel, local channel name (optional).")
return
try:
localchan = irc.toLower(args[2])
except IndexError:
localchan = channel
for c in (channel, localchan):
if not utils.isChannel(c):
irc.reply('Error: Invalid channel %r.' % c)
return
if remotenet == irc.name:
irc.reply('Error: Cannot link two channels on the same network.')
return
if source not in irc.channels[localchan].users:
irc.reply('Error: You must be in %r to complete this operation.' % localchan)
return
irc.checkAuthenticated(source)
if remotenet not in world.networkobjects:
irc.reply('Error: No network named %r exists.' % remotenet)
return
localentry = getRelay((irc.name, localchan))
if localentry:
irc.reply('Error: Channel %r is already part of a relay.' % localchan)
return
try:
entry = db[(remotenet, channel)]
except KeyError:

View File

@ -259,7 +259,7 @@ class TS6Protocol(TS6BaseProtocol):
chary_cmodes = { # TS6 generic modes (note that +p is noknock instead of private):
'op': 'o', 'voice': 'v', 'ban': 'b', 'key': 'k', 'limit':
'l', 'moderated': 'm', 'noextmsg': 'n', 'noknock': 'p',
'secret': 's', 'topiclock': 't',
'secret': 's', 'topiclock': 't', 'inviteonly': 'i',
# charybdis-specific modes:
'quiet': 'q', 'redirect': 'f', 'freetarget': 'F',
'joinflood': 'j', 'largebanlist': 'L', 'permanent': 'P',

View File

@ -482,7 +482,7 @@ class UnrealProtocol(TS6BaseProtocol):
'nokick': 'Q', 'private': 'p', 'stripcolor': 'S', 'key': 'k',
'op': 'o', 'voice': 'v', 'regonly': 'R', 'noinvite': 'V',
'banexception': 'e', 'nonick': 'N', 'issecure': 'Z', 'topiclock': 't',
'nonotice': 'T', 'delayjoin': 'D'}
'nonotice': 'T', 'delayjoin': 'D', 'inviteonly': 'i'}
# Make a list of all our capability names.
self.caps += [arg.split('=')[0] for arg in args]