mirror of
https://github.com/jlu5/PyLink.git
synced 2025-04-01 13:27:05 +02:00
protocols: remove direct usage of to_lower() for channels
Not needed as of 32249ace3e579d8dc938a359cb5c7c4019abc31b (ref #372)
This commit is contained in:
parent
c9c0e0a85b
commit
07fa53d128
@ -142,7 +142,6 @@ class ClientbotWrapperProtocol(IRCCommonProtocol):
|
|||||||
|
|
||||||
def join(self, client, channel):
|
def join(self, client, channel):
|
||||||
"""STUB: Joins a user to a channel."""
|
"""STUB: Joins a user to a channel."""
|
||||||
channel = self.to_lower(channel)
|
|
||||||
|
|
||||||
# Only joins for the main PyLink client are actually forwarded. Others are ignored.
|
# Only joins for the main PyLink client are actually forwarded. Others are ignored.
|
||||||
# Note: we do not automatically add our main client to the channel state, as we
|
# Note: we do not automatically add our main client to the channel state, as we
|
||||||
|
@ -76,7 +76,6 @@ class InspIRCdProtocol(TS6BaseProtocol):
|
|||||||
# InspIRCd doesn't distinguish between burst joins and regular joins,
|
# InspIRCd doesn't distinguish between burst joins and regular joins,
|
||||||
# so what we're actually doing here is sending FJOIN from the server,
|
# so what we're actually doing here is sending FJOIN from the server,
|
||||||
# on behalf of the clients that are joining.
|
# on behalf of the clients that are joining.
|
||||||
channel = self.to_lower(channel)
|
|
||||||
|
|
||||||
server = self.get_server(client)
|
server = self.get_server(client)
|
||||||
if not self.is_internal_server(server):
|
if not self.is_internal_server(server):
|
||||||
@ -102,7 +101,6 @@ class InspIRCdProtocol(TS6BaseProtocol):
|
|||||||
sjoin('100', '#test', [('', '100AAABBC'), ('qo', 100AAABBB'), ('h', '100AAADDD')])
|
sjoin('100', '#test', [('', '100AAABBC'), ('qo', 100AAABBB'), ('h', '100AAADDD')])
|
||||||
sjoin(self.sid, '#test', [('o', self.pseudoclient.uid)])
|
sjoin(self.sid, '#test', [('o', self.pseudoclient.uid)])
|
||||||
"""
|
"""
|
||||||
channel = self.to_lower(channel)
|
|
||||||
server = server or self.sid
|
server = server or self.sid
|
||||||
assert users, "sjoin: No users sent?"
|
assert users, "sjoin: No users sent?"
|
||||||
log.debug('(%s) sjoin: got %r for users', self.name, users)
|
log.debug('(%s) sjoin: got %r for users', self.name, users)
|
||||||
|
@ -371,7 +371,6 @@ class IRCS2SProtocol(IRCCommonProtocol):
|
|||||||
(not self.is_internal_server(numeric)):
|
(not self.is_internal_server(numeric)):
|
||||||
raise LookupError('No such PyLink client/server exists.')
|
raise LookupError('No such PyLink client/server exists.')
|
||||||
|
|
||||||
channel = self.to_lower(channel)
|
|
||||||
if not reason:
|
if not reason:
|
||||||
reason = 'No reason given'
|
reason = 'No reason given'
|
||||||
|
|
||||||
@ -394,7 +393,6 @@ class IRCS2SProtocol(IRCCommonProtocol):
|
|||||||
|
|
||||||
def part(self, client, channel, reason=None):
|
def part(self, client, channel, reason=None):
|
||||||
"""Sends a part from a PyLink client."""
|
"""Sends a part from a PyLink client."""
|
||||||
channel = self.to_lower(channel)
|
|
||||||
if not self.is_internal_client(client):
|
if not self.is_internal_client(client):
|
||||||
log.error('(%s) Error trying to part %r from %r (no such client exists)', self.name, client, channel)
|
log.error('(%s) Error trying to part %r from %r (no such client exists)', self.name, client, channel)
|
||||||
raise LookupError('No such PyLink client exists.')
|
raise LookupError('No such PyLink client exists.')
|
||||||
|
@ -149,7 +149,6 @@ class NgIRCdProtocol(IRCS2SProtocol):
|
|||||||
self.users[source].away = text
|
self.users[source].away = text
|
||||||
|
|
||||||
def join(self, client, channel):
|
def join(self, client, channel):
|
||||||
channel = self.to_lower(channel)
|
|
||||||
|
|
||||||
if not self.is_internal_client(client):
|
if not self.is_internal_client(client):
|
||||||
raise LookupError('No such PyLink client exists.')
|
raise LookupError('No such PyLink client exists.')
|
||||||
@ -224,7 +223,6 @@ class NgIRCdProtocol(IRCS2SProtocol):
|
|||||||
sjoin('100', '#test', [('', 'user0@0'), ('o', user1@1'), ('v', 'someone@2')])
|
sjoin('100', '#test', [('', 'user0@0'), ('o', user1@1'), ('v', 'someone@2')])
|
||||||
sjoin(self.sid, '#test', [('o', self.pseudoclient.uid)])
|
sjoin(self.sid, '#test', [('o', self.pseudoclient.uid)])
|
||||||
"""
|
"""
|
||||||
channel = self.to_lower(channel)
|
|
||||||
|
|
||||||
server = server or self.sid
|
server = server or self.sid
|
||||||
if not server:
|
if not server:
|
||||||
@ -365,7 +363,6 @@ class NgIRCdProtocol(IRCS2SProtocol):
|
|||||||
self.apply_modes(channel, [('+' + status, source)])
|
self.apply_modes(channel, [('+' + status, source)])
|
||||||
except ValueError:
|
except ValueError:
|
||||||
channel = chanpair
|
channel = chanpair
|
||||||
channel = self.to_lower(channel)
|
|
||||||
|
|
||||||
c = self.channels[channel]
|
c = self.channels[channel]
|
||||||
|
|
||||||
|
@ -66,7 +66,6 @@ class TS6Protocol(TS6BaseProtocol):
|
|||||||
|
|
||||||
def join(self, client, channel):
|
def join(self, client, channel):
|
||||||
"""Joins a PyLink client to a channel."""
|
"""Joins a PyLink client to a channel."""
|
||||||
channel = self.to_lower(channel)
|
|
||||||
# JOIN:
|
# JOIN:
|
||||||
# parameters: channelTS, channel, '+' (a plus sign)
|
# parameters: channelTS, channel, '+' (a plus sign)
|
||||||
if not self.is_internal_client(client):
|
if not self.is_internal_client(client):
|
||||||
@ -96,7 +95,6 @@ class TS6Protocol(TS6BaseProtocol):
|
|||||||
# their status ('@+', '@', '+' or ''), for example:
|
# their status ('@+', '@', '+' or ''), for example:
|
||||||
# '@+1JJAAAAAB +2JJAAAA4C 1JJAAAADS'. All users must be behind the source server
|
# '@+1JJAAAAAB +2JJAAAA4C 1JJAAAADS'. All users must be behind the source server
|
||||||
# so it is not possible to use this message to force users to join a channel.
|
# so it is not possible to use this message to force users to join a channel.
|
||||||
channel = self.to_lower(channel)
|
|
||||||
server = server or self.sid
|
server = server or self.sid
|
||||||
assert users, "sjoin: No users sent?"
|
assert users, "sjoin: No users sent?"
|
||||||
log.debug('(%s) sjoin: got %r for users', self.name, users)
|
log.debug('(%s) sjoin: got %r for users', self.name, users)
|
||||||
|
@ -103,7 +103,6 @@ class UnrealProtocol(TS6BaseProtocol):
|
|||||||
|
|
||||||
def join(self, client, channel):
|
def join(self, client, channel):
|
||||||
"""Joins a PyLink client to a channel."""
|
"""Joins a PyLink client to a channel."""
|
||||||
channel = self.to_lower(channel)
|
|
||||||
if not self.is_internal_client(client):
|
if not self.is_internal_client(client):
|
||||||
raise LookupError('No such PyLink client exists.')
|
raise LookupError('No such PyLink client exists.')
|
||||||
self._send_with_prefix(client, "JOIN %s" % channel)
|
self._send_with_prefix(client, "JOIN %s" % channel)
|
||||||
@ -122,7 +121,6 @@ class UnrealProtocol(TS6BaseProtocol):
|
|||||||
sjoin(self.sid, '#test', [('o', self.pseudoclient.uid)])
|
sjoin(self.sid, '#test', [('o', self.pseudoclient.uid)])
|
||||||
"""
|
"""
|
||||||
# <- :001 SJOIN 1444361345 #test :*@+1JJAAAAAB %2JJAAAA4C 1JJAAAADS
|
# <- :001 SJOIN 1444361345 #test :*@+1JJAAAAAB %2JJAAAA4C 1JJAAAADS
|
||||||
channel = self.to_lower(channel)
|
|
||||||
server = server or self.sid
|
server = server or self.sid
|
||||||
assert users, "sjoin: No users sent?"
|
assert users, "sjoin: No users sent?"
|
||||||
if not server:
|
if not server:
|
||||||
@ -549,11 +547,7 @@ class UnrealProtocol(TS6BaseProtocol):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
for channel in args[0].split(','):
|
for channel in args[0].split(','):
|
||||||
# Normalize channel case.
|
|
||||||
channel = self.to_lower(channel)
|
|
||||||
|
|
||||||
c = self.channels[channel]
|
c = self.channels[channel]
|
||||||
|
|
||||||
self.users[numeric].channels.add(channel)
|
self.users[numeric].channels.add(channel)
|
||||||
self.channels[channel].users.add(numeric)
|
self.channels[channel].users.add(numeric)
|
||||||
# Call hooks manually, because one JOIN command in UnrealIRCd can
|
# Call hooks manually, because one JOIN command in UnrealIRCd can
|
||||||
|
Loading…
x
Reference in New Issue
Block a user