3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 18:52:41 +01:00

constants: Make SEM_VER the actual version number conforming to Semantec Versioning, and VER the composed number

This commit is contained in:
Daniel Oaks 2016-06-30 17:42:24 +10:00
parent 748bc759cb
commit 1d51bb450a
2 changed files with 10 additions and 4 deletions

View File

@ -5,8 +5,14 @@
package irc package irc
import "fmt"
const ( const (
SEM_VER = "oragono-0.1.0-unreleased" SEM_VER = "0.1.0-unreleased"
CRLF = "\r\n" CRLF = "\r\n"
MAX_REPLY_LEN = 512 - len(CRLF) MAX_REPLY_LEN = 512 - len(CRLF)
) )
var (
VER = fmt.Sprintf("oragono-%s", SEM_VER)
)

View File

@ -302,10 +302,10 @@ func (s *Server) tryRegister(c *Client) {
//NOTE(dan): we specifically use the NICK here instead of the nickmask //NOTE(dan): we specifically use the NICK here instead of the nickmask
// see http://modern.ircdocs.horse/#rplwelcome-001 for details on why we avoid using the nickmask // see http://modern.ircdocs.horse/#rplwelcome-001 for details on why we avoid using the nickmask
c.Send(nil, s.nameString, RPL_WELCOME, c.nickString, fmt.Sprintf("Welcome to the Internet Relay Network %s", c.nickString)) c.Send(nil, s.nameString, RPL_WELCOME, c.nickString, fmt.Sprintf("Welcome to the Internet Relay Network %s", c.nickString))
c.Send(nil, s.nameString, RPL_YOURHOST, c.nickString, fmt.Sprintf("Your host is %s, running version %s", s.nameString, SEM_VER)) c.Send(nil, s.nameString, RPL_YOURHOST, c.nickString, fmt.Sprintf("Your host is %s, running version %s", s.nameString, VER))
c.Send(nil, s.nameString, RPL_CREATED, c.nickString, fmt.Sprintf("This server was created %s", s.ctime.Format(time.RFC1123))) c.Send(nil, s.nameString, RPL_CREATED, c.nickString, fmt.Sprintf("This server was created %s", s.ctime.Format(time.RFC1123)))
//TODO(dan): Look at adding last optional [<channel modes with a parameter>] parameter //TODO(dan): Look at adding last optional [<channel modes with a parameter>] parameter
c.Send(nil, s.nameString, RPL_MYINFO, c.nickString, s.nameString, SEM_VER, supportedUserModesString, supportedChannelModesString) c.Send(nil, s.nameString, RPL_MYINFO, c.nickString, s.nameString, VER, supportedUserModesString, supportedChannelModesString)
c.RplISupport() c.RplISupport()
s.MOTD(c) s.MOTD(c)
c.Send(nil, c.nickMaskString, RPL_UMODEIS, c.nickString, c.ModeString()) c.Send(nil, c.nickMaskString, RPL_UMODEIS, c.nickString, c.ModeString())
@ -959,7 +959,7 @@ func versionHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool
return false return false
} }
client.Send(nil, server.nameString, RPL_VERSION, client.nickString, SEM_VER, server.nameString) client.Send(nil, server.nameString, RPL_VERSION, client.nickString, VER, server.nameString)
client.RplISupport() client.RplISupport()
return false return false
} }