mIRC Home    About    Download    Register    News    Help

Print Thread
channel voice / op -- You must specify a parameter #267269 02/05/20 11:11 PM
Joined: May 2005
Posts: 30
Z
Zedrick Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: May 2005
Posts: 30
On mIRC when you voice devoice and op deop yourself or another user when using the mIRC control function it says:

#channel v * You must specify a parameter for the voice mode. Syntax: <nick>.
#channel o * You must specify a parameter for the op mode. Syntax: <nick>.

This happens on InspIRCd 3 but does not happen on InspIRCd 2

mIRC when you are a channel op
right click on yourself or another person in the list of users in the channel.
Control -> voice / op - to voice and op the user.

And same for devoice / deop

It does give you the voice and op modes and removes them.

When you voice and op using /mode #channel + nick -- it does not get this message.


On InspIRCd they say -- This is a bug in mIRC. It's sending a bunch of extraneous prefix mode changes without any values which is triggering the syntax hint.

Re: channel voice / op -- You must specify a parameter [Re: Zedrick] #267270 02/05/20 11:20 PM
Joined: Jan 2004
Posts: 1,300
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,300
Can you mention a network where this happens? Or, create a @debug monitoring window to see the exact mode command being sent my mirc?

Re: channel voice / op -- You must specify a parameter [Re: maroon] #267271 02/05/20 11:57 PM
Joined: May 2005
Posts: 30
Z
Zedrick Offline OP
Ameglian cow
OP Offline
Ameglian cow
Z
Joined: May 2005
Posts: 30
debug:

server.name MODE #channel +vvv nick
<- @time=2020-05-02T23:53:53.126Z :server.name 696 nick #channel v * :You must specify a parameter for the voice mode. Syntax: <nick>.

Re: channel voice / op -- You must specify a parameter [Re: Zedrick] #267272 03/05/20 02:00 AM
Joined: Jan 2004
Posts: 1,300
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,300
That is a bug by the ircd which rejects a command which has been accepted for years. The outbound command comes from the popups.ini command:

.Voice:/mode # +vvv $$1 $2 $3

Since only 1 nick is highlighted, the $2 and $3 are null. The 2nd and 3rd 'v' mode should be ignored in the absence of a 2nd and 3rd nick. To placate an ircd which doesn't accept a voice command which has been valid for decades, the line in popups.ini would need to be replaced with:

.Voice:/mode # + $+ $str(v,$0) $$1 $2 $3

This replacement changes the command to have the v replicated to match the number of nicks following it. You could even replace append $4 $5 $6 depending on how many mode commands can be stacked together at the networks you use.

Re: channel voice / op -- You must specify a parameter [Re: Zedrick] #267274 04/05/20 09:35 AM
Joined: Dec 2002
Posts: 4,727
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,727
Thanks for your bug report.

As maroon pointed out, the commands in the default popup menus in mIRC have been the same for a long time, probably about 20+ years, and have always worked without any issues. They are in almost every copy of mIRC that has ever been installed, so they are very much a core feature.

I can understand why the InspIRCd developers thought this would be a useful change, as it does provide feedback on excess parameters, but it breaks with how all other ircds have always worked, ie. excess parameters are ignored.

I can change the popup commands to use the format suggested by maroon in the next release but this issue would still be present in every existing installation of mIRC going back 20+ years for users on InspIRCd servers.

Re: channel voice / op -- You must specify a parameter [Re: Khaled] #267276 04/05/20 09:55 PM
Joined: Feb 2011
Posts: 343
K
KindOne Offline
Fjord artisan
Offline
Fjord artisan
K
Joined: Feb 2011
Posts: 343


irc.swiftirc.net #msl (mIRC Scripting Language)
Re: channel voice / op -- You must specify a parameter [Re: Khaled] #267277 05/05/20 06:43 AM
Joined: May 2010
Posts: 45
B
BenderUnit Offline
Ameglian cow
Offline
Ameglian cow
B
Joined: May 2010
Posts: 45
Well, you gotta start somewhere.

If you are going to change this in the way maroon proposed, then you may as well also want to grab this opportunity to increase the number of parameters up to like for example $6, as some networks accept more than 3 parameters per MODE. So instead of "$$1 $2 $3", make it "$$1 $2 $3 $4 $5 $6". Hell, why not even just "$$1-" and its good forever.

Code
.Op:/mode # + $+ $str(o,$0) $$1-
.Deop:/mode # - $+ $str(o,$0) $$1-
.Voice:/mode # + $+ $str(v,$0) $$1-
.Devoice:/mode # - $+ $str(v,$0) $$1-


By the way, not only popups.ini has this issue, but aliases.ini as well.

Code
/op /mode # + $+ $str(o,$0) $$1-
/dop /mode # - $+ $str(o,$0) $$1-

Re: channel voice / op -- You must specify a parameter [Re: KindOne] #267278 05/05/20 09:23 AM
Joined: Dec 2002
Posts: 4,727
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,727
Thanks for the github link. Unfortunately, it does not look like this change will be reverted.

For users who upgrade: I could make the next release of mIRC scan all of a user's scripts and popups on startup to the find the six specific lines that contain /mode with +ooo and +vvv, in aliases and popups, and replace them.

However, as aliases and popups are customizable, if a user has made any changes to these lines, the fix cannot be applied. If a user has created any new aliases or popups based on these, using a similar format, the fix cannot be applied.

As these aliases and popups have existed for so long, they are probably also used in many examples on the internet.

I will also have to look through the help and FAQs files as there may be examples in them that need to be updated.

For users who do not upgrade (which will likely apply to many users): the issue will persist.

Although the ircd developer's reply on github states that this is an mIRC issue because mIRC is depending on broken server behaviour, this has actually always been standard ircd behaviour. mIRC was using this command format in 1995, many years before the first version of InspIRCd was released.

This is also not a bug in InspIRCd, so much as an intentional, potentially useful change.

The issue is simply one of consideration and backward compatibility with long-established behaviour.

Re: channel voice / op -- You must specify a parameter [Re: BenderUnit] #267279 05/05/20 09:33 AM
Joined: Dec 2002
Posts: 4,727
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,727
Quote
f you are going to change this in the way maroon proposed, then you may as well also want to grab this opportunity to increase the number of parameters up to like for example $6, as some networks accept more than 3 parameters per MODE. So instead of "$$1 $2 $3", make it "$$1 $2 $3 $4 $5 $6". Hell, why not even just "$$1-" and its good forever.

If I recall correctly, this will break on networks that do not support more than three parameters for /mode. That is the reason it has always been limited to three.

To make this work, the numbers of parameters would need to be based on the "MODES" token in the CAP event and would involve a loop to iterate through all of the selected nicks to build multiple /mode requests, eg. if a user tries to op ten nicknames in the nickname list.

The aliases and popups were always intended as simple examples to help users learn about IRC and scripting.

That said, they have not been updated in a long time. If anyone has any ideas on changing the default aliases and popups to make them more useful and/or elaborate, I'd be open to updating them.

Re: channel voice / op -- You must specify a parameter [Re: Khaled] #267280 05/05/20 10:43 AM
Joined: Apr 2004
Posts: 847
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 847
Originally Posted by Khaled
[..] and would involve a loop to iterate through all of the selected nicks to build multiple /mode requests, [..]

I wouldn't bother with that part. These aliases/popups have always clearly been intended to be basic. People who do heavy-duty channel management have long found more capable scripts as replacement, and that's just fine, I think.

Keep in mind that maroon's suggestion also produces more 'v' characters than nicknames when more than three nicknames are selected, which I'm sure will also trigger errors on that "I don't know the difference between de facto standards and bugs" person's ircd. At minimum, it would need something like $min($0,3) instead of just $0, which would be a good opportunity to add $min/$max. smile

FWIW, use of $modespl would end up looking somewhat like this (also assuming the existence of a $min, otherwise $iif can be used):

Code
.Voice:/var %count = $min($0,$modespl) | /mode # + $+ $str(v,%count) $$1- [ $+ [ %count ] ]

This can be made shorter, but probably not less unreadable?


Saturn, QuakeNet staff
Re: channel voice / op -- You must specify a parameter [Re: Sat] #267281 05/05/20 01:52 PM
Joined: Jan 2004
Posts: 1,300
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,300
For non-scriptors and newbies at it, using the square braces can be beyond their ability to understand them. So even though it's a little bit longer, it can also change

Code
from
.Voice:/var %count = $min($0,$modespl) | /mode # + $+ $str(v,%count) $$1- [ $+ [ %count ] ]
to
.Voice:/var %count = $min($0,$modespl) | /mode # + $+ $str(v,%count) $gettok($$1-,1- %count,32)



Also, if aliases.ini is supposed to be basic alias examples, the above alias uses $min, so if $min and $max are not going to be added as basic math $identifiers, they could be added as basic examples for aliases.ini, based on the simple example in...

https://forums.mirc.com/ubbthreads.php/topics/42298/re-min-challenge#Post42298

Code
min { return $gettok($sorttok($1-,32,n ),1,32) }
max { return $gettok($sorttok($1-,32,nr),1,32) }

Re: channel voice / op -- You must specify a parameter [Re: maroon] #267308 17/05/20 08:33 PM
Joined: Dec 2002
Posts: 4,727
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,727
Thanks for the suggested popups.

Not sure how I missed this but... the purpose of numeric 696 is only to report missing mode parameters. All other valid modes in the mode request are still applied. This means that a client can ignore/hide the 696 numeric and everything will continue to work in the same way as on all other ircds, where the standard, long-established behaviour is to not report errors in this context.

I will be changing the next beta so that it ignores/hides this numeric, however it will still trigger a remote event so that scripts can detect it if they want to.

Re: channel voice / op -- You must specify a parameter [Re: Khaled] #267309 17/05/20 08:51 PM
Joined: Jan 2004
Posts: 1,300
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,300
It just dawned on me that, maybe it's not a good idea to create a popup having a dependency on an item in aliases.ini, since the give-ops command would stop working if aliases.ini got restored to an older version. The min/max aliases are simple enough that the give-ops command could change $min($0,$modespl) to instead be:

$gettok($sorttok($0 $modespl,32,n ),1,32)

Even if the popups isn't changed, the example aliases in aliases.ini is something that could be updated. The last time they were updated is probably earlier than the last time the favorites list was updated. Yay #windows95