mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-24 19:52:53 +01:00
protocols: rename topicClient -> topic; topicServer -> topicBurst
This is one of the few commands that I won't consolidate at this time, because there is actually a difference in how most IRCds handle topic bursts and normal topic changes
This commit is contained in:
parent
5ccf204c75
commit
3d0bf18001
@ -83,9 +83,9 @@ optional, and defaults to the one we've stored in the channel state if not given
|
|||||||
|
|
||||||
- **`squit`**`(self, source, target, text='No reason given')` - SQUITs a PyLink server.
|
- **`squit`**`(self, source, target, text='No reason given')` - SQUITs a PyLink server.
|
||||||
|
|
||||||
- **`topicClient`**`(self, source, target, text)` - Sends a topic change from a PyLink client.
|
- **`topic`**`(self, source, target, text)` - Sends a topic change from a PyLink client.
|
||||||
|
|
||||||
- **`topicServer`**`(self, source, target, text)` - Sends a topic change from a PyLink server. This is usually used on burst.
|
- **`topicBurst`**`(self, source, target, text)` - Sends a topic change from a PyLink server. This is usually used on burst.
|
||||||
|
|
||||||
- **`updateClient`**`(self, source, field, text)` - Updates the ident, host, or realname of a PyLink client. `field` should be either "IDENT", "HOST", "GECOS", or
|
- **`updateClient`**`(self, source, field, text)` - Updates the ident, host, or realname of a PyLink client. `field` should be either "IDENT", "HOST", "GECOS", or
|
||||||
"REALNAME". If changing the field given on the IRCd isn't supported, `NotImplementedError` should be raised.
|
"REALNAME". If changing the field given on the IRCd isn't supported, `NotImplementedError` should be raised.
|
||||||
|
@ -250,7 +250,7 @@ def topic(irc, source, args):
|
|||||||
irc.reply("Error: Unknown channel %r." % channel)
|
irc.reply("Error: Unknown channel %r." % channel)
|
||||||
return
|
return
|
||||||
|
|
||||||
irc.proto.topicClient(irc.pseudoclient.uid, channel, topic)
|
irc.proto.topic(irc.pseudoclient.uid, channel, topic)
|
||||||
|
|
||||||
irc.callHooks([irc.pseudoclient.uid, 'CHANCMDS_TOPIC',
|
irc.callHooks([irc.pseudoclient.uid, 'CHANCMDS_TOPIC',
|
||||||
{'channel': channel, 'text': topic, 'setter': source,
|
{'channel': channel, 'text': topic, 'setter': source,
|
||||||
|
@ -376,7 +376,7 @@ def initializeChannel(irc, channel):
|
|||||||
# Only update the topic if it's different from what we already have,
|
# Only update the topic if it's different from what we already have,
|
||||||
# and topic bursting is complete.
|
# and topic bursting is complete.
|
||||||
if remoteirc.channels[remotechan].topicset and topic != irc.channels[channel].topic:
|
if remoteirc.channels[remotechan].topicset and topic != irc.channels[channel].topic:
|
||||||
irc.proto.topicServer(getRemoteSid(irc, remoteirc), channel, topic)
|
irc.proto.topicBurst(getRemoteSid(irc, remoteirc), channel, topic)
|
||||||
# Send our users and channel modes to the other nets
|
# Send our users and channel modes to the other nets
|
||||||
log.debug('(%s) initializeChannel: joining our (%s) users: %s', irc.name, remotenet, irc.channels[channel].users)
|
log.debug('(%s) initializeChannel: joining our (%s) users: %s', irc.name, remotenet, irc.channels[channel].users)
|
||||||
relayJoins(irc, channel, irc.channels[channel].users, irc.channels[channel].ts)
|
relayJoins(irc, channel, irc.channels[channel].users, irc.channels[channel].ts)
|
||||||
@ -938,12 +938,12 @@ def handle_topic(irc, numeric, command, args):
|
|||||||
# This might originate from a server too.
|
# This might originate from a server too.
|
||||||
remoteuser = getRemoteUser(irc, remoteirc, numeric, spawnIfMissing=False)
|
remoteuser = getRemoteUser(irc, remoteirc, numeric, spawnIfMissing=False)
|
||||||
if remoteuser:
|
if remoteuser:
|
||||||
remoteirc.proto.topicClient(remoteuser, remotechan, topic)
|
remoteirc.proto.topic(remoteuser, remotechan, topic)
|
||||||
else:
|
else:
|
||||||
rsid = getRemoteSid(remoteirc, irc)
|
rsid = getRemoteSid(remoteirc, irc)
|
||||||
remoteirc.proto.topicServer(rsid, remotechan, topic)
|
remoteirc.proto.topicBurst(rsid, remotechan, topic)
|
||||||
elif oldtopic: # Topic change blocked by claim.
|
elif oldtopic: # Topic change blocked by claim.
|
||||||
irc.proto.topicClient(irc.pseudoclient.uid, channel, oldtopic)
|
irc.proto.topic(irc.pseudoclient.uid, channel, oldtopic)
|
||||||
|
|
||||||
utils.add_hook(handle_topic, 'TOPIC')
|
utils.add_hook(handle_topic, 'TOPIC')
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ class InspIRCdProtocol(TS6BaseProtocol):
|
|||||||
if self.irc.isInternalClient(target):
|
if self.irc.isInternalClient(target):
|
||||||
self.removeClient(target)
|
self.removeClient(target)
|
||||||
|
|
||||||
def topicServer(self, numeric, target, text):
|
def topicBurst(self, numeric, target, text):
|
||||||
"""Sends a topic change from a PyLink server. This is usually used on burst."""
|
"""Sends a topic change from a PyLink server. This is usually used on burst."""
|
||||||
if not self.irc.isInternalServer(numeric):
|
if not self.irc.isInternalServer(numeric):
|
||||||
raise LookupError('No such PyLink server exists.')
|
raise LookupError('No such PyLink server exists.')
|
||||||
|
@ -177,7 +177,7 @@ class TS6Protocol(TS6BaseProtocol):
|
|||||||
self._send(numeric, 'KILL %s :Killed (%s)' % (target, reason))
|
self._send(numeric, 'KILL %s :Killed (%s)' % (target, reason))
|
||||||
self.removeClient(target)
|
self.removeClient(target)
|
||||||
|
|
||||||
def topicServer(self, numeric, target, text):
|
def topicBurst(self, numeric, target, text):
|
||||||
"""Sends a topic change from a PyLink server. This is usually used on burst."""
|
"""Sends a topic change from a PyLink server. This is usually used on burst."""
|
||||||
if not self.irc.isInternalServer(numeric):
|
if not self.irc.isInternalServer(numeric):
|
||||||
raise LookupError('No such PyLink server exists.')
|
raise LookupError('No such PyLink server exists.')
|
||||||
@ -321,7 +321,7 @@ class TS6Protocol(TS6BaseProtocol):
|
|||||||
# KNOCK: support for /knock
|
# KNOCK: support for /knock
|
||||||
# SAVE: support for SAVE (forces user to UID in nick collision)
|
# SAVE: support for SAVE (forces user to UID in nick collision)
|
||||||
# SERVICES: adds mode +r (only registered users can join a channel)
|
# SERVICES: adds mode +r (only registered users can join a channel)
|
||||||
# TB: topic burst command; we send this in topicServer
|
# TB: topic burst command; we send this in topicBurst
|
||||||
# EUID: extended UID command, which includes real hostname + account data info,
|
# EUID: extended UID command, which includes real hostname + account data info,
|
||||||
# and allows sending CHGHOST without ENCAP.
|
# and allows sending CHGHOST without ENCAP.
|
||||||
f('CAPAB :QS ENCAP EX CHW IE KNOCK SAVE SERVICES TB EUID')
|
f('CAPAB :QS ENCAP EX CHW IE KNOCK SAVE SERVICES TB EUID')
|
||||||
|
@ -97,7 +97,7 @@ class TS6BaseProtocol(Protocol):
|
|||||||
raise LookupError('No such PyLink client exists.')
|
raise LookupError('No such PyLink client exists.')
|
||||||
self._send(numeric, 'NOTICE %s :%s' % (target, text))
|
self._send(numeric, 'NOTICE %s :%s' % (target, text))
|
||||||
|
|
||||||
def topicClient(self, numeric, target, text):
|
def topic(self, numeric, target, text):
|
||||||
"""Sends a TOPIC change from a PyLink client."""
|
"""Sends a TOPIC change from a PyLink client."""
|
||||||
if not self.irc.isInternalClient(numeric):
|
if not self.irc.isInternalClient(numeric):
|
||||||
raise LookupError('No such PyLink client exists.')
|
raise LookupError('No such PyLink client exists.')
|
||||||
|
@ -216,7 +216,7 @@ class UnrealProtocol(TS6BaseProtocol):
|
|||||||
raise ProtocolError('Cannot force mode change on external clients!')
|
raise ProtocolError('Cannot force mode change on external clients!')
|
||||||
self._send(target, 'UMODE2 %s' % joinedmodes)
|
self._send(target, 'UMODE2 %s' % joinedmodes)
|
||||||
|
|
||||||
def topicServer(self, numeric, target, text):
|
def topicBurst(self, numeric, target, text):
|
||||||
"""Sends a TOPIC change from a PyLink server."""
|
"""Sends a TOPIC change from a PyLink server."""
|
||||||
if not self.irc.isInternalServer(numeric):
|
if not self.irc.isInternalServer(numeric):
|
||||||
raise LookupError('No such PyLink server exists.')
|
raise LookupError('No such PyLink server exists.')
|
||||||
|
Loading…
Reference in New Issue
Block a user