Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a555dbd563 | |||
| f076aeaeda | |||
| 1056493211 | |||
| ddcd65fa47 | |||
| d21b18fc75 | |||
| 53b72e0cb0 | |||
| 839dea016a | |||
| e235ee014e | |||
|
|
c54a271f17 |
2
.hgtags
2
.hgtags
@@ -1,3 +1,5 @@
|
|||||||
da295cede46d95848348292e04e54fa5a5713ae3 release-1.0.0
|
da295cede46d95848348292e04e54fa5a5713ae3 release-1.0.0
|
||||||
34892054c34384edeafa2b04a483697d7d8a73a3 release-1.1.0
|
34892054c34384edeafa2b04a483697d7d8a73a3 release-1.1.0
|
||||||
3586b48a5abfdbdeef310f2e154b06f4d16d38bb release-1.2.0
|
3586b48a5abfdbdeef310f2e154b06f4d16d38bb release-1.2.0
|
||||||
|
49dcc63e80e98f8c2ce3bb029fe0c41a6426678f release-1.2.1
|
||||||
|
111d6e41507dd0f374860b936d18a651a7cb09ce release-1.2.2
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ Tags: nmdc, AGPLv3
|
|||||||
|
|
||||||
=COMPATIBILITY=
|
=COMPATIBILITY=
|
||||||
|
|
||||||
|
*This section was last updated on or around the release of 1.2.0. Current compatibility may differ.*
|
||||||
|
|
||||||
NMDC's smaller community has standardised around comparatively few protocol implementations by means of necessity. In comparison, there are a lot of IRC client implementations with slightly differing interpretations of the protocol.
|
NMDC's smaller community has standardised around comparatively few protocol implementations by means of necessity. In comparison, there are a lot of IRC client implementations with slightly differing interpretations of the protocol.
|
||||||
|
|
||||||
Everything works:
|
Everything works:
|
||||||
@@ -65,6 +67,13 @@ Unusable:
|
|||||||
|
|
||||||
=CHANGELOG=
|
=CHANGELOG=
|
||||||
|
|
||||||
|
2017-05-28 1.2.3
|
||||||
|
- Fix a regression with userlist display on HexChat (other IRC client compatibility unknown)
|
||||||
|
|
||||||
|
2017-05-27 1.2.2
|
||||||
|
- Update libnmdc to 0.14
|
||||||
|
- Fix a crash that could occur if the server is scanned by a non-irc client
|
||||||
|
|
||||||
2016-11-29 1.2.1
|
2016-11-29 1.2.1
|
||||||
- Update libnmdc to 0.11
|
- Update libnmdc to 0.11
|
||||||
- Fix an issue with -devel version tag in 1.2.0 release binaries
|
- Fix an issue with -devel version tag in 1.2.0 release binaries
|
||||||
|
|||||||
2
main.go
2
main.go
@@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2016 The `nmdc-ircfrontend' author(s)
|
Copyright (C) 2016-2017 The `nmdc-ircfrontend' author(s)
|
||||||
Copyright (C) 2013 Harry Jeffery
|
Copyright (C) 2013 Harry Jeffery
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
38
server.go
38
server.go
@@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2016 The `nmdc-ircfrontend' author(s)
|
Copyright (C) 2016-2017 The `nmdc-ircfrontend' author(s)
|
||||||
Copyright (C) 2013 Harry Jeffery
|
Copyright (C) 2013 Harry Jeffery
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
@@ -40,6 +40,30 @@ const (
|
|||||||
CSJoined
|
CSJoined
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Quirks struct {
|
||||||
|
SendNamesOnWho bool
|
||||||
|
}
|
||||||
|
|
||||||
|
func DefaultQuirks() Quirks {
|
||||||
|
return Quirks{
|
||||||
|
SendNamesOnWho: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func HexChatQuirks() Quirks {
|
||||||
|
return Quirks{
|
||||||
|
SendNamesOnWho: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetQuirksForClient(ver string) Quirks {
|
||||||
|
if strings.Contains(ver, "HexChat") {
|
||||||
|
return HexChatQuirks()
|
||||||
|
} else {
|
||||||
|
return DefaultQuirks()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
type Server struct {
|
type Server struct {
|
||||||
name string
|
name string
|
||||||
motd string
|
motd string
|
||||||
@@ -59,6 +83,8 @@ type Server struct {
|
|||||||
recievedFirstServerMessage bool
|
recievedFirstServerMessage bool
|
||||||
recievedCtcpVersion bool
|
recievedCtcpVersion bool
|
||||||
nickChangeAttempt int
|
nickChangeAttempt int
|
||||||
|
|
||||||
|
quirks Quirks
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewServer(name string, upstream libnmdc.HubAddress, conn net.Conn) *Server {
|
func NewServer(name string, upstream libnmdc.HubAddress, conn net.Conn) *Server {
|
||||||
@@ -77,6 +103,7 @@ func NewServer(name string, upstream libnmdc.HubAddress, conn net.Conn) *Server
|
|||||||
SkipAutoReconnect: true,
|
SkipAutoReconnect: true,
|
||||||
},
|
},
|
||||||
upstreamCloser: make(chan struct{}, 1),
|
upstreamCloser: make(chan struct{}, 1),
|
||||||
|
quirks: DefaultQuirks(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,12 +160,12 @@ func (s *Server) RunWorker() {
|
|||||||
|
|
||||||
// Client sent a command
|
// Client sent a command
|
||||||
fields := strings.Fields(string(line))
|
fields := strings.Fields(string(line))
|
||||||
if len(fields) < 1 {
|
if len(fields) == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasPrefix(fields[0], ":") {
|
if strings.HasPrefix(fields[0], ":") {
|
||||||
fields = fields[1:]
|
fields[0] = fields[0][1:]
|
||||||
}
|
}
|
||||||
|
|
||||||
s.handleCommand(strings.ToUpper(fields[0]), fields[1:])
|
s.handleCommand(strings.ToUpper(fields[0]), fields[1:])
|
||||||
@@ -439,6 +466,7 @@ func (s *Server) handleRegisteredCommand(command string, args []string) {
|
|||||||
versionString := message[9:]
|
versionString := message[9:]
|
||||||
versionString = versionString[:len(versionString)-1]
|
versionString = versionString[:len(versionString)-1]
|
||||||
s.SetClientSoftwareVersion(versionString)
|
s.SetClientSoftwareVersion(versionString)
|
||||||
|
s.quirks = GetQuirksForClient(versionString)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -636,6 +664,10 @@ func (s *Server) handleJoinedCommand(command string, args []string) {
|
|||||||
// s.sendWho(args[0])
|
// s.sendWho(args[0])
|
||||||
// s.sendNames() // fixes hexchat, but andchat always sends WHO /immediately/ after NAMES end, causing an infinite loop
|
// s.sendNames() // fixes hexchat, but andchat always sends WHO /immediately/ after NAMES end, causing an infinite loop
|
||||||
|
|
||||||
|
if s.quirks.SendNamesOnWho {
|
||||||
|
s.sendNames()
|
||||||
|
}
|
||||||
|
|
||||||
case "MODE":
|
case "MODE":
|
||||||
if len(args) < 1 {
|
if len(args) < 1 {
|
||||||
s.reply(errMoreArgs)
|
s.reply(errMoreArgs)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2016 The `nmdc-ircfrontend' author(s)
|
Copyright (C) 2016-2017 The `nmdc-ircfrontend' author(s)
|
||||||
Copyright (C) 2013 Harry Jeffery
|
Copyright (C) 2013 Harry Jeffery
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|||||||
Reference in New Issue
Block a user