Bug#335525: please add quiet/dequiet commands

2005-10-24 Thread Robert Millan
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-6GNU C Library: Shared libraries an
ii  libglib2.0-0  2.8.1-1The GLib library of C routines
ii  libncurses5   5.4-9  Shared libraries for terminal hand
ii  libperl5.85.8.7-6Shared Perl library
ii  libssl0.9.7   0.9.7g-2   SSL shared libraries
ii  perl  5.8.7-6Larry Wall's Practical Extraction 
ii  perl-base [perlapi-5.8.7] 5.8.7-6The 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.0 +0100
+++ irssi-text-0.8.9/src/irc/core/modes.c	2005-10-24 15:09:08.0 +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);
 }


Bug#335525: please add quiet/dequiet commands

2005-10-24 Thread David Pashley
On Oct 24, 2005 at 14:28, Robert Millan praised the llamas by saying:
 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.
 

Can this not be done with:

/alias quiet /mode +q
/alias dequiet /mode -q


-- 
David Pashley
[EMAIL PROTECTED]
Nihil curo de ista tua stulta superstitione.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#335525: please add quiet/dequiet commands

2005-10-24 Thread Robert Millan
tags 335525 - patch
thanks

On Mon, Oct 24, 2005 at 04:46:49PM +0100, David Pashley wrote:
 On Oct 24, 2005 at 14:28, Robert Millan praised the llamas by saying:
  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.
  
 
 Can this not be done with:
 
 /alias quiet /mode +q
 /alias dequiet /mode -q

Uhm actualy, it seems my patch (or these alias) don't do exactly what I wanted.
What I'd like if for /quiet (or /mode +q) to benefit from the same nick-netmask
expansion that /ban has:

/ban nick  --  18:41 -!- mode/#channel [+b [EMAIL PROTECTED] by op
/mode +q nick  --  18:41 -!- mode/#channel [+b [EMAIL PROTECTED] by op

Note the different resulting netmask in both cases.

Also, note that in the latter case, +b is printed (I'm not sure why).
However, +q is what actualy takes effect.

-- 
Robert Millan


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]