Commit Graph

26 Commits

Author SHA1 Message Date
Valentin Lorentz
37a7029618 SedRegex: when looking up config vars, strip statusmsg prefix from channel, and use network name for lookup. 2020-04-11 15:04:11 +02:00
James Lu
c212ee0e5e SedRegex: allow matching text with the trailing suffix missing
From: 866875ec5d
2020-04-02 10:00:40 -07:00
James Lu
c399272173 SedRegex: make callback matching case sensitive
This fixes a TypeError issue mentioned in d296bbb949.
2020-04-02 10:00:39 -07:00
James Lu
13c03716c5 Revert "SedRegex: Make pattern case-insensitive."
This reverts commit d296bbb949.
2020-04-02 09:47:32 -07:00
Valentin Lorentz
d296bbb949 SedRegex: Make pattern case-insensitive.
To fixes a mismatch between callbacks, which use flags=re.I by default,
and SED_REGEX.search which isn't; so 'S/foo/bar/' errored because it
matches case-insensitively so _unpack_sed is entered, but then _unpack_sed
fails to match it case-sensitively.
2020-04-02 17:30:57 +02:00
Valentin Lorentz
08764b85ef SedRegex: spawn a single process to handle the whole history.
This is more efficient than spawning up to 1000 processes (assuming
Limnoria's default config).

From: ede85ca8b0
2020-01-01 21:55:58 -08:00
James Lu
1267d6452e SedRegex: abort when a search times out
This requires commit b54d8f8073, which separates the timeout and no match cases.

Also, raise the default processTimeout as the plugin now aborts on the first message that times out.

From: e5af479939
2020-01-01 21:55:58 -08:00
James Lu
43d4861577 Update my email & repo link references
From: 2ae51939b3
2020-01-01 21:55:58 -08:00
James Lu
937930ab6a SedRegex: match channel names case insensitively
Some IRCds (Unreal 3.2) don't mangle target names for case correctness, leading to a bug where users end up ignored by the plugin.

Reported by DOMF via IRC.

From: e19abe0498
2020-01-01 21:55:58 -08:00
James Lu
67a3928e4d SedRegex: log all errors, always display the not found mesage
From: fdab0edbc8
2020-01-01 21:55:58 -08:00
James Lu
06f70e59da SedRegex: reuse processTimeout in the sub() process too
From: 4e08442cde
2020-01-01 21:55:58 -08:00
James Lu
e831d0e8ec SedRegex: make the regexp process timeout configurable
Although the default has been adequate on my systems, busy or low-powered machines may fail to process regexps quickly enough and cause SedRegex to sporadically error.

Reported by @cottongin via IRC.

From: 51ff41251b
2020-01-01 21:55:58 -08:00
James Lu
fd7aa571e9 SedRegex: remove compatibility workaround for Python 2.7.6 and lower
From: c9bcbbb934
2020-01-01 21:55:58 -08:00
James Lu
f40d8c530f SedRegex: bump copyright year to 2017
From: 0ef8138ab3
2020-01-01 21:55:58 -08:00
James Lu
90ec8a6976 SedRegex: fix some replacement queries not working
From: 926454b01d
2020-01-01 21:55:58 -08:00
James Lu
6445e90ec7 SedRegex: also catch errors in the regexp_wrapper() step
E.g. sre_constants.error: invalid group reference

From: e137d29eb9
2020-01-01 21:55:58 -08:00
James Lu
5370296bbf SedRegex: log the exact error name instead of "SedRegex error"
From: 406d7b1790
2020-01-01 21:55:58 -08:00
James Lu
dee2b6bdb3 SedRegex: require ending delimiter to prevent overzealous matching of replacement text
Closes #59.

From: 414a4a4a16
2020-01-01 21:55:58 -08:00
James Lu
656d2172db SedRegex: work around "nothing to replace" errors on < Python 2.7.6 again
From: 244a8c6bee
2020-01-01 21:55:58 -08:00
James Lu
889c6a1615 SedRegex: fix flag matching
From: db125ee5d1
2020-01-01 21:55:58 -08:00
James Lu
24ae250ac4 SedRegex: implement 's' regex flag to only match the caller's message
From: 87c79db3d0
2020-01-01 21:55:58 -08:00
James Lu
bd0b1158fc SedRegex: allow free form flags and return them in _unpack_sed()
From: 423da9f996
2020-01-01 21:55:58 -08:00
James Lu
c1e2e2b8a6 SedRegex: sanitize against \n\r\t in output
From: 48445e256a
2020-01-01 21:55:58 -08:00
James Lu
00f26b0a73 SedRegex: only operate on messages from the current network
Reported by @jztech101.

The 'receivedBy' tag is now checked to match the current IRC object, which Works around ProgVal/Limnoria#1211.

From: 84b94d589c
2020-01-01 21:55:58 -08:00
James Lu
fa13c68ebc SedRegex: work around "nothing to repeat" errors on Python < 2.7.6
Source: https://stackoverflow.com/questions/3675144/regex-error-nothing-to-repeat and https://bugs.python.org/issue18647

From: 335fc6e3da
2020-01-01 21:55:58 -08:00
James Lu
1499141f09 Import SedRegex plugin as of 2a556a1b84
Co-authored-by: Michael Daniel Telatynski <postmaster@webdevguru.co.uk>
Co-authored-by: nyuszika7h <nyuszika7h@openmailbox.org>
2020-01-01 21:55:57 -08:00