[Pkg-privacy-commits] [irssi-plugin-otr] 126/267: OTR encrypted state check on /otr init

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:26:24 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 4eb5681dbb1c2f24e4ad843af752bb59388537be
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Mon Nov 12 18:08:23 2012 -0500

    OTR encrypted state check on /otr init
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/cmd.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/cmd.c b/src/cmd.c
index b603b51..7edc1b7 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -221,6 +221,7 @@ static void _cmd_init(struct otr_user_state *ustate, SERVER_REC *irssi, int argc
 		char *argv[], char *argv_eol[], char *target, const char *orig_args)
 {
 	char *msg;
+	ConnContext *ctx;
 
 	/* No server object, just ignore the request */
 	if (!irssi || !target) {
@@ -228,6 +229,12 @@ static void _cmd_init(struct otr_user_state *ustate, SERVER_REC *irssi, int argc
 		goto end;
 	}
 
+	ctx = otr_find_context(irssi, target, 0);
+	if (ctx && ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED) {
+		IRSSI_NOTICE(irssi, target, "%9OTR%9: Already secure!");
+		goto end;
+	}
+
 	IRSSI_NOTICE(irssi, target, "%9OTR%9: Initiating OTR session...");
 
 	msg = otrl_proto_default_query_msg(target, OTRL_POLICY_DEFAULT);

-- 
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