mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-28 05:29:25 +01:00
protocols: send old IrcServer object (serverdata) in SQUIT hooks
This commit is contained in:
parent
1c0900b29d
commit
b36ce36451
13
classes.py
13
classes.py
@ -1290,6 +1290,7 @@ class Protocol():
|
|||||||
split_server = self._getSid(args[0])
|
split_server = self._getSid(args[0])
|
||||||
|
|
||||||
affected_users = []
|
affected_users = []
|
||||||
|
affected_nicks = []
|
||||||
log.debug('(%s) Splitting server %s (reason: %s)', self.irc.name, split_server, args[-1])
|
log.debug('(%s) Splitting server %s (reason: %s)', self.irc.name, split_server, args[-1])
|
||||||
|
|
||||||
if split_server not in self.irc.servers:
|
if split_server not in self.irc.servers:
|
||||||
@ -1310,16 +1311,20 @@ class Protocol():
|
|||||||
|
|
||||||
for user in self.irc.servers[split_server].users.copy():
|
for user in self.irc.servers[split_server].users.copy():
|
||||||
affected_users.append(user)
|
affected_users.append(user)
|
||||||
log.debug('Removing client %s (%s)', user, self.irc.users[user].nick)
|
nick = self.irc.users[user].nick
|
||||||
|
affected_nicks.append(nick)
|
||||||
|
log.debug('Removing client %s (%s)', user, nick)
|
||||||
self.removeClient(user)
|
self.removeClient(user)
|
||||||
|
|
||||||
sname = self.irc.servers[split_server].name
|
serverdata = self.irc.servers[split_server]
|
||||||
uplink = self.irc.servers[split_server].uplink
|
sname = serverdata.name
|
||||||
|
uplink = serverdata.uplink
|
||||||
|
|
||||||
del self.irc.servers[split_server]
|
del self.irc.servers[split_server]
|
||||||
log.debug('(%s) Netsplit affected users: %s', self.irc.name, affected_users)
|
log.debug('(%s) Netsplit affected users: %s', self.irc.name, affected_users)
|
||||||
|
|
||||||
return {'target': split_server, 'users': affected_users, 'name': sname,
|
return {'target': split_server, 'users': affected_users, 'name': sname,
|
||||||
'uplink': uplink}
|
'uplink': uplink, 'nicks': affected_nicks, 'serverdata': serverdata}
|
||||||
|
|
||||||
def parseCapabilities(self, args):
|
def parseCapabilities(self, args):
|
||||||
"""
|
"""
|
||||||
|
@ -236,9 +236,7 @@ class ClientbotWrapperProtocol(Protocol):
|
|||||||
# Removing pseudoclients and pseudoservers.
|
# Removing pseudoclients and pseudoservers.
|
||||||
squit_data = self._squit(source, 'CLIENTBOT_VIRTUAL_SQUIT', [target, text])
|
squit_data = self._squit(source, 'CLIENTBOT_VIRTUAL_SQUIT', [target, text])
|
||||||
|
|
||||||
nicks = {self.irc.getFriendlyName(u) for u in squit_data['users']}
|
self.irc.callHooks([source, 'CLIENTBOT_SQUIT', squit_data])
|
||||||
|
|
||||||
self.irc.callHooks([server, 'CLIENTBOT_SQUIT', {'nicks': nicks}])
|
|
||||||
|
|
||||||
def _stub(self, *args):
|
def _stub(self, *args):
|
||||||
"""Stub outgoing command function (does nothing)."""
|
"""Stub outgoing command function (does nothing)."""
|
||||||
|
Loading…
Reference in New Issue
Block a user