3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +01:00

code review

- SEM_VER instead of SEMVER
- persist user limit along with other params
This commit is contained in:
Jeremy Latt 2014-02-25 16:13:47 -08:00
parent b30e247e77
commit c35d5d1b8a
3 changed files with 7 additions and 6 deletions

View File

@ -377,8 +377,9 @@ func (channel *Channel) Persist() {
channel.server.db.Exec(` channel.server.db.Exec(`
INSERT OR REPLACE INTO channel INSERT OR REPLACE INTO channel
(name, flags, key, topic) (name, flags, key, topic)
VALUES (?, ?, ?, ?)`, VALUES (?, ?, ?, ?, ?)`,
channel.name, channel.flags.String(), channel.key, channel.topic) channel.name, channel.flags.String(), channel.key, channel.topic,
channel.userLimit)
} else { } else {
channel.server.db.Exec(`DELETE FROM channel WHERE name = ?`, channel.name) channel.server.db.Exec(`DELETE FROM channel WHERE name = ?`, channel.name)
} }

View File

@ -23,7 +23,7 @@ var (
) )
const ( const (
SEMVER = "ergonomadic-1.1.0" SEM_VER = "ergonomadic-1.1.0"
CRLF = "\r\n" CRLF = "\r\n"
MAX_REPLY_LEN = 512 - len(CRLF) MAX_REPLY_LEN = 512 - len(CRLF)

View File

@ -151,7 +151,7 @@ func (target *Client) RplWelcome() {
func (target *Client) RplYourHost() { func (target *Client) RplYourHost() {
target.NumericReply(RPL_YOURHOST, target.NumericReply(RPL_YOURHOST,
":Your host is %s, running version %s", target.server.name, SEMVER) ":Your host is %s, running version %s", target.server.name, SEM_VER)
} }
func (target *Client) RplCreated() { func (target *Client) RplCreated() {
@ -161,7 +161,7 @@ func (target *Client) RplCreated() {
func (target *Client) RplMyInfo() { func (target *Client) RplMyInfo() {
target.NumericReply(RPL_MYINFO, target.NumericReply(RPL_MYINFO,
"%s %s aiOorsw abeIikmntpqrsl", target.server.name, SEMVER) "%s %s aiOorsw abeIikmntpqrsl", target.server.name, SEM_VER)
} }
func (target *Client) RplUModeIs(client *Client) { func (target *Client) RplUModeIs(client *Client) {
@ -371,7 +371,7 @@ func (target *Client) RplWhoisChannels(client *Client) {
func (target *Client) RplVersion() { func (target *Client) RplVersion() {
target.NumericReply(RPL_VERSION, target.NumericReply(RPL_VERSION,
"%s %s", SEMVER, target.server.name) "%s %s", SEM_VER, target.server.name)
} }
func (target *Client) RplInviting(invitee *Client, channel string) { func (target *Client) RplInviting(invitee *Client, channel string) {