[Pkg-privacy-commits] [irssi-plugin-otr] 175/267: Add irssi help for the otr command

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:41:40 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 f534a8df41021426474d0c874e3b8b3d07b136ce
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Sun Dec 2 14:21:29 2012 -0500

    Add irssi help for the otr command
    
    /otr help and /help otr are the same.
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 Makefile.am      |   3 +-
 configure.ac     |   1 +
 help/Makefile.am |   3 ++
 help/otr         | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/Makefile.am  |   3 --
 src/cmd.c        |  15 +++++++-
 6 files changed, 132 insertions(+), 5 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index edc6ea3..0848f05 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,4 +2,5 @@ AM_CFLAGS = $(PACKAGE_CFLAGS)
 
 ACLOCAL_AMFLAGS = -I config
 
-SUBDIRS = src
+SUBDIRS = help \
+		  src
diff --git a/configure.ac b/configure.ac
index ce03fcd..230c6e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,6 +76,7 @@ AC_SUBST(IRSSI_MODULE_DIR)
 
 AC_CONFIG_FILES([
 	Makefile
+	help/Makefile
 	src/Makefile
 ])
 
diff --git a/help/Makefile.am b/help/Makefile.am
new file mode 100644
index 0000000..389b855
--- /dev/null
+++ b/help/Makefile.am
@@ -0,0 +1,3 @@
+helpdir = $(prefix)/share/irssi/help
+help_DATA = otr
+
diff --git a/help/otr b/help/otr
new file mode 100644
index 0000000..02a0276
--- /dev/null
+++ b/help/otr
@@ -0,0 +1,112 @@
+
+OTR %|[OPTION]
+
+Command to control the OTR module. Without an option, this help is printed.
+
+This help contains three sections which are %9options, quickstart and files.%n
+
+To add the OTR status bar (highly recommended):
+
+%9/statusbar window add otr%n
+
+%9Options:%n
+
+AUTH <secret>
+    Start or respond to an authentication process.
+
+AUTHQ [<[question]>] <secret>
+    Start a SMP authentication process. The question MUST be enclosed in
+    brackets and followed by the secret with at least one white space between
+    the question and secret.
+
+    Example: %9/otr authq [My question is] rest is the secret%n
+
+AUTHABORT
+    Abort an ongoing authentication process.
+
+CONTEXTS
+    List known contexts which basically list the known fingerprints and their
+    state.
+
+DEBUG
+    Turn on debugging.
+
+DISTRUST [<fp>]
+    Distrust a specific fingerprint. This command can be done inside a private
+    window for which the current fingerprint of the other person will be used
+    or else set fp to a human readable OTR fingerprint available with the above
+    contexts command.
+
+    Examples: %9/otr distrust 487FFADA 5073FEDD C5AB5C14 5BB6C1FF 6D40D48A%n
+
+FINISH
+    End the OTR session. This MUST be done inside a private conversation
+    window.
+
+FORGET [<fp>]
+    Forget a specific fingerprint (deleted from the known fingerprints). The
+    behavior is the same as the distrust command explained above.
+
+GENKEY <nickname>@<im.server.net>
+    Generate OTR keys for a given account name. This is done automatically
+    if someone tries to establish a secure session.
+
+    This process is done in a background thread and can take an arbitrary
+    amount of time. The completion is checked when another irssi event is
+    catched. Unfortunately, for technical reasons, the thread can't notify the
+    irssi main window so a status check is done at each irssi events and a
+    message is printed if the key is ready.
+
+HELP
+    Print this help.
+
+INIT
+    Initialize an OTR conversation within a private conversation window.
+
+TRUST [<fp>]
+    Trust a specific fingerprint. The behavior is the same as the forget and
+    distrust commands explained above.
+
+VERSION
+    Print the version of the OTR module.
+
+%9Quickstart:%n
+
+Start a private conversation with the person you want to initiate a secure
+session. Once in the private message window:
+
+%9/otr init%n
+
+Key generation should start if no key is found for your account name. Once the
+process is done, either type a message which should automatically start the
+session or redo the init command.
+
+Time to authenticate the person. Either use a shared secret exchange through
+phone or GPG-signed email or use the socialist millionaire problem mechanism
+(SMP) which is basically to ask a question for which the answer can only be
+known by the other person.
+
+%9/otr auth <shared-secret>%n OR %9/otr authq [A question] <shared-secret>%n
+
+Or to respond to an authentication:
+
+%9/otr auth <secret>%n
+
+%9Files:%n
+
+This otr modules creates a directory in %9$HOME/.irssi/otr%n and creates three
+files:
+
+* %9otr.key%n
+    Contains your OTR private key(s). NEVER shared this directory with someone
+    else unless you know what you are doing.
+
+* %9otr.fp%n
+    The known fingerprints with their _trust_ status.
+
+* %9otr.instag
+    Instance tag of the libotr. This should NEVER be copied to an other
+    computer. If unsure, just ignore this file.
+
+For more information on OTR, see http://www.cypherpunks.ca/otr/
+
diff --git a/src/Makefile.am b/src/Makefile.am
index ff6d93d..b46a31d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,9 +23,6 @@ otr_la_SOURCES = otr-formats.c otr-formats.h \
 otr_la_LDFLAGS = -avoid-version -module
 otr_la_LDFLAGS += $(LIBOTR_LIBS) $(LIBGCRYPT_LIBS) -lpthread
 
-install-exec-hook:
-	mkdir -p $(plugindir)
-
 install-data-hook:
 	rm $(plugindir)/otr.la
 	mv $(plugindir)/otr.so $(plugindir)/libotr.so
diff --git a/src/cmd.c b/src/cmd.c
index 5f6e233..fc07978 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -19,7 +19,9 @@
  * Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
  */
 
+#define _GNU_SOURCE
 #include <assert.h>
+#include <stdio.h>
 
 #include "cmd.h"
 #include "key.h"
@@ -53,7 +55,18 @@ static void _cmd_version(struct otr_user_state *ustate, SERVER_REC *irssi,
 static void _cmd_help(struct otr_user_state *ustate, SERVER_REC *irssi,
 		const char *target, const void *data)
 {
-	/* TODO: Add help message. */
+	int ret;
+	char *cmd_line;
+
+	ret = asprintf(&cmd_line, "%sHELP otr", settings_get_str("cmdchars"));
+	if (ret < 0) {
+		return;
+	}
+
+	/* Call /help otr instread of duplicating the text output. */
+	signal_emit("send command", 3, cmd_line, irssi, NULL);
+
+	free(cmd_line);
 }
 
 /*

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