[Pkg-privacy-commits] [irssi-plugin-otr] 249/267: Add /otr info command
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 12:26:38 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 f41c2c09dea715ac047766dacb4d7a9aced08a1d
Author: David Goulet <dgoulet at ev0ke.net>
Date: Mon Aug 5 08:06:38 2013 -0400
Add /otr info command
Close #28
Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
src/cmd.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/src/cmd.c b/src/cmd.c
index 55ca0b0..27833d3 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -338,6 +338,32 @@ error:
return;
}
+/*
+ * /otr info
+ */
+static void _cmd_info(struct otr_user_state *ustate, SERVER_REC *irssi,
+ const char *target, const void *data)
+{
+ unsigned int fp_found = 0;
+ char ownfp[OTRL_PRIVKEY_FPRINT_HUMAN_LEN];
+ ConnContext *ctx;
+
+ for (ctx = ustate->otr_state->context_root; ctx != NULL; ctx = ctx->next) {
+ if (ctx == ctx->m_context) {
+ otrl_privkey_fingerprint(user_state_global->otr_state, ownfp,
+ ctx->accountname, OTR_PROTOCOL_ID);
+ IRSSI_NOTICE(irssi, target, "%B%s%n fingerprint:",
+ ctx->accountname, ownfp);
+ IRSSI_NOTICE(irssi, target, "%g%s%n", ownfp);
+ fp_found = 1;
+ }
+ }
+
+ if (!fp_found) {
+ IRSSI_NOTICE(irssi, target, "No key found!");
+ }
+}
+
static struct irssi_commands cmds[] = {
{ "version", _cmd_version },
{ "debug", _cmd_debug },
@@ -352,6 +378,7 @@ static struct irssi_commands cmds[] = {
{ "authq", _cmd_authq },
{ "genkey", _cmd_genkey },
{ "contexts", _cmd_contexts },
+ { "info", _cmd_info },
{ NULL, NULL },
{ NULL, NULL }
};
--
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