mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-30 14:14:37 +01:00
Finally got QUIT relaying to work.
This commit is contained in:
parent
5518f75714
commit
51386068e4
@ -98,17 +98,20 @@ class Relay(callbacks.Privmsg):
|
|||||||
callbacks.Privmsg.__init__(self)
|
callbacks.Privmsg.__init__(self)
|
||||||
self.ircs = {}
|
self.ircs = {}
|
||||||
self.started = False
|
self.started = False
|
||||||
self.channels = set()
|
|
||||||
self.ircstates = {}
|
self.ircstates = {}
|
||||||
|
self.lastmsg = ircmsgs.ping('this is just a fake message')
|
||||||
|
self.channels = set()
|
||||||
self.abbreviations = {}
|
self.abbreviations = {}
|
||||||
|
|
||||||
def inFilter(self, irc, msg):
|
def inFilter(self, irc, msg):
|
||||||
if not isinstance(irc, irclib.Irc):
|
if not isinstance(irc, irclib.Irc):
|
||||||
irc = irc.getRealIrc()
|
irc = irc.getRealIrc()
|
||||||
try:
|
try:
|
||||||
self.ircstates[irc].enqueue(irc.state.copy())
|
self.ircstates[irc].addMsg(irc, self.lastmsg)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.ircstates[irc] = MaxLengthQueue(2, (irc.state.copy(),))
|
self.ircstates[irc] = irclib.IrcState()
|
||||||
|
self.ircstates[irc].addMsg(irc, self.lastmsg)
|
||||||
|
self.lastmsg = msg
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def startrelay(self, irc, msg, args):
|
def startrelay(self, irc, msg, args):
|
||||||
@ -310,9 +313,8 @@ class Relay(callbacks.Privmsg):
|
|||||||
s = '%s/%s has quit.' % (msg.nick, network)
|
s = '%s/%s has quit.' % (msg.nick, network)
|
||||||
for channel in self.channels:
|
for channel in self.channels:
|
||||||
debug.printf(self.ircstates[irc])
|
debug.printf(self.ircstates[irc])
|
||||||
debug.printf(self.ircstates[irc][0])
|
debug.printf(self.ircstates[irc].channels[channel].users)
|
||||||
debug.printf(self.ircstates[irc][0].channels[channel].users)
|
if msg.nick in self.ircstates[irc].channels[channel].users:
|
||||||
if msg.nick in self.ircstates[irc][0].channels[channel].users:
|
|
||||||
for otherIrc in self.ircs.itervalues():
|
for otherIrc in self.ircs.itervalues():
|
||||||
if otherIrc != irc:
|
if otherIrc != irc:
|
||||||
otherIrc.queueMsg(ircmsgs.privmsg(channel, s))
|
otherIrc.queueMsg(ircmsgs.privmsg(channel, s))
|
||||||
|
Loading…
Reference in New Issue
Block a user