summaryrefslogtreecommitdiff
path: root/lib/rbot
AgeCommit message (Collapse)Author
2021-06-09fix: webservice dispatch syntax checkGiuseppe Bilotta
Early bailout if the command field is not specified in the POST request. (Not doing this actually leads to an exception in the subsequent debug because command is an Array and it can't be added to a String, but ayway the early catch is cleaner error handling.) Also add a TODO about a potential improvement for permission error handling.
2021-06-09fix: webservice message user typeGiuseppe Bilotta
When the user logs in, m.source is already a botuser.
2021-06-05bot: reorder fork sequenceGiuseppe Bilotta
We do the actual fork as the last step, after redirecting the standard I/O streams. This also ensures that no log messages are shown on console _after_ forking.
2021-06-05logger: don't actually close the console loggerGiuseppe Bilotta
We nil the internal variable, but we should not close the logger itself, since this leads to STDERR being closed and the interpreter reopening it for its own needs, or something like that, which ultimately leads to the interpreter's warning appearing in console (probably due to ruby itself reopening stderr to be able to output the messages). If we simply nil the variable, the interpreter is content with sending us the messages per our shenanigangs, and everything works just as expected.
2021-06-05fix: write override behaviorGiuseppe Bilotta
IO.write() takes an arbitrary number of argumens, that are converted to string and joined on write. We should behave the same way. Moreover, the returned value is the number of bytes, and this is bytesize in modern Ruby.
2021-06-05fix: restore logging of session start/endGiuseppe Bilotta
2021-06-05logger: fix STDERR recursionGiuseppe Bilotta
Overriding (as we should do) the standard error write method when daemonizing introduces a recursion in the logger, due to the persistent presence of the console logger. The solution is obviously to stop logging on console after daemonization.
2021-06-05fix: stderr vs stdout write overrideGiuseppe Bilotta
In 96d13521d the STDOUT/STDERR write overrides were replaced by overrides to $stdout, but the second should have been to $stderr (obviously).
2021-05-29fix: restart logger thread after forkGiuseppe Bilotta
Logging was broken when daemonizing, due to the logger thread being dead after the fork. This can be solved by restarting the thread, if necessary when setting the log file (which we conveniently do right after the fork).
2021-05-29fix: preserve loglevels across options and filesGiuseppe Bilotta
2021-05-29Catch another non-standard errorGiuseppe Bilotta
2020-04-24refactor: remove global bot instance, closes #42Matthias Hecker
2020-04-22ensures the path reported by gems does existsMatthias Hecker
2020-04-16core: sets plugin_path to loaded pluginsMatthias Hecker
While loading a plugin in the manager using #load_botmodule_file this will remember the directory of the file that is being loaded in @next_plugin_path. In the plugin/BotModule initialization we set the path in plugin_path of the plugin. This was the only solution I could find to get this information in the plugin. It is useful because this allows the plugin to know in which directory it is located, it can then easily access data files stored alongside the plugin. Some built-in plugins (see #42) use the data/rbot/templates to copy data files on bot load (see #repopulate_botclass_directory) into the profile directory (~/.rbot/).
2020-04-15refactor: wordlist shouldn't use bot singleton #35Matthias Hecker
also related to #41 and #6
2020-04-15refactor: remove unused userdata moduleMatthias Hecker
I never saw a plugin use this feature besides wof, IRC user objects should not hold persistent data like this, I rather have the IRC interface clean. The general idea is a good though, especially easier per-channel, per-user data persistence.
2020-04-14fix nick renaming during connectionMatthias Hecker
2020-04-14refactor: httputil no longer core module see #38Matthias Hecker
This is intended to make testing/mocking of the http client easier.
2020-04-14httputil: remove obsolete version_1_2 declarationMatthias Hecker
2020-04-14remove obsolete require of net/httpsMatthias Hecker
2020-04-13message: add #thanks method, similar to okayMatthias Hecker
2020-04-08fix: in-memory registry persist correctlyMatthias Hecker
2020-04-06plugin(points): +/- must come after, closes #34Matthias Hecker
This modifies the karma/points plugin to ignore increment/ decrement suffixes. `--SOMETHING` is more trouble than its worth, people will write --NAME as a signature, or paste a command line argument, e.g. `ls --sort time` which causes issues. I also added tests for the points plugin, the plan is to make the plugin testing easier more "rubionic"
2020-04-06registry: add in-memory implementation for testsMatthias Hecker
2020-04-06fix: gettext updated each_textdomain > each_text_domainsMatthias Hecker
2020-04-03plugin(search): fix wolfram and gdef, removed someMatthias Hecker
this removes gcount and gtime from the search plugin, google no longer provides this information easily
2020-04-02plugin(search): fix search and gcalc, closes #28, #29Matthias Hecker
2020-03-31refactor: logger moved away from ircbot (exp.)Matthias Hecker
This moves the logger management thread/queue to a seperate singleton. It removes the explicit stopping/restarting of the logging thread since the thread should behave like a daemon thread anyway. Still needs to be tested to work in daemonize.
2020-03-29fix: plugins delegate disregarding all options givenMatthias Hecker
2020-03-28always log to stdout with debug flagMatthias Hecker
This makes it so the -d debug flag on the rbot command line will always log to STDOUT, previously it would just force the log level.
2020-03-27gem: support for newest ruby versionsMatthias Hecker
2020-03-27Merge pull request #4 from ahpook/rename_karmaMatthias Hecker
Rename and improve karma plugin
2016-03-25fixes registry for 2.3.0, bug caused by wrong #get_implMatthias Hecker
previously getimpl returned eigenclasses aswell which always was an issue but i guess a minor change in ruby triggered this.
2015-12-15Renames the 'karma' plugin to a 'points' systemEric Sorenson
Prior to this commit, rbot used a "karma" system for keeping track of user points. This phrasing, while widespread, is unnecessarily appropriationist. This commit renames the plugin to a more neutral "points" system, accomplishing exactly the same goal without using culturally problematic language. For more background please read: http://bit.ly/1MfLmce
2015-07-04webservice: add erb template render methodsMatthias Hecker
2015-07-04journal: introduce ensure_payload_indexMatthias Hecker
2015-07-04journal: wrap postgres client in single threadMatthias Hecker
2015-06-24journal: move journal accessor in coremoduleMatthias Hecker
2015-06-21journal: simplified irc loggingMatthias Hecker
2015-06-21journal: irc logging moduleMatthias Hecker
2015-06-20journal: allow hash/proc for query in count and removeMatthias Hecker
2015-06-20journal: start with core botmodule, api changesMatthias Hecker
2015-06-15journal: add mongodb storage backendMatthias Hecker
2015-06-15journal: cleanupMatthias Hecker
2015-06-14journal, integrated in botMatthias Hecker
2015-06-14journal: even more testsMatthias Hecker
2015-06-14journal: more postgres testsMatthias Hecker
2015-06-14journal: finishing postgres adapterMatthias Hecker
2015-06-14journal: started implementing postgres storageMatthias Hecker
2015-06-14journal: unsubscribe addedMatthias Hecker