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
 
5
 
6
 package irc
6
 package irc
7
 
7
 
8
+import "fmt"
9
+
8
 const (
10
 const (
9
-	SEM_VER       = "oragono-0.1.0-unreleased"
11
+	SEM_VER       = "0.1.0-unreleased"
10
 	CRLF          = "\r\n"
12
 	CRLF          = "\r\n"
11
 	MAX_REPLY_LEN = 512 - len(CRLF)
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
 	//NOTE(dan): we specifically use the NICK here instead of the nickmask
302
 	//NOTE(dan): we specifically use the NICK here instead of the nickmask
303
 	// see http://modern.ircdocs.horse/#rplwelcome-001 for details on why we avoid using the nickmask
303
 	// see http://modern.ircdocs.horse/#rplwelcome-001 for details on why we avoid using the nickmask
304
 	c.Send(nil, s.nameString, RPL_WELCOME, c.nickString, fmt.Sprintf("Welcome to the Internet Relay Network %s", c.nickString))
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
 	c.Send(nil, s.nameString, RPL_CREATED, c.nickString, fmt.Sprintf("This server was created %s", s.ctime.Format(time.RFC1123)))
306
 	c.Send(nil, s.nameString, RPL_CREATED, c.nickString, fmt.Sprintf("This server was created %s", s.ctime.Format(time.RFC1123)))
307
 	//TODO(dan): Look at adding last optional [<channel modes with a parameter>] parameter
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
 	c.RplISupport()
309
 	c.RplISupport()
310
 	s.MOTD(c)
310
 	s.MOTD(c)
311
 	c.Send(nil, c.nickMaskString, RPL_UMODEIS, c.nickString, c.ModeString())
311
 	c.Send(nil, c.nickMaskString, RPL_UMODEIS, c.nickString, c.ModeString())
959
 		return false
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
 	client.RplISupport()
963
 	client.RplISupport()
964
 	return false
964
 	return false
965
 }
965
 }

Loading…
Cancel
Save