Mercurial > irccd
changeset 31:50b7b5d287e8
Plugin history:
- Use file paramater (like hangman),
- Update documentation.
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 22 Feb 2016 13:25:31 +0100 |
parents | 1ea775153cdc |
children | b5906772bac0 |
files | plugins/history/history.js plugins/history/history.md |
diffstat | 2 files changed, 20 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/history/history.js Mon Feb 22 13:13:15 2016 +0100 +++ b/plugins/history/history.js Mon Feb 22 13:25:31 2016 +0100 @@ -54,8 +54,8 @@ { var p; - if (Plugin.config["path"] !== undefined) { - p = Util.format(Plugin.config["path"], { + if (Plugin.config["file"] !== undefined) { + p = Util.format(Plugin.config["file"], { "server": server.toString(), "channel": channel }); @@ -212,4 +212,4 @@ { for (var i = 0; i < list.length; ++i) write(server, channel, list[i]); -} \ No newline at end of file +}
--- a/plugins/history/history.md Mon Feb 22 13:13:15 2016 +0100 +++ b/plugins/history/history.md Mon Feb 22 13:25:31 2016 +0100 @@ -37,13 +37,23 @@ The following options are available under the `[plugin.history]` section: - - **path**: (string) path to the JSON file for saving information (Optional, default to cache directory). + - **file**: (string) path to the JSON file for saving information (Optional, default to cache directory). - **format-error**: (string) format when an internal error occured, - **format-seen**: (string) format for showing last seen, - **format-said**: (string) format for showing the last message, - **format-unknown**: (string) format when the user has never been seen, - **format-usage**: (strnig) format to show the plugin usage. +<div class="panel panel-warning"> + <div class="panel-heading">If you don't want to specify the **file** parameter, irccd will try to use the plugin cache + path, you must create it.</div> + <div class="panel-body"> +````nohighlight +$ mkdir -p ~/.cache/irccd/plugin/history +```` + </div> +</div> + ### Keywords supported The following keywords are supported: @@ -51,14 +61,19 @@ | Format | Keywords | Notes | |-------------------------|-----------------------------------|---------------------------------| | (any) | server, channel, nickname, origin | | -| **path** | server, channel | does not support (any) | +| **file** | server, channel | does not support (any) | | **format-seen** | target, (date) | target is the specified nick | | **format-said** | target, message, (date) | | | **format-unknown** | target | | Example: +<div class="panel panel-info"> + <div class="panel-heading">~/.config/irccd/irccd.conf</div> + <div class="panel-body"> ````ini [plugin.history] format-seen = "#{target} has been seen on #{channel} the last time on: %d/%m/%Y %H:%M" ```` + </div> +</div>