[Pkg-privacy-commits] [irssi-plugin-otr] 48/267: Finish on /quit as well. Module unloading comes too late to handle that.
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 12:41:27 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch debian
in repository irssi-plugin-otr.
commit ca3b62bf5514acb50289653c7015cbed9707f5fd
Author: Uli Meis <a.sporto+bee at gmail.com>
Date: Mon Feb 2 20:46:52 2009 +0100
Finish on /quit as well. Module unloading comes too late to handle that.
---
irssi_otr.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/irssi_otr.c b/irssi_otr.c
index 69c4144..eb37fb7 100644
--- a/irssi_otr.c
+++ b/irssi_otr.c
@@ -264,6 +264,16 @@ static void cmd_contexts(const char *data, void *server, WI_ITEM_REC *item)
}
/*
+ * Optionally finish conversations on /quit. We're already doing this on unload
+ * but the quit handler terminates irc connections before unloading.
+ */
+static void cmd_quit(const char *data, void *server, WI_ITEM_REC *item)
+{
+ if (settings_get_bool("otr_finishonunload"))
+ otr_finishall();
+}
+
+/*
* otr statusbar
*/
static void otr_statusbar(struct SBAR_ITEM_REC *item, int get_size_only)
@@ -320,6 +330,8 @@ void otr_init(void)
command_bind("otr contexts", NULL, (SIGNAL_FUNC) cmd_contexts);
command_bind("otr version", NULL, (SIGNAL_FUNC) cmd_version);
+ command_bind_first("quit", NULL, (SIGNAL_FUNC) cmd_quit);
+
settings_add_str("otr", "otr_policy",IO_DEFAULT_POLICY);
settings_add_str("otr", "otr_policy_known",IO_DEFAULT_POLICY_KNOWN);
settings_add_str("otr", "otr_ignore",IO_DEFAULT_IGNORE);
@@ -357,6 +369,8 @@ void otr_deinit(void)
command_unbind("otr contexts", (SIGNAL_FUNC) cmd_contexts);
command_unbind("otr version", (SIGNAL_FUNC) cmd_version);
+ command_unbind("quit", (SIGNAL_FUNC) cmd_quit);
+
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
statusbar_item_unregister("otr");
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/irssi-plugin-otr.git
More information about the Pkg-privacy-commits
mailing list