Browse Source

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

tags/v0.1.0
Daniel Oaks 8 years ago
parent
commit
1d51bb450a
2 changed files with 10 additions and 4 deletions
  1. 7
    1
      irc/constants.go
  2. 3
    3
      irc/server.go

+ 7
- 1
irc/constants.go View File

@@ -5,8 +5,14 @@
5 5
 
6 6
 package irc
7 7
 
8
+import "fmt"
9
+
8 10
 const (
9
-	SEM_VER       = "oragono-0.1.0-unreleased"
11
+	SEM_VER       = "0.1.0-unreleased"
10 12
 	CRLF          = "\r\n"
11 13
 	MAX_REPLY_LEN = 512 - len(CRLF)
12 14
 )
15
+
16
+var (
17
+	VER = fmt.Sprintf("oragono-%s", SEM_VER)
18
+)

+ 3
- 3
irc/server.go View File

@@ -302,10 +302,10 @@ func (s *Server) tryRegister(c *Client) {
302 302
 	//NOTE(dan): we specifically use the NICK here instead of the nickmask
303 303
 	// see http://modern.ircdocs.horse/#rplwelcome-001 for details on why we avoid using the nickmask
304 304
 	c.Send(nil, s.nameString, RPL_WELCOME, c.nickString, fmt.Sprintf("Welcome to the Internet Relay Network %s", c.nickString))
305
-	c.Send(nil, s.nameString, RPL_YOURHOST, c.nickString, fmt.Sprintf("Your host is %s, running version %s", s.nameString, SEM_VER))
305
+	c.Send(nil, s.nameString, RPL_YOURHOST, c.nickString, fmt.Sprintf("Your host is %s, running version %s", s.nameString, VER))
306 306
 	c.Send(nil, s.nameString, RPL_CREATED, c.nickString, fmt.Sprintf("This server was created %s", s.ctime.Format(time.RFC1123)))
307 307
 	//TODO(dan): Look at adding last optional [<channel modes with a parameter>] parameter
308
-	c.Send(nil, s.nameString, RPL_MYINFO, c.nickString, s.nameString, SEM_VER, supportedUserModesString, supportedChannelModesString)
308
+	c.Send(nil, s.nameString, RPL_MYINFO, c.nickString, s.nameString, VER, supportedUserModesString, supportedChannelModesString)
309 309
 	c.RplISupport()
310 310
 	s.MOTD(c)
311 311
 	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
959 959
 		return false
960 960
 	}
961 961
 
962
-	client.Send(nil, server.nameString, RPL_VERSION, client.nickString, SEM_VER, server.nameString)
962
+	client.Send(nil, server.nameString, RPL_VERSION, client.nickString, VER, server.nameString)
963 963
 	client.RplISupport()
964 964
 	return false
965 965
 }

Loading…
Cancel
Save