This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Character ~ in the IRC /whois reply

Old posts that have not been replied to for several years.
Locked
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Character ~ in the IRC /whois reply

Post by arfer »

Sometimes a /whois will give the reply (for example) :-

nick is ~somebody@somewhere.com

and sometimes :-

nick is somebody@somewhere.com

i need to deal with the ~ programmatically, so i wonder if i could get an explanation of what it is/does?

something to do with ident i suspect
k
kic
Voice
Posts: 3
Joined: Mon Jan 10, 2005 7:13 pm
Contact:

Re: Character ~ in the IRC /whois reply

Post by kic »

arfer wrote:Sometimes a /whois will give the reply (for example) :-

nick is ~somebody@somewhere.com

and sometimes :-

nick is somebody@somewhere.com

i need to deal with the ~ programmatically, so i wonder if i could get an explanation of what it is/does?

something to do with ident i suspect
All it is, is the lack of an 'ident' server on the shell machine.
Most IRC Servers nowadays require an ident response from users.

If the machine the bot is running on, does not have an ident server running, or the irc server is unable to connect to it, the IRC server will set the users hostmask as ~ident@domain.com

if the machine DOES have an ident server running, AND the irc server is able to contact it, it will set the users hostmask as ident@domain.com without the ~

Anyways, essentially if you want to take this into account when scripting
and matching hostmasks, you can effectively match up the hostmask with wildcards. for example, if in the userfile the bot has a +host for a user
as: *!*someone@this.users.vhost.com

Then these two hostmasks would be valid:
someone@this.users.vhost.com
~someone@this.users.vhost.com

However, if in the bots user file +host entry looks like this:
*!someone@this.users.vhost.com

Then only someone@this.users.vhost.com hostmask would match,
and ~someone@this.users.vhost.com hostmask would NOT match.

Hope that explains it a bit.
-kic
bling
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

arfer wrote:i need to deal with the ~ programmatically
Take a look at this post by user for an example of dealing with tildes (~) in hostmasks.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

It doesn't even matter. If you use tcl to process the user@host, you can use the string trimleft function and trim out the "~" if it exists or not. That way you can be safe.

Code: Select all

set uhost [string trimleft [lindex [split $uhost "@"] 0] "~"]@[lindex [split $uhost "@"] 1]
Or say maybe you can make it detect if {[string index $uhost 0] == "~"} then go ahead and string map it and replace it by an "*" wildcard or do what ever you want. There are many ways to check and deal with this.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Just a thanks re the ~

Post by arfer »

Once again guys .. most helpful

Cheers
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

No problemo. :)
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked