more edge cases for client tag sync

--HG--
branch : nmdc-ircfrontend
This commit is contained in:
. 2016-05-08 13:57:57 +12:00
parent 7715044d66
commit 64a8d32d5e
3 changed files with 27 additions and 18 deletions

View File

@ -1,8 +1,10 @@
Everything works: Everything works:
Hexchat Hexchat
Mango IRC (ads) Mango IRC
AndroIRC (ads) AndroIRC
Lite IRC
HoloIRC
Mutter Mutter
Weechat Weechat
@ -14,17 +16,7 @@ Usable, with bugs:
- still occurs even without blank nicks in room privmsgs - still occurs even without blank nicks in room privmsgs
Unusable: 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 Yaaic/Atomic
- doesn't properly understand/parse the room join - doesn't properly understand/parse the room join
Atomic Atomic
- crashes if a blank nick is used for room privmsgs (but PtokaX is fine) - crashes if a blank nick is used for room privmsgs (but PtokaX is fine)

View File

@ -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 WISHLIST
======== ========
@ -10,6 +17,8 @@ WISHLIST
- support changing nick (via reconnecting) - support changing nick (via reconnecting)
- support USERHOST (used by androirc) - 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 - support WHOX

View File

@ -419,6 +419,11 @@ func (s *Server) handleRegisteredCommand(command string, args []string) {
func (s *Server) SetClientSoftwareVersion(ver 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)]" // "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 // A bit long and unwieldy. Heuristic: stop after the first word containing digits
parts := regexp.MustCompilePOSIX("^([^0-9]*[0-9]+[^ ]*) ").FindStringSubmatch(ver) parts := regexp.MustCompilePOSIX("^([^0-9]*[0-9]+[^ ]*) ").FindStringSubmatch(ver)
@ -461,21 +466,24 @@ func (s *Server) handleJoinedCommand(command string, args []string) {
return 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 message := strings.Join(args[1:], " ")[1:] // strip leading colon
if strings.HasPrefix(message, "\x01VERSION ") { 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 // 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 := message[9:]
versionString = versionString[:len(versionString)-1] versionString = versionString[:len(versionString)-1]
s.SetClientSoftwareVersion(versionString) s.SetClientSoftwareVersion(versionString)
return return
} }
if s.upstream == nil || s.upstream.State != libnmdc.CONNECTIONSTATE_CONNECTED {
s.reply(errCannotSend, args[0])
return
}
if strings.HasPrefix(message, "\x01ACTION ") { if strings.HasPrefix(message, "\x01ACTION ") {
message = "/me " + message[8:] message = "/me " + message[8:]
message = message[:len(message)-1] // trailing \x01 message = message[:len(message)-1] // trailing \x01