2

I have an IRC client application and I am currently trying to integrate it with google maps.

I am fairly new to android and hence I would like to know how to get ip address of the users in an channel.

Note: I am aware about /whois command but I would like to get ip address of all users so that I can locate them on map.

Could you please help me in this regard.

android.developer
  • 365
  • 3
  • 8
  • 18

2 Answers2

2

You can use WHO if I recall correctly. This will give a list of all users (full host + nicks in the form of nick!user@host. Do note that most IRC servers honor the user's privacy and enforce a network-wide +i umode, which effectively hides the IP address from the host.

If you know your server is not like that, WHO is your way to go.


Edit:
This isn't an android problem at all, this is purely an IRC protocol problem. As a user, you may query the channel for the users inside of it, to get information on them. That command is calle WHO. You use it as follows:

WHO <#channel>

And it will give you a list of all the users in this channel in the following format:

352 <channel> <user> <host> <server> <nick> <H|G>[*][@|+] :<hopcount> <real name>

From which you can filter out <host> which will contain the IP address (if not hidden) of the user <nick>.

Madara's Ghost
  • 172,118
  • 50
  • 264
  • 308
  • `+i` does NOT hide the IP address, it just hides you from WHO if the requesting user is not in the requested channel/doesn't share a channel with you. This part is actually not well defined by the RFC1459. (You can interpret that a `WHO #ChannelImNotIn` reports users with a common channel, or that only users without `i` are reported) – Johannes Kuhn Oct 09 '13 at 10:49
  • Note that many IRC servers will cloak or mask hostnames. This will be some form of one-way obfuscation or hashing of the hostname to prevent denial of service attacks and other misbehaviour. You cannot resolve the IP address of such a cloaked host, and should probably be aware of this fact before trying to get an IP of a user. – braindigitalis Oct 18 '16 at 07:23
0

Many IRC servers cloak or mask the user's hostname to prevent hacking as per my comment above. If however you have the correct IRC operator access you can issue commands which will show the unmasked hostname for a user. For example "WHO *@cloaked.hostname h" where cloaked.hostname is the cloaked host:

https://wiki.inspircd.org/Commands#.2FWHO_.5B_.5Bsearch-pattern.5D_.5BohurmaiMplf.5D_.5D

Note that different irc server software has different ways of approaching this problem, if hosts are cloaked.

Hope this helps!

braindigitalis
  • 524
  • 7
  • 19