KittehOrg / KittehIRCClientLib

An IRC client library in Java
https://kitteh.dev/kicl/
MIT License
146 stars 35 forks source link

Under certain conditions getClient().getServerInfo().getAddress().get() will return more information than desired #180

Closed trixpan closed 7 years ago

trixpan commented 7 years ago

while testing a basic KICL listener with miniircd the result of getClient().getServerInfo().getAddress().get() will include Server version data, which is IMNSHO a bit counter intuitive.

While I appreciate the server side is likely to blame, it would be great if KICL provided a method to obtain the IP address and port of the remote endpoint.

mbax commented 7 years ago

Yeah, KICL is expecting the server address followed by the server version in 004 - https://tools.ietf.org/html/rfc2812#section-5.1

I was only aware of Twitchs hacky IRCd not playing as expected. Is there another?

trixpan commented 7 years ago

@mbax I would guess so.

The following message is raised:

org.kitteh.irc.client.library.exception.KittehServerMessageException: Error processing message: Server version missing.. Messages: :dev.lab 004 NiFi :dev.lab miniircd-1.1 o o

I am fairly certain the blame is on the server end, however, due to this KICL ends up returning getAddress().get()

dev.lab miniircd-1.1 o o

mbax commented 7 years ago

Interesting! I'll go submit a PR.

mbax commented 7 years ago

PR submitted. https://github.com/jrosdahl/miniircd/pull/26

mbax commented 7 years ago

PR accepted.