]> Cypherpunks.ru repositories - goircd.git/blobdiff - events.go
Split long lines
[goircd.git] / events.go
index 0921069d2cf21748e6bcd34fae076dff206cc44e..843e8b59d8b407d2e96de3e334d77afab4219d80 100644 (file)
--- a/events.go
+++ b/events.go
@@ -1,6 +1,6 @@
 /*
 goircd -- minimalistic simple Internet Relay Chat (IRC) server
-Copyright (C) 2014 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2014-2015 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -15,6 +15,7 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
+
 package main
 
 import (
@@ -27,26 +28,26 @@ import (
 )
 
 const (
-       EVENT_NEW   = iota
-       EVENT_DEL   = iota
-       EVENT_MSG   = iota
-       EVENT_TOPIC = iota
-       EVENT_WHO   = iota
-       EVENT_MODE  = iota
-       FORMAT_MSG  = "[%s] <%s> %s\n"
-       FORMAT_META = "[%s] * %s %s\n"
+       EventNew   = iota
+       EventDel   = iota
+       EventMsg   = iota
+       EventTopic = iota
+       EventWho   = iota
+       EventMode  = iota
+       FormatMsg  = "[%s] <%s> %s\n"
+       FormatMeta = "[%s] * %s %s\n"
 )
 
 // Client events going from each of client
 // They can be either NEW, DEL or unparsed MSG
 type ClientEvent struct {
-       client     *Client
-       event_type int
-       text       string
+       client    *Client
+       eventType int
+       text      string
 }
 
 func (m ClientEvent) String() string {
-       return string(m.event_type) + ": " + m.client.String() + ": " + m.text
+       return string(m.eventType) + ": " + m.client.String() + ": " + m.text
 }
 
 // Logging in-room events
@@ -73,9 +74,9 @@ func Logger(logdir string, events <-chan LogEvent) {
                        continue
                }
                if event.meta {
-                       format = FORMAT_META
+                       format = FormatMeta
                } else {
-                       format = FORMAT_MSG
+                       format = FormatMsg
                }
                _, err = fd.WriteString(fmt.Sprintf(format, time.Now(), event.who, event.what))
                fd.Close()