mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
/msg on dashed nicks #265398 15/04/19 04:08 PM
Joined: Oct 2003
Posts: 214
S
Sephiroth_ Offline OP
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 214
Hiho,

since 7.53 (or higher) /msg doesn't work for Nicks starting with a dash (bouncers for example), it just returns insufficient parameters error.

Code:
/!msg -sBNC Message => * /msg: insufficient parameters
/!say works => > works
/!me works fine too. => * me works fine too.
/!describe -sBNC works too => * me works too
/!notice -sBNC Message => -> --sBNC- Message


Just updated from 7.52 to 7.55. Not sure which version it startet, but it worked fine on 7.52.

It also works fine, when entering the text at the Querys Editbox.

It appears like it is because of the changes on 7.53 #23, line splitting.

Greetings.


one step closer to world domination
Re: /msg on dashed nicks [Re: Sephiroth_] #265399 15/04/19 08:51 PM
Joined: Jan 2004
Posts: 1,178
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,178
Another workaround may be 7.53's changelog:

20.Added /privmsg command.

Re: /msg on dashed nicks [Re: Sephiroth_] #265400 16/04/19 01:38 AM
Joined: Feb 2003
Posts: 2,642
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,642
mIRC now anticipates the presence of command switches for /msg. Command switches begin with a dash.

The work-around is simple, though. Use a blank command switch.

/msg - -FooBar Hello -Foobar, you have an invalid nickname!


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: /msg on dashed nicks [Re: Raccoon] #265403 16/04/19 09:09 AM
Joined: Aug 2003
Posts: 236
P
Protopia Offline
Fjord artisan
Offline
Fjord artisan
P
Joined: Aug 2003
Posts: 236
This is an issue of backwards compatibility.

I am unclear why it ever worked in 7.52 if /msg had switches in that release.

I am unclear whether use of e.g. "/msg $nick message" works when $nick is e.g. -sBNC. It may be that mIRC can already or can be made to substitute for standard identifiers that are known to contain nicknames after handling switches, but substitute everything else before i.e. "/msg %switches $nick message" works whether %switches is empty or not and regardless of whether $nick starts with a -.

The issue here is that there are hundreds of scripts which use /msg and expect to continue work with all valid user names even those starting with -.

Re: /msg on dashed nicks [Re: Protopia] #265404 16/04/19 09:33 AM
Joined: Jan 2004
Posts: 1,178
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,178
The other question is what switches are being recognized, as none are documented. I did see that "/msg -n #channelname message" minimizes the channel along with sending the message.

Re: /msg on dashed nicks [Re: Sephiroth_] #265405 16/04/19 09:59 AM
Joined: Dec 2002
Posts: 4,521
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,521
Thanks for your bug report.

mIRC has supported a /msg -s switch since v3.9 but only if it was exactly "-s". Awful design decision. But someone requested -s support and I am guessing we were worried that adding -switch support would result in the issue currently being reported.

The /msg routine is also used by /query to send a message and/or open a window. /query supports combinations of switches -nxmd. Prior to 7.52, it supported only -n.

When I was updating /msg and /query in v7.52, I must have decided to merge support for these switches together for consistency and predictability, which has caused the current issue.

I will revert these changes in the next version. This means that /msg will go back to working how it did before: -s will still be a switch but any other "-" prefixed word will be treated as a nickname. This also means that /query will no longer support -s.

In retrospect, I should have made all /commands treat "-" as a switch if it was the first parameter, even if they did not support any switches, to make behaviour predictable. As this was not done, extending non-switch commands with new switches/features without breaking scripts just leads to issues like this one.

Re: /msg on dashed nicks [Re: maroon] #265406 16/04/19 01:47 PM
Joined: Dec 2002
Posts: 4,521
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,521
Quote:
I did see that "/msg -n #channelname message" minimizes the channel along with sending the message.

If I make the changes suggested in my above post, this will no longer work in the next beta. Any scripts that use /msg -n will break since -n will be treated as a nickname.

On the other hand, I could make it work by supporting switches -snxmd only if combinations of those letters are used. If any other letters are used, the parameter would be treated as a nickname.

Either way, a compromise has to made - either to support the new switches or to unsupport them and revert to pre-v7.52 compatibility - including the support for -s, which would still be an issue for scripts.

Basically, there is no good solution to this. We need to pick the least worst option.

Re: /msg on dashed nicks [Re: Protopia] #265407 16/04/19 02:50 PM
Joined: Feb 2003
Posts: 2,642
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,642
Originally Posted By: Protopia
The issue here is that there are hundreds of scripts which use /msg and expect to continue work with all valid user names even those starting with -.

Nicknames beginning with '-' are not valid nicknames, and never will be, for this very reason. mIRC can't be expected to always work with shotty BNC implimentations that don't conform to IRC specification. IRC specification states that nicknames shalt not begin with a hyphen.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: /msg on dashed nicks [Re: Raccoon] #265408 16/04/19 03:16 PM
Joined: Dec 2002
Posts: 4,521
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,521
Quote:
Nicknames beginning with '-' are not valid nicknames

Good point. I am guessing that BNCs use non-valid nicknames so that they don't collide with nicknames on the IRC server. So the issue with /msg and -switches support will likely only be an issue with users who use certain BNCs. Does that make sense?

Also, /describe and /notice work in the above case only because no one has ever asked for a -switchable feature for them. If someone did, and it was added, they would have the same issue.

Re: /msg on dashed nicks [Re: Khaled] #265410 16/04/19 05:13 PM
Joined: Apr 2004
Posts: 840
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 840
Originally Posted By: Khaled
So the issue with /msg and -switches support will likely only be an issue with users who use certain BNCs.

Right now, yes. I don't necessarily agree with Raccoon's "never will be", though. After all, at some point in the past, IRCnet decided that nicknames could start with a digit after all. Similar messed-up decisions may be taken by IRC networks in the future.


Saturn, QuakeNet staff
Re: /msg on dashed nicks [Re: Sat] #265411 16/04/19 05:50 PM
Joined: Jul 2006
Posts: 3,559
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,559
But this issue with /msg is part of a bigger picture, for /msg it's ok, there are others commands to send a message. The problem is building script around $nick and such. An update of IRC to allow for nickname starting with a number would lead to scripts breaking, stuff like $nick() takes a nickname or a number for the same parameter.
I've written thousand of quick 'nick registration/login' systems for picture games in mIRC, where you don't rely on $me but on something entered by the user via $input or something, if you are not aware of this problem and validate a nick such as 0nick, you'll get in troubles, easily.
To me, the script language relies on nickname not starting with digit and not starting with a dash, so with that in mind and for consistency, "/msg -nick message" should be interpreted as switches and return an error.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: /msg on dashed nicks [Re: Sat] #265414 17/04/19 12:48 PM
Joined: Dec 2002
Posts: 4,521
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,521
Quote:
Right now, yes.

Well, the IRC protocol is all we have to work with. It would be impossible to implement an IRC client in a way that supports an unknown future protocol with unknown changes.

The support for /msg and /query -snxmd the way it is currently implemented is the ideal method.

One alternative, where any combination of the letters -snxmd is treated as a switch, and any -otherletters are treated as a nickname, is unpredictable and would make the situation worse. It would allow 120 possible combinations (which would increase if new switches were added) of -snxmd that would not be treated as nicknames.

Another alternative, to revert to pre-7.52 behaviours, and remove support for these switches, would return the behaviours to how they were, with /msg -s and /query -s/-n being supported. This still has the issue in that "-s" and "-n" are special letter combinations that are not treated as nicknames.

Since this issue only seems to affect users who /msg non-valid nicknames, specifically BNCs, we could accept breaking backwards compatibility and require that BNC scripts be updated.

Re: /msg on dashed nicks [Re: Khaled] #265416 17/04/19 04:44 PM
Joined: Apr 2004
Posts: 840
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 840
Originally Posted By: Khaled
Well, the IRC protocol is all we have to work with. It would be impossible to implement an IRC client in a way that supports an unknown future protocol with unknown changes.

Agreed. However, it is an argument in favor of exactly the approach you favor as well, namely to be as consistent as possible, so that scripts can deal with such a new situation in a well-defined way as well (eg by using "/msg - $nick message" everywhere).

However, I think there is one last option that should be mentioned just as a possibility. There are very few such nicknames used by BNC software. I can think of "-psyBNC" and "-sBNC" only; maybe there's a handful in total. mIRC *could* treat *just* those cases as nicknames, as whitelisted exceptions. Then, assuming all those names contain "BNC", perhaps the "-B" switch (or so) could be reserved as never-to-be-added for those commands, so as to prevent that a valid combination of switches ever ends up forming one of those whitelisted exceptions.


Saturn, QuakeNet staff
Re: /msg on dashed nicks [Re: Sat] #265417 18/04/19 01:43 AM
Joined: Feb 2003
Posts: 2,642
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,642
There are a lot of things possible. I'm happy with mIRC just breaking for invalid nicks, but if Khaled is really bored he could add a check before failing "not enough parameters" if there are 2 params, treating the first param as nickname and the second param as message.

I think it'd boring to mess with this and just call make mIRC break so that BNC software fixes it on their end. SBNC should use asterisk instead of hyphen, like ZNC does.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: /msg on dashed nicks [Re: Sat] #265418 18/04/19 10:47 AM
Joined: Dec 2002
Posts: 4,521
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,521
Quote:
However, I think there is one last option that should be mentioned just as a possibility. There are very few such nicknames used by BNC software. I can think of "-psyBNC" and "-sBNC" only; maybe there's a handful in total. mIRC *could* treat *just* those cases as nicknames

You know, I considered this and discounted it as too kludgey. But looking at it again, this might actually be the least worst option in this case. Assuming that "-" is not a valid prefix for nicknames, and that only a handful of BNCs use invalid -nicknames, we could just whitelist them. This would enable backwards compatibility for existing scripts but would force new scripts that try to use different invalid -nicknames, which is unlikely anyway, to use the -switch prefix.

Re: /msg on dashed nicks [Re: Khaled] #265419 18/04/19 07:20 PM
Joined: Aug 2003
Posts: 236
P
Protopia Offline
Fjord artisan
Offline
Fjord artisan
P
Joined: Aug 2003
Posts: 236
Hmm - it appears from a simple test (on DALnet - other networks may be different) that you cannot have a user nick that starts with a "-".

/nick -abc
-abc Erroneous Nickname

If this is generally true, then as previously commented, such nicks will be system nicks and an explicit whitelist (which might need to be a combination of network and nick) could be the solution.

Re: /msg on dashed nicks [Re: Protopia] #265420 18/04/19 07:25 PM
Joined: Aug 2003
Posts: 236
P
Protopia Offline
Fjord artisan
Offline
Fjord artisan
P
Joined: Aug 2003
Posts: 236
I think if you are going to have such a whitelist, it probably needs to have an Options UI to allow users to add their local userids.

But we could perhaps have an initial list populated with the known such instances.

(So - now something which affects a small group of users needs a UI. Such is the nature of corner cases.)

Re: /msg on dashed nicks [Re: Protopia] #265421 18/04/19 07:36 PM
Joined: Dec 2002
Posts: 4,521
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,521
Quote:
I think if you are going to have such a whitelist, it probably needs to have an Options UI to allow users to add their local userids.

This is an internal backwards compatibility fix, not a feature :-] No plans to add a GUI for this.

Re: /msg on dashed nicks [Re: Protopia] #265422 18/04/19 07:43 PM
Joined: Apr 2004
Posts: 840
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 840
Originally Posted By: Protopia
Hmm - it appears from a simple test (on DALnet - other networks may be different) that you cannot have a user nick that starts with a "-".

You might want to take a look at the rest of this thread.


Saturn, QuakeNet staff
Re: /msg on dashed nicks [Re: Raccoon] #265423 18/04/19 07:49 PM
Joined: Apr 2004
Posts: 840
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 840
Originally Posted By: Raccoon
[..] add a check before failing "not enough parameters" if there are 2 params, treating the first param as nickname and the second param as message.

Just for completeness: this does not work nearly as well as all the other proposed solutions, because for at least shroudBNC, not all commands consist of only one word.


Saturn, QuakeNet staff
Page 1 of 2 1 2