Package: irssi-text
Version: 0.8.9-3.1
Severity: wishlist
Tags: patch

In freenode, there's +q mode in addition to +v.  This mode "quiets" someone
independently on wether the channel is moderated.

Attached patch implements /quiet and /dequiet aliases for this command.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-k7
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ANSI_X3.4-1968) (ignored: LC_ALL 
set to C)

Versions of packages irssi-text depends on:
ii  libc6                         2.3.5-6    GNU C Library: Shared libraries an
ii  libglib2.0-0                  2.8.1-1    The GLib library of C routines
ii  libncurses5                   5.4-9      Shared libraries for terminal hand
ii  libperl5.8                    5.8.7-6    Shared Perl library
ii  libssl0.9.7                   0.9.7g-2   SSL shared libraries
ii  perl                          5.8.7-6    Larry Wall's Practical Extraction 
ii  perl-base [perlapi-5.8.7]     5.8.7-6    The Pathologically Eclectic Rubbis

irssi-text recommends no packages.

-- no debconf information
diff -ur irssi-text-0.8.9.old/src/irc/core/modes.c irssi-text-0.8.9/src/irc/core/modes.c
--- irssi-text-0.8.9.old/src/irc/core/modes.c	2002-12-09 23:00:02.000000000 +0100
+++ irssi-text-0.8.9/src/irc/core/modes.c	2005-10-24 15:09:08.000000000 +0200
@@ -715,6 +715,36 @@
 	g_free_not_null(nicks);
 }
 
+/* SYNTAX: QUIET <nicks> */
+static void cmd_quiet(const char *data, IRC_SERVER_REC *server,
+		      WI_ITEM_REC *item)
+{
+        IRC_CHANNEL_REC *channel;
+	char *nicks;
+
+        CMD_IRC_SERVER(server);
+
+	nicks = get_nicks(server, item, data, 0, 0, &channel);
+	if (nicks != NULL && *nicks != '\0')
+		channel_set_singlemode(channel, nicks, "+q");
+	g_free_not_null(nicks);
+}
+
+/* SYNTAX: DEQUIET <nicks> */
+static void cmd_dequiet(const char *data, IRC_SERVER_REC *server,
+			WI_ITEM_REC *item)
+{
+        IRC_CHANNEL_REC *channel;
+	char *nicks;
+
+        CMD_IRC_SERVER(server);
+
+	nicks = get_nicks(server, item, data, -1, 1, &channel);
+	if (nicks != NULL && *nicks != '\0')
+		channel_set_singlemode(channel, nicks, "-q");
+	g_free_not_null(nicks);
+}
+
 /* SYNTAX: MODE <your nick>|<channel> [<mode> [<mode parameters>]] */
 static void cmd_mode(const char *data, IRC_SERVER_REC *server,
 		     IRC_CHANNEL_REC *channel)
@@ -778,6 +808,8 @@
 	command_bind_irc("deop", NULL, (SIGNAL_FUNC) cmd_deop);
 	command_bind_irc("voice", NULL, (SIGNAL_FUNC) cmd_voice);
 	command_bind_irc("devoice", NULL, (SIGNAL_FUNC) cmd_devoice);
+	command_bind_irc("quiet", NULL, (SIGNAL_FUNC) cmd_quiet);
+	command_bind_irc("dequiet", NULL, (SIGNAL_FUNC) cmd_dequiet);
 	command_bind_irc("mode", NULL, (SIGNAL_FUNC) cmd_mode);
 
 	command_set_options("op", "yes");
@@ -796,5 +828,7 @@
 	command_unbind("deop", (SIGNAL_FUNC) cmd_deop);
 	command_unbind("voice", (SIGNAL_FUNC) cmd_voice);
 	command_unbind("devoice", (SIGNAL_FUNC) cmd_devoice);
+	command_unbind("quiet", (SIGNAL_FUNC) cmd_quiet);
+	command_unbind("dequiet", (SIGNAL_FUNC) cmd_dequiet);
 	command_unbind("mode", (SIGNAL_FUNC) cmd_mode);
 }

Reply via email to