[Pkg-privacy-commits] [irssi-plugin-otr] 139/267: Change listing contexts output format

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:26:26 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 4aefe1cde3eddf6c42055182332c81a8cd8ad01e
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Wed Nov 14 21:31:42 2012 -0500

    Change listing contexts output format
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/cmd.c | 43 ++++++++++++++++++++++++++++++++++++-------
 1 file changed, 36 insertions(+), 7 deletions(-)

diff --git a/src/cmd.c b/src/cmd.c
index 2404b4f..87198aa 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -229,17 +229,46 @@ static void _cmd_contexts(struct otr_user_state *ustate, SERVER_REC *irssi,
 		goto end;
 	}
 
-	while (ctxlist) {
-		otr_infost(TXT_CTX_CTX_UNENCRYPTED + ctxlist->state, ctxlist->username,
-				ctxlist->accountname);
+	IRSSI_MSG("%UAccount%n - %UUser%n - %UStatus%n - "
+			"%UFingerprint%n - %UTrust%n");
 
+	while (ctxlist) {
 		fplist = ctxlist->fplist;
-		while (fplist) {
-			otr_infost(TXT_CTX_FPS_NO + fplist->authby, fplist->fp);
-			fplist = fplist->next;
-		}
+
+		switch (ctxlist->state) {
+		case STENCRYPTED:
+			IRSSI_MSG("%9%s%9 - %B%s%n - %GEncrypted%n", ctxlist->accountname,
+					ctxlist->username);
+			break;
+		case STUNENCRYPTED:
+			IRSSI_MSG("%9%s%9 - %B%s%n - Plaintext", ctxlist->accountname,
+					ctxlist->username);
+			break;
+		case STFINISHED:
+			IRSSI_MSG("%9%s%9 - %B%s%n - %yFinished%n", ctxlist->accountname,
+					ctxlist->username);
+			break;
+		case STUNKNOWN:
+			IRSSI_MSG("%9%s%9 - %B%s%n - Unknown", ctxlist->accountname,
+					ctxlist->username);
+			break;
+		};
+
+		switch (fplist->authby) {
+		case NOAUTH:
+			IRSSI_MSG("%r%s%n - Unverified", fplist->fp);
+			break;
+		case AUTHSMP:
+			IRSSI_MSG("%g%s%n - SMP", fplist->fp);
+			break;
+		case AUTHMAN:
+			IRSSI_MSG("%g%s%n - Manual", fplist->fp);
+			break;
+		};
+
 		ctxlist = ctxlist->next;
 	}
+
 	while ((ctxlist = ctxnext)) {
 		ctxnext = ctxlist->next;
 		fpnext = ctxlist->fplist;

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