diff --git a/COMPATIBILITY.txt b/COMPATIBILITY.txt index 14d27b2..c41aadd 100644 --- a/COMPATIBILITY.txt +++ b/COMPATIBILITY.txt @@ -1,8 +1,10 @@ Everything works: Hexchat - Mango IRC (ads) - AndroIRC (ads) + Mango IRC + AndroIRC + Lite IRC + HoloIRC Mutter Weechat @@ -14,17 +16,7 @@ Usable, with bugs: - still occurs even without blank nicks in room privmsgs Unusable: - Lite IRC (ads) - - sends USER /then/ NICK instead of the other way around, handshake fails - 2016/05/07 22:57:04 <<< :nmdc-ircfrontend 375 :- Message of the day - - 2016/05/07 22:57:04 <<< :nmdc-ircfrontend 372 :- Connected to nmdc-ircfrontend. You /must/ join #chat to continue. - 2016/05/07 22:57:04 <<< :nmdc-ircfrontend 376 :- End of MOTD - 2016/05/07 22:57:04 >>> 'USER' [pineapple420 0 * :first last] - 2016/05/07 22:57:04 <<< :Your nickname is already being used KILL A - 2016/05/07 22:57:04 >>> 'NICK' [pineapple420] - 2016/05/07 22:57:04 Broken loop. - - some patches in place, needs retesting Yaaic/Atomic - doesn't properly understand/parse the room join Atomic - - crashes if a blank nick is used for room privmsgs (but PtokaX is fine) \ No newline at end of file + - crashes if a blank nick is used for room privmsgs (but PtokaX is fine) diff --git a/TODO.txt b/TODO.txt index 1b69493..ef3e365 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,5 +1,12 @@ +- Not always detecting CTCP version?? + +2016/05/08 13:53:15 >>> 'NOTICE' [PtokaX VERSION :Relay:1.0:Android] +2016/05/08 13:53:15 <<< :pokehub.info 404 holoirc PtokaX :Cannot send to channel + + + WISHLIST ======== @@ -10,6 +17,8 @@ WISHLIST - support changing nick (via reconnecting) - support USERHOST (used by androirc) + 2016/05/08 13:43:55 >>> 'USERHOST' [squirtle90] + 2016/05/08 13:43:55 <<< :pokehub.info 421 squirtle90 USERHOST :Unknown command - support WHOX diff --git a/server.go b/server.go index 994d7ec..16de3c1 100644 --- a/server.go +++ b/server.go @@ -419,6 +419,11 @@ func (s *Server) handleRegisteredCommand(command string, args []string) { func (s *Server) SetClientSoftwareVersion(ver string) { // "HexChat 2.12.1 [x64] / Microsoft Windows 10 Pro (x64) [Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz (3.60GHz)]" + // "AndroIRC - Android IRC Client (5.2 - Build 6830152) - http://www.androirc.com" + // "AndChat 1.4.3.2 http://www.andchat.net" + // "liteIRC for Android 1.1.8" + // ":Relay:1.0:Android" + // A bit long and unwieldy. Heuristic: stop after the first word containing digits parts := regexp.MustCompilePOSIX("^([^0-9]*[0-9]+[^ ]*) ").FindStringSubmatch(ver) @@ -461,21 +466,24 @@ func (s *Server) handleJoinedCommand(command string, args []string) { return } - if s.upstream == nil || s.upstream.State != libnmdc.CONNECTIONSTATE_CONNECTED { - s.reply(errCannotSend, args[0]) - return - } - message := strings.Join(args[1:], " ")[1:] // strip leading colon if strings.HasPrefix(message, "\x01VERSION ") { // Not a real message - a reply to our internal request. Change the user's tag to match the actual client software + // This /can/ actually be done regardless of whether we're truely connected yet, since the request is triggered + // by an incoming PM which means even though we might not be in CONNECTIONSTATE_CONNECTED, it's probably far-enough + // that an extra upstream $MyINFO won't hurt versionString := message[9:] versionString = versionString[:len(versionString)-1] s.SetClientSoftwareVersion(versionString) return } + if s.upstream == nil || s.upstream.State != libnmdc.CONNECTIONSTATE_CONNECTED { + s.reply(errCannotSend, args[0]) + return + } + if strings.HasPrefix(message, "\x01ACTION ") { message = "/me " + message[8:] message = message[:len(message)-1] // trailing \x01