Commit Graph

11788 Commits

Author SHA1 Message Date
James Vega 9e73f4482c Services: Disable most of the plugin on networks in the disabled list.
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>
2010-06-19 16:59:13 -04:00
James Vega adc5d62bbf Twisted: Send all available ircmsgs and reduce delay between checks
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
2010-06-18 20:33:43 -04:00
Daniel Folkinshteyn 1ce52f01f4 ChannelLogger: include in logs the reasons for parts and quits 2010-06-15 23:53:15 -04:00
Daniel Folkinshteyn a91bc318dc Channel: nicks: add --count argument, which outputs only the count of nicks in channel.
also add tests for the nick command.
2010-06-13 02:36:18 -04:00
Daniel Folkinshteyn 80491fddb1 Conditional: allow empty string arguments in string-comparison functions 2010-06-03 17:03:39 -04:00
Daniel Folkinshteyn 5f2d2a9c5e Utilities: add countargs function, returns number of arguments supplied.
also add tests for it.
2010-06-03 16:08:25 -04:00
Daniel Folkinshteyn 52b36555f4 Utilities: add 'sample' command, a basic interface to random.sample()
Also add tests for it.
2010-06-03 13:06:28 -04:00
James Vega 108f7f2f86 Socket: Ensure driver is flagged as disconnected after a socket error.
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>
2010-06-03 10:44:25 -04:00
James Vega bc8457dc90 utils/web.py: Only try catching socket.sslerror if built with SSL support
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>
2010-06-03 10:43:54 -04:00
James Vega db479731b1 Anonymous: Implement support for allowPrivateTarget config.
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>
2010-06-03 10:43:31 -04:00
Jeremy Fincher df2c6c2650 Updates and tweaks to some ircutils functions.
(cherry picked from commit 6135a88741)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-06-03 10:42:58 -04:00
Daniel Folkinshteyn 1a228b3e7d fix google calc to work when doing a currency conversion.
made the calcre more generic, so it finds stuff on both math and currency.
nothing a little exploration of google html page source couldn't solve.
2010-06-02 18:36:27 -04:00
James Vega a278d17f2b Socket: Ensure driver is flagged as disconnected after a socket error.
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>
2010-05-24 23:36:29 -04:00
James Vega f03a3f6c85 utils/web.py: Only try catching socket.sslerror if built with SSL support
Closes: Sf#2998820

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-05-24 15:44:25 -04:00
James Vega 57e894de58 Anonymous: Implement support for allowPrivateTarget config.
Closes: Sf#2991515

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-05-24 15:21:58 -04:00
Daniel Folkinshteyn 40941e044a fix bug in RSS.announce.list:
Because the 'channel' argument was declared optional, calling announce.list
off-channel without a channel argument caused an error.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-05-24 14:46:04 -04:00
Jeremy Fincher 6135a88741 Updates and tweaks to some ircutils functions. 2010-05-18 12:48:36 -05:00
James Vega 5ccb242657 Re-add re import since capability-checking code relies on it.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-05-15 21:55:05 -04:00
Daniel Folkinshteyn f25d1546bf restore the 'import re' to Topic plugin, which was for some reason taken out
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.
2010-05-13 00:52:58 -04:00
Štěpán Němec f3af3ec282 Topic plugin: Restore topic automatically after join if not set.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 18ef6dadfc)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-05-12 13:20:32 -04:00
Štěpán Němec 51cabeea33 Topic plugin: Add persistence support.
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>
2010-05-12 13:19:54 -04:00
James Vega fc1a049d3c ChannelStats: Fix rank to work with selfStats
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit 41fd218b8d)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-05-12 13:19:01 -04:00
Štěpán Němec 18ef6dadfc Topic plugin: Restore topic automatically after join if not set.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-05-11 18:23:33 -04:00
Štěpán Němec 6520d1f282 Topic plugin: Add persistence support.
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>
2010-05-11 18:22:37 -04:00
James Vega 41fd218b8d ChannelStats: Fix rank to work with selfStats
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-05-11 17:50:43 -04:00
Daniel Folkinshteyn 5d15bbf1b2 for Later plugin, add test for actual sending of notes to nicks upon their being seen. 2010-04-29 20:20:36 -04:00
Daniel Folkinshteyn 9c12f80285 Add Later note expiration period, 30 days by default.
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.
2010-04-29 20:04:51 -04:00
Daniel Folkinshteyn e4c51ef517 Add --raw option to factoids.whatis, which disables variable substitution on the factoid.
also add test for this.
2010-04-28 15:27:08 -04:00
Daniel Folkinshteyn 976ad82d69 Use the ircutils.standardSubsitute function upon factoid output.
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.
2010-04-28 00:10:48 -04:00
Daniel Folkinshteyn 71f88caa6b Clarify the on-error log message in MessageParser function caller. 2010-04-27 15:29:09 -04:00
Daniel Folkinshteyn a819c5b496 make Misc.apropos return plugin name even if command is in only one plugin. 2010-04-27 12:46:22 -04:00
Daniel Folkinshteyn 2bb3ba9443 fix bug in RSS.announce.list:
Because the 'channel' argument was declared optional, calling announce.list
off-channel without a channel argument caused an error.
2010-04-26 19:50:08 -04:00
Daniel Folkinshteyn 79c7514f1a Improve supybot-botchk documentation. Make a note that supybot.pidFile config must be set for it to work.
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-04-26 18:56:59 -04:00
Daniel Folkinshteyn 053a9d590e Improve supybot-botchk documentation. Make a note that supybot.pidFile config must be set for it to work. 2010-04-25 23:24:42 -04:00
Daniel Folkinshteyn f1517a7acc some enhancements Factoids.rank:
output options: plain key output, and alpha sorting for plain output.
allow an optional argument for how many ranked facts to show.
2010-04-25 02:58:43 -04:00
Daniel Folkinshteyn 55eeb4a57b Add some sanity checks to RSS plugin:
First: if an rss feed is called without the number of headlines argument,
we now have a default number of items it will output.
before, it tried to stuff the whole rss feed into the channel, which is quite
floody, if more than one 'mores' is set, or if oneToOne is false.

Second: when adding a new feed to announce, it again, tried to stuff the
whole rss feed into the channel, which ran into the same floody conditions
as above. now we have a default number of feeds to output when there's no
cached history.
2010-04-25 00:34:31 -04:00
Daniel Folkinshteyn 3005752c58 fix docstring for Plugin.plugin command so it actually says what the command will do.
also add a Plugin.plugins command, which always returns a list of all plugins containing a command.
add a test for it.
2010-04-21 16:38:25 -04:00
Daniel Folkinshteyn 9c5f05ab2d update quotegrabs to sqlite3 2010-04-21 01:24:13 -04:00
James Vega 5ad620b5fd Make registry.Regexp.error mimic registry.Value.error
Regexp.error can't directly call Value.error because it's providing extra
information, so it needs to build the InvalidRegistryValue exception itself
and raise it.

Closes: Sf#2985241

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
(cherry picked from commit ef8bd817e8)

Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
2010-04-19 01:00:02 -04:00
Daniel Folkinshteyn 35fee237da Undo mtughan's bugfix from 7f9a113060, so i can merge jamessan's fix ef8bd817e8 2010-04-19 00:53:40 -04:00
Daniel Folkinshteyn 022193b61b for Factoids: make approximate fuzzy key searches also when invoking whatis directly.
also add tests.
while there, remove useless config setting for replyinvalidcommand testing, since it is true by default.
2010-04-18 03:33:10 -04:00
Daniel Folkinshteyn b5058cc5c2 update Karma plugin and test code to use sqlite3.
This involved also updating src/conf.py to look for sqlite3 and add it to supybot.conf.databases list,
since karma uses the plugins.DB() constructor for its database, which checks the available databases list.
2010-04-18 02:10:29 -04:00
Daniel Folkinshteyn 814d89e200 topic now checks for +t mode before denying topic changes, and also allows halfops in addition to ops.
default required capabilities for topic changes (if topic is +t and user is not an op or halfop), are chan,op and chan,halfop
thanks jemfinch for the suggestions.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-04-14 22:57:01 -04:00
Daniel Folkinshteyn 063dd24677 change Topic to have a default required capability set, for all write operations.
by default, now only allows chanops, and users with admin or channel,op capability to change topics

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-04-14 22:56:52 -04:00
Daniel Folkinshteyn f880037e41 for Alias, make doc string say "at least x args" if there are optional args in addition to required args.
yay for cosmetic improvements. :)

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-04-14 22:29:58 -04:00
Daniel Folkinshteyn 8d64d08645 fix alias bug https://sourceforge.net/tracker/?func=detail&aid=2987147&group_id=58965&atid=489447
add tests for appropriate behavior

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
2010-04-14 22:25:40 -04:00
Daniel Folkinshteyn 4890e2e80d for Alias, make doc string say "at least x args" if there are optional args in addition to required args.
yay for cosmetic improvements. :)
2010-04-14 10:56:39 -04:00
Daniel Folkinshteyn aa634e6da1 fix alias bug https://sourceforge.net/tracker/?func=detail&aid=2987147&group_id=58965&atid=489447
add tests for appropriate behavior
2010-04-14 10:27:56 -04:00
Daniel Folkinshteyn 5e162a28f7 make google translate return detailed google error, instead of the unhelpful "we broke google". 2010-04-11 18:27:39 -04:00
Daniel Folkinshteyn 127b3cfabd for google translate, error if destination language is 'auto'. 2010-04-11 17:37:09 -04:00