[Pkg-privacy-commits] [irssi-plugin-otr] 138/267: Remove unused code

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:41:36 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 0242a70c15e163a31997d09679195c18a6ed8ee3
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Wed Nov 14 20:22:01 2012 -0500

    Remove unused code
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/Makefile.am |  2 +-
 src/io-config.h |  3 ---
 src/io_set.c    | 63 ---------------------------------------------------------
 src/irssi_otr.h | 15 --------------
 src/otr.c       |  4 ++--
 src/otr.h       |  9 ---------
 src/utils.c     | 31 ----------------------------
 src/utils.h     | 13 ------------
 8 files changed, 3 insertions(+), 137 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index ec795e2..cc17f4c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -15,6 +15,6 @@ INCLUDES = -I$(top_srcdir)/src $(IRSSI_INCLUDE)
 
 lib_LTLIBRARIES = libotr.la
 
-libotr_la_SOURCES = key.c key.h cmd.c cmd.h otr.c otr-ops.c io_set.c \
+libotr_la_SOURCES = key.c key.h cmd.c cmd.h otr.c otr-ops.c \
 					utils.h utils.c otr.h module.c irssi_otr.h \
 					otr-formats.c otr-formats.h
diff --git a/src/io-config.h b/src/io-config.h
deleted file mode 100644
index 950502b..0000000
--- a/src/io-config.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define HAVE_STRSIGNAL
-#define HAVE_GREGEX_H
-#define IRCOTR_VERSION "git-fd11e699d9cb8d2f230251b23c037f1fd6372e14"
diff --git a/src/io_set.c b/src/io_set.c
deleted file mode 100644
index b0a1a01..0000000
--- a/src/io_set.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Off-the-Record Messaging (OTR) modules for IRC
- * Copyright (C) 2009  Uli Meis <a.sporto+bee at gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
- */
-#if 0
-#include "otr.h"
-
-#ifdef HAVE_GREGEX_H
-extern GRegex *regex_nickignore;
-#endif
-
-char set_policy[512] = OTR_DEFAULT_POLICY;
-char set_policy_known[512] = OTR_DEFAULT_POLICY_KNOWN;
-char set_ignore[512] = OTR_DEFAULT_IGNORE;
-int set_finishonunload = TRUE;
-
-void cmd_set(IOUSTATE *ioustate, IRC_CTX *ircctx, int argc, char *argv[], char *argv_eol[],
-	    char *target) {
-	char *setting, *value;
-
-	if (argc) {
-		setting = argv[0];
-		value = argv[1] ? : "";
-	}
-
-	if (!argc) {
-		otr_logst(MSGLEVEL_CRAP,"policy: %s\n"
-			  "policy_known: %s\nignore: %s\n"
-			  "finishonunload: %s\n",
-			  set_policy,set_policy_known,set_ignore,
-			  set_finishonunload ? "true" : "false");
-	} else if (strcmp(setting,"policy")==0) {
-		otr_setpolicies(ioustate,value,FALSE);
-		strcpy(set_policy,value);
-	} else if (strcmp(setting,"policy_known")==0) {
-		otr_setpolicies(ioustate,value,TRUE);
-		strcpy(set_policy_known,value);
-	} else if (strcmp(setting,"ignore")==0) {
-#ifdef HAVE_GREGEX_H
-		if (regex_nickignore)
-			g_regex_unref(regex_nickignore);
-		regex_nickignore = g_regex_new(value,0,0,NULL);
-		strcpy(set_ignore,value);
-#endif
-	} else if (strcmp(setting,"finishonunload")==0) {
-		set_finishonunload = (strcasecmp(value,"true")==0);
-	}
-}
-#endif
diff --git a/src/irssi_otr.h b/src/irssi_otr.h
index a11807b..af14592 100644
--- a/src/irssi_otr.h
+++ b/src/irssi_otr.h
@@ -41,21 +41,6 @@
 
 #define get_client_config_dir get_irssi_dir
 
-static SERVER_REC *IRSSI_DUP(SERVER_REC *ircctx) __attribute__ ((unused));
-
-static SERVER_REC *IRSSI_DUP(SERVER_REC *ircctx) {
-	server_ref(ircctx);
-	return ircctx;
-}
-
-static SERVER_REC *IRSSI_FREE(SERVER_REC *ircctx) __attribute__ ((unused));
-
-static SERVER_REC *IRSSI_FREE(SERVER_REC *ircctx)
-{
-	server_unref(ircctx);
-	return ircctx;
-}
-
 #define IRSSI_CONN_ADDR(i) i->connrec->address
 #define IRSSI_NICK(i) i->nick
 
diff --git a/src/otr.c b/src/otr.c
index c45b3d7..24fa635 100644
--- a/src/otr.c
+++ b/src/otr.c
@@ -748,8 +748,8 @@ int otr_getstatus(SERVER_REC *irssi, const char *nick)
 		code = IO_ST_FINISHED;
 		break;
 	default:
-		IRSSI_INFO(irssi, nick,
-				"BUG Found! Please write us a mail and describe how you got here");
+		IRSSI_WARN(irssi, nick, "BUG Found! "
+				"Please write us a mail and describe how you got here");
 		code = IO_ST_UNKNOWN;
 		break;
 	}
diff --git a/src/otr.h b/src/otr.h
index 60cad2a..281f440 100644
--- a/src/otr.h
+++ b/src/otr.h
@@ -26,7 +26,6 @@
 #include <libotr/context.h>
 #include <libotr/privkey.h>
 
-#include "io-config.h"
 #include "irssi_otr.h"
 #include "utils.h"
 
@@ -55,14 +54,6 @@
 #define OTR_DEFAULT_POLICY_KNOWN      "* always"
 #define OTR_DEFAULT_IGNORE            "xmlconsole[0-9]*"
 
-/* used as a prefix for /me messages.
- * This makes it readable and sensible for
- * people not on IRC (i.e. in case of a gateway
- * like bitlbee)
- */
-#define IRCACTIONMARK                 "/me "
-#define IRCACTIONMARKLEN              4
-
 /*
  * Memory allocation zeroed. Really useful!
  */
diff --git a/src/utils.c b/src/utils.c
index be3d299..43b331d 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -24,11 +24,6 @@
 #include "otr.h"
 #include "utils.h"
 
-static const char *lvlstring[] = {
-	"NOTICE",
-	"DEBUG"
-};
-
 /*
  * Left trim a string.
  */
@@ -252,32 +247,6 @@ error:
 	return;
 }
 
-void otr_log(SERVER_REC *server, const char *nick, int lvl, const char *fmt, ...)
-{
-	va_list params;
-	va_start(params, fmt);
-	char msg[LOGMAX], *s = msg;
-
-	if ((lvl == LVL_DEBUG) && !debug) {
-		return;
-	}
-
-	s += sprintf(s, "%s", "%9OTR%9");
-
-	if (lvl != LVL_NOTICE) {
-		s += sprintf(s, "(%s)", lvlstring[lvl]);
-	}
-
-	s += sprintf(s, ": ");
-
-	if (vsnprintf(s, LOGMAX, fmt, params ) < 0) {
-		sprintf(s, "internal error parsing error string (BUG)");
-	}
-	va_end(params);
-
-	printtext(server, nick, MSGLEVEL_MSGS, msg);
-}
-
 void utils_string_to_upper(char *string)
 {
 	int i = 0;
diff --git a/src/utils.h b/src/utils.h
index 82567f6..ef48e24 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -21,19 +21,6 @@
 #ifndef IRSSI_OTR_UTILS_H
 #define IRSSI_OTR_UTILS_H
 
-/*
- * Max size of a log message.
- */
-#define LOGMAX      1024
-
-#define LVL_NOTICE  0
-#define LVL_DEBUG   1
-
-#define otr_logst(level, fmt, ...) \
-	otr_log(NULL, NULL, level, fmt, ## __VA_ARGS__)
-
-void otr_log(SERVER_REC *server, const char *to, int lvl, const char *fmt, ...);
-
 void utils_free_args(char ***argv, int argc);
 void utils_extract_command(const char *data, char **_cmd);
 void utils_explode_args(const char *_data, char ***_argv, int *_argc);

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