]> Cypherpunks.ru repositories - goircd.git/blobdiff - events.go
Replace Makefile with redo, keep version in source code
[goircd.git] / events.go
index bc659a6c9eeb0e8302d6e55abecb492245622707..283b5f76d5039ba03fa0e1f2b2cbefced7f877cd 100644 (file)
--- a/events.go
+++ b/events.go
@@ -1,11 +1,10 @@
 /*
 goircd -- minimalistic simple Internet Relay Chat (IRC) server
-Copyright (C) 2014-2015 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2014-2020 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
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, version 3 of the License.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -34,10 +33,17 @@ const (
        EventTopic = iota
        EventWho   = iota
        EventMode  = iota
+       EventTerm  = iota
+       EventTick  = iota
        FormatMsg  = "[%s] <%s> %s\n"
        FormatMeta = "[%s] * %s %s\n"
 )
 
+var (
+       logSink   chan LogEvent   = make(chan LogEvent)
+       stateSink chan StateEvent = make(chan StateEvent)
+)
+
 // Client events going from each of client
 // They can be either NEW, DEL or unparsed MSG
 type ClientEvent struct {
@@ -70,7 +76,7 @@ func Logger(logdir string, events <-chan LogEvent) {
        var fd *os.File
        var err error
        for event := range events {
-               logfile = path.Join(logdir, event.where + ".log")
+               logfile = path.Join(logdir, event.where+".log")
                fd, err = os.OpenFile(logfile, mode, perm)
                if err != nil {
                        log.Println("Can not open logfile", logfile, err)