[Pkg-privacy-commits] [irssi-plugin-otr] 135/267: Check if fingerprint is already trust/distrust on cmd

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:26:25 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 706fd7db07e5f9d3f3790e524bfc5ad94176db74
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Wed Nov 14 16:33:35 2012 -0500

    Check if fingerprint is already trust/distrust on cmd
    
    Doing two /otr trust back to back with the same fingerprint now prints a
    notice to the user. Same goes for /otr distrust.
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/otr.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/otr.c b/src/otr.c
index ad8d75d..062d7b8 100644
--- a/src/otr.c
+++ b/src/otr.c
@@ -421,6 +421,14 @@ void otr_trust(SERVER_REC *irssi, const char *nick, char *str_fp,
 	}
 
 	if (fp_trust) {
+		int ret;
+
+		ret = otrl_context_is_fingerprint_trusted(fp_trust);
+		if (ret) {
+			IRSSI_NOTICE(irssi, nick, "Already trusted!");
+			goto end;
+		}
+
 		/* Trust level is manual at this point. */
 		otrl_context_set_trust(fp_trust, "manual");
 		key_write_fingerprints(ustate);
@@ -434,8 +442,7 @@ void otr_trust(SERVER_REC *irssi, const char *nick, char *str_fp,
 				(str_fp != NULL) ? str_fp : peerfp);
 	}
 
-	IRSSI_DEBUG("Trust fingerprint: %s", (str_fp != NULL) ? str_fp : peerfp);
-
+end:
 error:
 	return;
 }
@@ -888,6 +895,7 @@ void otr_distrust(SERVER_REC *irssi, const char *nick, char *str_fp,
 		ret = otrl_context_is_fingerprint_trusted(fp_distrust);
 		if (!ret) {
 			/* Fingerprint already not trusted. Do nothing. */
+			IRSSI_NOTICE(irssi, nick, "Already not trusting it!");
 			goto end;
 		}
 
@@ -902,8 +910,6 @@ void otr_distrust(SERVER_REC *irssi, const char *nick, char *str_fp,
 				(str_fp != NULL) ? str_fp : fp);
 	}
 
-	IRSSI_DEBUG("Distrust fingerprint: %s", (str_fp != NULL) ? str_fp : fp);
-
 end:
 error:
 	return;

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