ergochat / irc-go

Libraries to help with IRC development in Go.
ISC License
41 stars 6 forks source link

yet another NUH-parsing branch #67

Closed slingamn closed 2 years ago

slingamn commented 2 years ago

This tries to compromise between #58 and #66:

  1. As in #58, partial NUHs (including bare nicks) are parsed, and server names are parsed into NUH.Name (i.e. they are considered to be the first component of the NUH)
  2. The component is called NUH.Name instead of NUH.Nick (reflecting that it may be a server name instead of a nick)
  3. As in #66, expose the new unified NUH-parsing code to ircmsg and ircevent. (This makes ircevent.ExtractNick and ircevent.SplitNUH more permissive, in that, e.g., ExtractNick will now return a server name if the source is a server name.)
  4. The most confusing thing here is that the new method of ircmsg.Message is named Nick, not Name. This is inconsistent with NUH.Name. I thought it was justified because, e.g. msg.Nick() is pretty clear but msg.Name() is confusing to read.