This is the only way to limit the execution time of a possibly long-running python statement.
Use this on String.re, due to the possibility of pathologically long re matching in python.
This allows us to remove the 'trusted-only' restriction on string.re.
In the future, this should probably be used in other places that take user-supplied regexps,
such as 'misc last --regexp', for example, as well as other potentially long-running tasks
that can block the bot.
Fixed bug in 100% packet loss response.
Errors from ping are now sent to irc.error().
Added packet count, interval, ttl, and wait options.
Added additional test cases.
Also, Enabled threading for Unix plugin, and
for wtf, spell, and ping commands.
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 3090cffe2c)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
When configured, the outFilter and shrinkSnarfer use cycle through
serviceRotation's list of services. Otherwise, the default service is used.
Closes: deb#539858
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 0bfa0d153c)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit acffde68ab)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 0c62204809)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit c10d964604)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
Closes: Sf#3019174
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit d78f7b6ac5)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 0e22e218f0)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit f926804f40)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
Notify the user when trying to use the commands on a disabled network, ignore
noJoinsUntilIdentified, and don't try communicating with services.
Closes: Sf#3018464
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 9e73f4482c)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
All ircmsgs that takeMsg will return should be processed each time
checkIrcForMsgs is called since there may be multiple available in the
fastqueue.
Reduced the time between calls of checkIrcForMsgs so the delay between
normally queued ircmsgs stays close to the configured throttleTime.
Closes: Sf#3018148
(cherry picked from commit adc5d62bbf)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
Users were occasionally hitting a situation where the socket had errored,
causing a reconnect, but the socket wasn't closed nor the driver marked as
disconnected. This resulted in run() continuing to try and use the driver,
which would cause another error, schedule another reconnect, log an error, ad
infinitum.
Closes: Sf#2965530
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit a278d17f2b)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
Closes: Sf#2998820
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit f03a3f6c85)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
Closes: Sf#2991515
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 57e894de58)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
two commits ago, in commit 51cabeea33
it is necessary for the operation of the plugin
(specifically, in the _checkManageCapabilities function)
the tests didn't catch that because it apparently imports re separately.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 18ef6dadfc)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
Topics now persist between restarts.
Rationale: Useful when reloading/restarting; previously the topics would
be just forgotten. Don't use database, as that would be an unnecessary
overkill and in any case not needed.
(Also, remove the unused `re' module import.)
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 6520d1f282)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 41fd218b8d)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
This should prevent the accumulation of old unclaimed notes in the database,
which is possible due to notes left to misspelled nicks, to temporary nicks
used by regulars, or to one-time visitor nicks.
This allows inclusion of the usual standardSubstitute vars within factoids.
There is no config to disable this, since it is possible to escape the substitutions
by simply doubling the dollar signs, as per the python documentation:
http://docs.python.org/library/string.html#template-strings
Thus, if you want a factoid to output a literal "$channel", for example, all
you'd need to do is use "$$channel" in your factoid text, which will come out
as "$channel" when said by the bot.
Also added tests for this new behavior.