[Pkg-privacy-commits] [irssi-plugin-otr] 177/267: Remove IRSSI_WARN which caused a print problem

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 6e27eab6cb1c37b391b0b63ab02a5aa7a15c8919
Author: David Goulet <dgoulet at ev0ke.net>
Date:   Sun Dec 2 15:02:46 2012 -0500

    Remove IRSSI_WARN which caused a print problem
    
    Signed-off-by: David Goulet <dgoulet at ev0ke.net>
---
 src/cmd.c       | 12 +++++++-----
 src/irssi-otr.h |  5 -----
 src/otr-ops.c   | 22 +++++++++++-----------
 src/otr.c       |  2 +-
 4 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/src/cmd.c b/src/cmd.c
index fc07978..55ca0b0 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -76,7 +76,7 @@ static void _cmd_finish(struct otr_user_state *ustate, SERVER_REC *irssi,
 		const char *target, const void *data)
 {
 	if (!irssi || !target) {
-		IRSSI_WARN(irssi, target,
+		IRSSI_NOTICE(irssi, target,
 				"Failed: Can't get nick and server of current query window. "
 				"(Or maybe you're doing this in the status window?)");
 		goto end;
@@ -126,7 +126,7 @@ static void _cmd_authabort(struct otr_user_state *ustate, SERVER_REC *irssi,
 		const char *target, const void *data)
 {
 	if (!irssi || !target) {
-		IRSSI_WARN(irssi, target,
+		IRSSI_NOTICE(irssi, target,
 				"Failed: Can't get nick and server of current query window. "
 				"(Or maybe you're doing this in the status window?)");
 		goto end;
@@ -176,7 +176,7 @@ static void _cmd_authq(struct otr_user_state *ustate, SERVER_REC *irssi,
 	char *question = NULL, *secret = NULL;
 
 	if (!irssi || !target) {
-		IRSSI_WARN(irssi, target,
+		IRSSI_NOTICE(irssi, target,
 				"Failed: Can't get nick and server of current query window. "
 				"(Or maybe you're doing this in the status window?)");
 		goto end;
@@ -212,7 +212,7 @@ static void _cmd_auth(struct otr_user_state *ustate, SERVER_REC *irssi,
 	char *secret = NULL;
 
 	if (!irssi || !target) {
-		IRSSI_WARN(irssi, target,
+		IRSSI_NOTICE(irssi, target,
 				"Failed: Can't get nick and server of current query window. "
 				"(Or maybe you're doing this in the status window?)");
 		goto error;
@@ -250,7 +250,7 @@ static void _cmd_init(struct otr_user_state *ustate, SERVER_REC *irssi,
 
 	/* No server object, just ignore the request */
 	if (!irssi || !target) {
-		IRSSI_WARN(irssi, target,
+		IRSSI_NOTICE(irssi, target,
 				"Failed: Can't get nick and server of current query window. "
 				"(Or maybe you're doing this in the status window?)");
 		goto end;
@@ -375,6 +375,8 @@ void cmd_generic(struct otr_user_state *ustate, SERVER_REC *irssi,
 		}
 	} while ((++commands)->name);
 
+	IRSSI_NOTICE(irssi, target, "Unknown command %9%s%n", cmd);
+
 end:
 	return;
 }
diff --git a/src/irssi-otr.h b/src/irssi-otr.h
index 0823294..95a62f0 100644
--- a/src/irssi-otr.h
+++ b/src/irssi-otr.h
@@ -67,11 +67,6 @@
 		printtext(irssi, username, MSGLEVEL_MSGS, OTR_IRSSI_MSG_PREFIX fmt, \
 						## __VA_ARGS__);                                    \
 	} while (0)
-#define IRSSI_WARN(irssi, username, fmt, ...)                               \
-	do {                                                                    \
-		printtext(irssi, username, MSGLEVEL_HILIGHT,                        \
-				OTR_IRSSI_MSG_PREFIX fmt, ## __VA_ARGS__);                  \
-	} while (0)
 #define IRSSI_DEBUG(fmt, ...) \
 	do {                                                                    \
 		if (debug) {                                                        \
diff --git a/src/otr-ops.c b/src/otr-ops.c
index 9364c14..f20d513 100644
--- a/src/otr-ops.c
+++ b/src/otr-ops.c
@@ -138,14 +138,14 @@ static void ops_handle_msg_event(void *opdata, OtrlMessageEvent msg_event,
 	case OTRL_MSGEVENT_NONE:
 		break;
 	case OTRL_MSGEVENT_ENCRYPTION_REQUIRED:
-		IRSSI_WARN(server, username, "%yEncryption is required.%n");
+		IRSSI_NOTICE(server, username, "%yEncryption is required.%n");
 		break;
 	case OTRL_MSGEVENT_ENCRYPTION_ERROR:
-		IRSSI_WARN(server, username, "An error occurred when "
+		IRSSI_NOTICE(server, username, "An error occurred when "
 				"encrypting your message. The message was NOT sent.");
 		break;
 	case OTRL_MSGEVENT_CONNECTION_ENDED:
-		IRSSI_WARN(server, username, "%9%s%9 has already closed the "
+		IRSSI_NOTICE(server, username, "%9%s%9 has already closed the "
 				"connection to you.", username);
 		break;
 	case OTRL_MSGEVENT_SETUP_ERROR:
@@ -154,17 +154,17 @@ static void ops_handle_msg_event(void *opdata, OtrlMessageEvent msg_event,
 		}
 		switch (err) {
 		case GPG_ERR_INV_VALUE:
-			IRSSI_WARN(server, username, "Error setting up private "
+			IRSSI_NOTICE(server, username, "Error setting up private "
 					"conversation: Malformed message received");
 			break;
 		default:
-			IRSSI_WARN(server, username, "Error up private "
+			IRSSI_NOTICE(server, username, "Error up private "
 					"conversation: %s", gcry_strerror(err));
 			break;
 		}
 		break;
 	case OTRL_MSGEVENT_MSG_REFLECTED:
-		IRSSI_WARN(server, username, "Receiving our own OTR messages. "
+		IRSSI_NOTICE(server, username, "Receiving our own OTR messages. "
 				"You are either trying to talk to yourself, or someone is "
 				"reflecting your messages back at you.");
 		break;
@@ -173,16 +173,16 @@ static void ops_handle_msg_event(void *opdata, OtrlMessageEvent msg_event,
 				"was resent: %s", username, message);
 		break;
 	case OTRL_MSGEVENT_RCVDMSG_NOT_IN_PRIVATE:
-		IRSSI_WARN(server, username, "The encrypted message received "
+		IRSSI_NOTICE(server, username, "The encrypted message received "
 				"from %s is unreadable, as you are not currently communicating "
 				"privately.", username);
 		break;
 	case OTRL_MSGEVENT_RCVDMSG_UNREADABLE:
-		IRSSI_WARN(server, username, "We received an unreadable "
+		IRSSI_NOTICE(server, username, "We received an unreadable "
 				"encrypted message from %s.", username);
 		break;
 	case OTRL_MSGEVENT_RCVDMSG_MALFORMED:
-		IRSSI_WARN(server, username, "We received a malformed data "
+		IRSSI_NOTICE(server, username, "We received a malformed data "
 				"message from %s.", username);
 		break;
 	case OTRL_MSGEVENT_LOG_HEARTBEAT_RCVD:
@@ -192,7 +192,7 @@ static void ops_handle_msg_event(void *opdata, OtrlMessageEvent msg_event,
 		IRSSI_DEBUG("Heartbeat sent to %s.", username);
 		break;
 	case OTRL_MSGEVENT_RCVDMSG_GENERAL_ERR:
-		IRSSI_WARN(server, username, "General Error: %s.", message);
+		IRSSI_NOTICE(server, username, "General Error: %s.", message);
 		break;
 	case OTRL_MSGEVENT_RCVDMSG_UNENCRYPTED:
 		IRSSI_NOTICE(server, username,
@@ -211,7 +211,7 @@ static void ops_handle_msg_event(void *opdata, OtrlMessageEvent msg_event,
 		signal_add_first("message private", (SIGNAL_FUNC) sig_message_private);
 		break;
 	case OTRL_MSGEVENT_RCVDMSG_UNRECOGNIZED:
-		IRSSI_WARN(server, username, "Unrecognized OTR message "
+		IRSSI_NOTICE(server, username, "Unrecognized OTR message "
 				"received from %s.", username);
 		break;
 	case OTRL_MSGEVENT_RCVDMSG_FOR_OTHER_INSTANCE:
diff --git a/src/otr.c b/src/otr.c
index b98141a..ee1d83e 100644
--- a/src/otr.c
+++ b/src/otr.c
@@ -784,7 +784,7 @@ enum otr_status_format otr_get_status_format(SERVER_REC *irssi,
 		code = TXT_STB_FINISHED;
 		break;
 	default:
-		IRSSI_WARN(irssi, nick, "BUG Found! "
+		IRSSI_NOTICE(irssi, nick, "BUG Found! "
 				"Please write us a mail and describe how you got here");
 		code = TXT_STB_UNKNOWN;
 		break;

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