Hello community,
here is the log from the commit of package python-limnoria for openSUSE:Factory
checked in at 2020-12-10 15:59:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-limnoria (Old)
and /work/SRC/openSUSE:Factory/.python-limnoria.new.2328 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-limnoria"
Thu Dec 10 15:59:08 2020 rev:19 rq:854512 version:2020.12.07
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-limnoria/python-limnoria.changes
2020-10-15 13:50:58.221313675 +0200
+++
/work/SRC/openSUSE:Factory/.python-limnoria.new.2328/python-limnoria.changes
2020-12-10 15:59:09.718912297 +0100
@@ -1,0 +2,6 @@
+Thu Dec 10 00:09:12 UTC 2020 - Atri Bhattacharya <[email protected]>
+
+- Update to version 2020-12-07:
+ * Try all IP addresses of a hostname.
+
+-------------------------------------------------------------------
Old:
----
limnoria-2020.10.13.tar.gz
New:
----
limnoria-2020.12.07.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-limnoria.spec ++++++
--- /var/tmp/diff_new_pack.cN2HCM/_old 2020-12-10 15:59:10.230912778 +0100
+++ /var/tmp/diff_new_pack.cN2HCM/_new 2020-12-10 15:59:10.234912782 +0100
@@ -18,9 +18,9 @@
%define skip_python2 1
%define appname limnoria
-%define srcver 2020-10-13
+%define srcver 2020-12-07
Name: python-limnoria
-Version: 2020.10.13
+Version: 2020.12.07
Release: 0
Summary: A modified version of Supybot (an IRC bot and framework)
License: BSD-3-Clause
++++++ limnoria-2020.10.13.tar.gz -> limnoria-2020.12.07.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Limnoria-master-2020-10-13/plugins/Network/plugin.py
new/Limnoria-master-2020-12-07/plugins/Network/plugin.py
--- old/Limnoria-master-2020-10-13/plugins/Network/plugin.py 2020-10-10
11:51:56.000000000 +0200
+++ new/Limnoria-master-2020-12-07/plugins/Network/plugin.py 2020-12-05
14:26:52.000000000 +0100
@@ -39,7 +39,7 @@
import supybot.ircutils as ircutils
import supybot.registry as registry
import supybot.callbacks as callbacks
-from supybot.i18n import PluginInternationalization, internationalizeDocstring
+from supybot.i18n import PluginInternationalization
_ = PluginInternationalization('Network')
class Network(callbacks.Plugin):
@@ -54,7 +54,6 @@
else:
raise callbacks.Error('I\'m not currently connected to %s.' %
network)
- @internationalizeDocstring
def connect(self, irc, msg, args, opts, network, server, password):
"""[--nossl] <network> [<host[:port]>] [<password>]
@@ -106,7 +105,6 @@
additional('something'),
additional('something', '')])
- @internationalizeDocstring
def disconnect(self, irc, msg, args, otherIrc, quitMsg):
"""<network> [<quit message>]
@@ -126,7 +124,6 @@
otherIrc.network)
disconnect = wrap(disconnect, ['owner', ('networkIrc', True),
additional('text')])
- @internationalizeDocstring
def reconnect(self, irc, msg, args, otherIrc, quitMsg):
"""[<network>] [<quit message>]
@@ -146,7 +143,6 @@
irc.replySuccess()
reconnect = wrap(reconnect, ['owner', 'networkIrc', additional('text')])
- @internationalizeDocstring
def command(self, irc, msg, args, otherIrc, commandAndArgs):
"""<network> <command> [<arg> ...]
@@ -217,7 +213,6 @@
do401 = do402
do406 = do402
- @internationalizeDocstring
def whois(self, irc, msg, args, otherIrc, nick):
"""[<network>] <nick>
@@ -231,7 +226,6 @@
self._whois[(otherIrc, nick)] = (irc, msg, {}, 'whois')
whois = wrap(whois, ['networkIrc', 'nick'])
- @internationalizeDocstring
def whowas(self, irc, msg, args, otherIrc, nick):
"""[<network>] <nick>
@@ -245,7 +239,6 @@
self._whois[(otherIrc, nick)] = (irc, msg, {}, 'whowas')
whowas = wrap(whowas, ['networkIrc', 'nick'])
- @internationalizeDocstring
def networks(self, irc, msg, args, opts):
"""[--all]
@@ -269,7 +262,6 @@
(replyIrc, when) = self._latency.pop(irc)
replyIrc.reply(_('%.2f seconds.') % (now-when))
- @internationalizeDocstring
def latency(self, irc, msg, args, otherIrc):
"""[<network>]
@@ -283,7 +275,6 @@
irc.noReply()
latency = wrap(latency, ['networkIrc'])
- @internationalizeDocstring
def driver(self, irc, msg, args, otherIrc):
"""[<network>]
@@ -294,7 +285,6 @@
irc.reply(otherIrc.driver.__class__.__module__[8:])
driver = wrap(driver, ['networkIrc'])
- @internationalizeDocstring
def uptime(self, irc, msg, args, otherIrc):
"""[<network>]
@@ -307,6 +297,15 @@
(network, utils.timeElapsed(now - started)))
uptime = wrap(uptime, ['networkIrc'])
+ def capabilities(self, irc, msg, args, otherIrc):
+ """[<network>]
+
+ Returns the list of IRCv3 capabilities available on the network.
+ """
+ irc.reply(format("%L", sorted(otherIrc.state.capabilities_ls)))
+ capabilities = wrap(capabilities, ['networkIrc'])
+
+
Class = Network
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Limnoria-master-2020-10-13/plugins/RSS/plugin.py
new/Limnoria-master-2020-12-07/plugins/RSS/plugin.py
--- old/Limnoria-master-2020-10-13/plugins/RSS/plugin.py 2020-10-10
11:51:56.000000000 +0200
+++ new/Limnoria-master-2020-12-07/plugins/RSS/plugin.py 2020-12-05
14:26:52.000000000 +0100
@@ -338,15 +338,21 @@
@only_one_at_once
def update_feeds(self):
- announced_feeds = set()
+ announced_feeds = {}
for irc in world.ircs:
for channel in irc.state.channels:
- announced_feeds |= self.registryValue('announce', channel,
irc.network)
- for name in announced_feeds:
+ channel_feed_names = self.registryValue(
+ 'announce', channel, irc.network)
+ for name in channel_feed_names:
+ announced_feeds[name] = (channel, irc.network)
+ for (name, (channel, network)) in announced_feeds.items():
feed = self.get_feed(name)
if not feed:
- self.log.warning('Feed %s is announced but does not exist.',
- name)
+ self.log.warning(
+ 'Feed %s is announced in %s@%s, but does not exist. '
+ 'Use "rss announce remove %s %s" to remove it from '
+ 'announcements.',
+ name, channel, network, channel, name)
continue
self.update_feed_if_needed(feed)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Limnoria-master-2020-10-13/plugins/SedRegex/constants.py
new/Limnoria-master-2020-12-07/plugins/SedRegex/constants.py
--- old/Limnoria-master-2020-10-13/plugins/SedRegex/constants.py
2020-10-10 11:51:56.000000000 +0200
+++ new/Limnoria-master-2020-12-07/plugins/SedRegex/constants.py
2020-12-05 14:26:52.000000000 +0100
@@ -2,6 +2,9 @@
import re
+TAG_SEEN = 'SedRegex.seen'
+TAG_IS_REGEX = 'SedRegex.isRegex'
+
SED_REGEX = re.compile(
# This part matches an optional nick followed by ":" or ",", used to
direct replacement
# at a particular user.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Limnoria-master-2020-10-13/plugins/SedRegex/plugin.py
new/Limnoria-master-2020-12-07/plugins/SedRegex/plugin.py
--- old/Limnoria-master-2020-10-13/plugins/SedRegex/plugin.py 2020-10-10
11:51:56.000000000 +0200
+++ new/Limnoria-master-2020-12-07/plugins/SedRegex/plugin.py 2020-12-05
14:26:52.000000000 +0100
@@ -52,12 +52,12 @@
'supports Python 2, consult the python2-legacy branch at
'
'https://github.com/jlu5/SupyPlugins/tree/python2-legacy')
-from .constants import *
+from .constants import SED_REGEX, TAG_SEEN, TAG_IS_REGEX
# Replace newlines and friends with things like literal "\n" (backslash and
"n")
axe_spaces = utils.str.MultipleReplacer({'\n': '\\n', '\t': '\\t', '\r':
'\\r'})
-class SearchNotFound(Exception):
+class SearchNotFoundError(Exception):
pass
class SedRegex(callbacks.PluginRegexp):
@@ -110,11 +110,30 @@
return (pattern, replacement, count, raw_flags)
+ # Tag all messages that SedRegex has seen before. This slightly optimizes
the ignoreRegex
+ # feature as all messages tagged with SedRegex.seen but not
SedRegex.isRegex is NOT a regexp.
+ # If we didn't have this tag, we'd have to run a regexp match on each
message in the history
+ # to check if it's a regexp, as there could've been regexp-like messages
sent before
+ # SedRegex was enabled.
+ def doNotice(self, irc, msg):
+ if self.registryValue('enable', msg.channel, irc.network):
+ msg.tag(TAG_SEEN)
+
+ def doPrivmsg(self, irc, msg):
+ # callbacks.PluginRegexp works by defining doPrivmsg(), we don't want
to overwrite
+ # its behaviour
+ super().doPrivmsg(irc, msg)
+ self.doNotice(irc, msg)
+
+ # SedRegex main routine. This is called automatically by
callbacks.PluginRegexp on every
+ # message that matches the SED_REGEX expression defined in constants.py
+ # The actual regexp is passed into PluginRegexp by setting __doc__ equal
to the regexp.
def replacer(self, irc, msg, regex):
if not self.registryValue('enable', msg.channel, irc.network):
return
+ self.log.debug("SedRegex: running on %s/%s for %s", irc.network,
msg.channel, regex)
iterable = reversed(irc.state.history)
- msg.tag('Replacer')
+ msg.tag(TAG_IS_REGEX)
try:
(pattern, replacement, count, flags) =
self._unpack_sed(msg.args[1])
@@ -129,7 +148,7 @@
target = msg.nick
else:
target = regex.group('nick')
- if not ircutils.isNick(str(target), strictRfc=True):
+ if not ircutils.isNick(str(target)):
return
regex_timeout = self.registryValue('processTimeout')
@@ -139,8 +158,8 @@
timeout=regex_timeout, pn=self.name(), cn='replacer')
except ProcessTimeoutError:
irc.error(_("Search timed out."))
- except SearchNotFound:
- irc.error(_("Search not found in the last %i messages.") %
+ except SearchNotFoundError:
+ irc.error(_("Search not found in the last %i IRC messages on this
network.") %
len(irc.state.history))
except Exception as e:
self.log.warning(_("SedRegex replacer error: %s"), e,
exc_info=True)
@@ -149,6 +168,7 @@
e.__class__.__name__, e))
else:
irc.reply(message, prefixNick=False)
+ replacer.__doc__ = SED_REGEX.pattern
def _replacer_process(self, irc, msg, target, pattern, replacement, count,
messages):
for m in messages:
@@ -168,8 +188,15 @@
else:
text = m.args[1]
- if self.registryValue('ignoreRegex', msg.channel, irc.network)
and \
- m.tagged('Replacer'):
+ # Test messages sent before SedRegex was activated. Mark them
all as seen
+ # so we only need to do this check once per message.
+ if not m.tagged(TAG_SEEN):
+ m.tag(TAG_SEEN)
+ if SED_REGEX.match(m.args[1]):
+ m.tag(TAG_IS_REGEX)
+ # Ignore messages containing a regexp if ignoreRegex is on.
+ if self.registryValue('ignoreRegex', msg.channel, irc.network)
and m.tagged(TAG_IS_REGEX):
+ self.log.debug("Skipping message %s because it is tagged
as isRegex", m.args[1])
continue
if m.nick == msg.nick:
messageprefix = msg.nick
@@ -196,8 +223,7 @@
self.log.debug(_("SedRegex: Search %r not found in the last %i
messages of %s."),
msg.args[1], len(irc.state.history), msg.args[0])
- raise SearchNotFound()
- replacer.__doc__ = SED_REGEX.pattern
+ raise SearchNotFoundError()
Class = SedRegex
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Limnoria-master-2020-10-13/plugins/SedRegex/test.py
new/Limnoria-master-2020-12-07/plugins/SedRegex/test.py
--- old/Limnoria-master-2020-10-13/plugins/SedRegex/test.py 2020-10-10
11:51:56.000000000 +0200
+++ new/Limnoria-master-2020-12-07/plugins/SedRegex/test.py 2020-12-05
14:26:52.000000000 +0100
@@ -51,13 +51,22 @@
m = self.getMsg(' ')
self.assertIn('Abcd testefgh', str(m))
+ def testNoMatch(self):
+ self.feedMsg('hello world')
+ self.feedMsg('s/goodbye//')
+ m = self.getMsg(' ')
+ self.assertIn('Search not found', str(m))
+ self.feedMsg('s/Hello/hi/') # wrong case
+ m = self.getMsg(' ')
+ self.assertIn('Search not found', str(m))
+
def testCaseInsensitiveReplace(self):
self.feedMsg('Aliens Are Invading, Help!')
self.feedMsg('s/a/e/i')
m = self.getMsg(' ')
self.assertIn('eliens', str(m))
- def testIgnoreRegexpWithBadCase(self):
+ def testIgnoreRegexWithBadCase(self):
self.feedMsg('aliens are invading, help!')
self.assertSnarfNoResponse('S/aliens/monsters/')
@@ -100,10 +109,16 @@
self.feedMsg('ouch', frm=self.__class__.other2)
self.feedMsg('poof', frm=self.__class__.other)
self.feedMsg('wow!')
+
+ # This should work regardless of whether we use "nick," or "nick:" as
prefix
self.feedMsg('%s: s/^/p/' %
ircutils.nickFromHostmask(self.__class__.other2))
m = self.getMsg(' ')
self.assertIn('pouch', str(m))
+ self.feedMsg('%s, s/^/c/' %
ircutils.nickFromHostmask(self.__class__.other2))
+ m = self.getMsg(' ')
+ self.assertIn('couch', str(m))
+
@unittest.skipUnless(sys.version_info[0] >= 3, 'Test fails on Python 2.')
def testBoldReplacement(self):
with conf.supybot.plugins.sedregex.boldReplacementText.context(True):
@@ -216,6 +231,53 @@
m = self.getMsg(' ')
self.assertIn('see you later, bye', str(m))
+ def testIgnoreRegexOnMessagesBeforeEnable(self):
+ # Before 2020-10-12 SedRegex used a single msg.tag() to track and
ignore messages parsed as a regexp.
+ # However, a common complaint is that this doesn't catch regexps sent
before SedRegex was loaded/enabled...
+ with conf.supybot.plugins.sedregex.enable.context(False):
+ self.feedMsg('foo')
+ self.feedMsg('barbell')
+ self.feedMsg('s/foo/bar/')
+ self.feedMsg('abcdef')
+ self.feedMsg('s/bar/door/')
+ m = self.getMsg(' ')
+ # The INCORRECT response would be "s/foo/door/"
+ self.assertIn('doorbell', str(m))
+
+ def testSeparatorPresentInNick(self):
+ # Check that replacement doesn't break if the target's nick contains
the sed separator.
+ frm = 'hello|[email protected]'
+ with conf.supybot.protocols.irc.strictRfc.context(False):
+ self.feedMsg('the quick brown fox jumps over the lazy hog',
frm=frm)
+ # self replace
+ self.feedMsg('s|hog|dog', frm=frm)
+ m = self.getMsg(' ')
+ self.assertIn('the lazy dog', str(m))
+ # other replace
+ self.feedMsg('%s: s| hog| dog' % ircutils.nickFromHostmask(frm),
frm=self.__class__.other2)
+ m = self.getMsg(' ')
+ self.assertIn('the lazy dog', str(m))
+
+ def testSlashInNicks(self):
+ # Slash in nicks should be accepted when strictRfc is off
+ frm = 'nick/[email protected]'
+ with conf.supybot.protocols.irc.strictRfc.context(False):
+ self.feedMsg('hello world', frm=frm)
+ self.feedMsg('abc 123', frm=frm)
+ # self replace
+ self.feedMsg('s/world/everyone/', frm=frm)
+ m = self.getMsg(' ')
+ self.assertIn('hello everyone', str(m))
+ # other replace
+ self.feedMsg('%s: s/123/321/' % ircutils.nickFromHostmask(frm),
frm=self.__class__.other2)
+ m = self.getMsg(' ')
+ self.assertIn('abc 321', str(m))
+
+ # When strictRfc is on, nicks for explicit reference are checked but
not
+ # the sender's own nick
+ with conf.supybot.protocols.irc.strictRfc.context(True):
+ self.assertSnarfNoResponse('%s: s/123/321/' %
ircutils.nickFromHostmask(frm), frm=self.__class__.other2)
+
# TODO: test ignores
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Limnoria-master-2020-10-13/plugins/Web/plugin.py
new/Limnoria-master-2020-12-07/plugins/Web/plugin.py
--- old/Limnoria-master-2020-10-13/plugins/Web/plugin.py 2020-10-10
11:51:56.000000000 +0200
+++ new/Limnoria-master-2020-12-07/plugins/Web/plugin.py 2020-12-05
14:26:52.000000000 +0100
@@ -275,6 +275,21 @@
finally:
fd.close()
+ @wrap(['httpUrl'])
+ @catch_web_errors
+ @fetch_sandbox
+ def location(self, irc, msg, args, url):
+ """<url>
+
+ If the <url> is redirected to another page, returns the URL of that
+ page. This works even if there are multiple redirects.
+ Only HTTP urls are valid.
+ Useful to "un-tinify" URLs."""
+ timeout = self.registryValue('timeout')
+ (target, text) = utils.web.getUrlTargetAndContent(url, size=60,
+ timeout=timeout)
+ irc.reply(target)
+
_doctypeRe = re.compile(r'(<!DOCTYPE[^>]+>)', re.M)
@wrap(['httpUrl'])
@catch_web_errors
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Limnoria-master-2020-10-13/plugins/Web/test.py
new/Limnoria-master-2020-12-07/plugins/Web/test.py
--- old/Limnoria-master-2020-10-13/plugins/Web/test.py 2020-10-10
11:51:56.000000000 +0200
+++ new/Limnoria-master-2020-12-07/plugins/Web/test.py 2020-12-05
14:26:52.000000000 +0100
@@ -37,6 +37,13 @@
self.assertError('headers ftp://ftp.cdrom.com/pub/linux')
self.assertNotError('headers http://www.slashdot.org/')
+ def testLocation(self):
+ self.assertError('location ftp://ftp.cdrom.com/pub/linux')
+ self.assertResponse(
+ 'location http://limnoria.net/', 'https://limnoria.net/')
+ self.assertResponse(
+ 'location https://www.limnoria.net/', 'https://limnoria.net/')
+
def testDoctype(self):
self.assertError('doctype ftp://ftp.cdrom.com/pub/linux')
self.assertNotError('doctype http://www.slashdot.org/')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Limnoria-master-2020-10-13/scripts/supybot-adduser
new/Limnoria-master-2020-12-07/scripts/supybot-adduser
--- old/Limnoria-master-2020-10-13/scripts/supybot-adduser 2020-10-10
11:51:56.000000000 +0200
+++ new/Limnoria-master-2020-12-07/scripts/supybot-adduser 2020-12-05
14:26:52.000000000 +0100
@@ -56,7 +56,7 @@
help='capability the user should have; '
'this option may be given multiple times.')
(options, args) = parser.parse_args()
- if len(args) is not 1:
+ if len(args) != 1:
parser.error('Specify the users.conf file you\'d like to use. '
'Be sure *not* to specify your registry file, generated '
'by supybot-wizard. This is not the file you want. '
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Limnoria-master-2020-10-13/scripts/supybot-reset-password
new/Limnoria-master-2020-12-07/scripts/supybot-reset-password
--- old/Limnoria-master-2020-10-13/scripts/supybot-reset-password
2020-10-10 11:51:56.000000000 +0200
+++ new/Limnoria-master-2020-12-07/scripts/supybot-reset-password
2020-12-05 14:26:52.000000000 +0100
@@ -52,7 +52,7 @@
dest='password',
help='password for the user.')
(options, args) = parser.parse_args()
- if len(args) is not 1:
+ if len(args) != 1:
parser.error('Specify the users.conf file you\'d like to use. '
'Be sure *not* to specify your registry file, generated '
'by supybot-wizard. This is not the file you want. '
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Limnoria-master-2020-10-13/src/drivers/Socket.py
new/Limnoria-master-2020-12-07/src/drivers/Socket.py
--- old/Limnoria-master-2020-10-13/src/drivers/Socket.py 2020-10-10
11:51:56.000000000 +0200
+++ new/Limnoria-master-2020-12-07/src/drivers/Socket.py 2020-12-05
14:26:52.000000000 +0100
@@ -267,7 +267,7 @@
socks_proxy = ''
else:
try:
- hostname = utils.net.getAddressFromHostname(
+ address = utils.net.getAddressFromHostname(
self.currentServer.hostname,
attempt=self._attempt)
except (socket.gaierror, socket.error) as e:
@@ -277,7 +277,7 @@
drivers.log.connect(self.currentServer)
try:
self.conn = utils.net.getSocket(
- self.currentServer.hostname,
+ address,
port=self.currentServer.port,
socks_proxy=socks_proxy,
vhost=conf.supybot.protocols.irc.vhost(),
@@ -294,20 +294,19 @@
# Connect before SSL, otherwise SSL is disabled if we use SOCKS.
# See http://stackoverflow.com/q/16136916/539465
self.conn.connect(
- (self.currentServer.hostname, self.currentServer.port))
+ (address, self.currentServer.port))
if network_config.ssl() or \
self.currentServer.force_tls_verification:
self.starttls()
# Suppress this warning for loopback IPs.
- targetip = hostname
if sys.version_info[0] < 3:
# Backported Python 2 ipaddress demands unicode instead of str
- targetip = targetip.decode('utf-8')
+ address = address.decode('utf-8')
elif (not network_config.requireStarttls()) and \
(not network_config.ssl()) and \
(not self.currentServer.force_tls_verification) and \
- (ipaddress is None or not
ipaddress.ip_address(targetip).is_loopback):
+ (ipaddress is None or not
ipaddress.ip_address(address).is_loopback):
drivers.log.warning(('Connection to network %s '
'does not use SSL/TLS, which makes it vulnerable to '
'man-in-the-middle attacks and passive eavesdropping. '
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Limnoria-master-2020-10-13/src/ircdb.py
new/Limnoria-master-2020-12-07/src/ircdb.py
--- old/Limnoria-master-2020-10-13/src/ircdb.py 2020-10-10 11:51:56.000000000
+0200
+++ new/Limnoria-master-2020-12-07/src/ircdb.py 2020-12-05 14:26:52.000000000
+0100
@@ -1172,18 +1172,24 @@
try:
id = users.getUserId(hostmask)
user = users.getUser(id)
- if user._checkCapability('trusted'):
- # Trusted users (including owners) shouldn't ever be ignored.
- return False
- elif user.ignore:
- log.debug('Ignoring %s due to their IrcUser ignore flag.',
hostmask)
- return True
except KeyError:
# If there's no user...
if conf.supybot.defaultIgnore():
log.debug('Ignoring %s due to conf.supybot.defaultIgnore',
hostmask)
return True
+ else:
+ try:
+ if user._checkCapability('trusted'):
+ # Trusted users (including owners) shouldn't ever be ignored.
+ return False
+ except KeyError:
+ # neither explicitly trusted or -trusted -> consider them not
+ # trusted
+ pass
+ if user.ignore:
+ log.debug('Ignoring %s due to their IrcUser ignore flag.',
hostmask)
+ return True
if ignores.checkIgnored(hostmask):
log.debug('Ignoring %s due to ignore database.', hostmask)
return True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Limnoria-master-2020-10-13/src/irclib.py
new/Limnoria-master-2020-12-07/src/irclib.py
--- old/Limnoria-master-2020-10-13/src/irclib.py 2020-10-10
11:51:56.000000000 +0200
+++ new/Limnoria-master-2020-12-07/src/irclib.py 2020-12-05
14:26:52.000000000 +0100
@@ -186,11 +186,11 @@
if not self.echoMessage and not self.echo_message \
and msg.command in ('PRIVMSG', 'NOTICE', 'TAGMSG') \
and ('label' in msg.server_tags
- or not msg.tagged('receivedAt')):
+ or msg.tagged('emulatedEcho')):
# This is an echo of a message we sent; and the plugin didn't
# opt-in to receiving echos; ignoring it.
# `'label' in msg.server_tags` detects echos when labeled-response
- # is enabled; and `not msg.tag('receivedAt')` detects simulated
+ # is enabled; and `msg.tag('emulatedEcho')` detects simulated
# echos. As we don't enable real echo-message unless
# labeled-response is enabled; this is an exhaustive check of echos
# in all cases.
@@ -1305,6 +1305,9 @@
# echo-message is not implemented by server; let's emulate it
# here, just before sending it to the driver.
assert not msg.tagged('receivedAt')
+ if not world.testing:
+ assert not msg.tagged('emulatedEcho')
+ msg.tag('emulatedEcho', True)
self.feedMsg(msg, tag=False)
else:
# I don't think we should do this. Why should it matter? If
it's
_______________________________________________
openSUSE Commits mailing list -- [email protected]
To unsubscribe, email [email protected]
List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette
List Archives:
https://lists.opensuse.org/archives/list/[email protected]