mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-25 12:12:53 +01:00
automode: send one MODE per user (first part of #275)
If a user matches multiple DB entries, only one is sent now. However, this still needs to be changed so if multiple people are being checked for entries at once, one MODE command is sent for the entire channel.
This commit is contained in:
parent
d45aa6ae87
commit
256801c0b4
@ -215,11 +215,12 @@ def match(irc, channel, uid):
|
|||||||
modebot_uid = modebot.uids.get(irc.name)
|
modebot_uid = modebot.uids.get(irc.name)
|
||||||
|
|
||||||
# Check every mask defined in the channel ACL.
|
# Check every mask defined in the channel ACL.
|
||||||
|
outgoing_modes = []
|
||||||
for mask, modes in dbentry.items():
|
for mask, modes in dbentry.items():
|
||||||
if irc.matchHost(mask, uid):
|
if irc.matchHost(mask, uid):
|
||||||
# User matched a mask. Filter the mode list given to only those that are valid
|
# User matched a mask. Filter the mode list given to only those that are valid
|
||||||
# prefix mode characters.
|
# prefix mode characters.
|
||||||
outgoing_modes = [('+'+mode, uid) for mode in modes if mode in irc.prefixmodes]
|
outgoing_modes += [('+'+mode, uid) for mode in modes if mode in irc.prefixmodes]
|
||||||
log.debug("(%s) automode: Filtered mode list of %s to %s (protocol:%s)",
|
log.debug("(%s) automode: Filtered mode list of %s to %s (protocol:%s)",
|
||||||
irc.name, modes, outgoing_modes, irc.protoname)
|
irc.name, modes, outgoing_modes, irc.protoname)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user