mirror of
https://github.com/fluffle/goirc
synced 2025-05-21 06:53:21 +00:00
Move to using the new event registry internally.
This commit is contained in:
parent
a2b53e6fc3
commit
5e814babc7
2 changed files with 14 additions and 19 deletions
client
|
@ -2,10 +2,11 @@ package client
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"os"
|
||||
"net"
|
||||
"crypto/tls"
|
||||
"event"
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
@ -23,7 +24,7 @@ type Conn struct {
|
|||
Network string
|
||||
|
||||
// Event handler mapping
|
||||
events map[string][]func(*Conn, *Line)
|
||||
Registry event.EventRegistry
|
||||
// Map of channels we're on
|
||||
chans map[string]*Channel
|
||||
// Map of nicks we know about
|
||||
|
@ -72,6 +73,7 @@ type Conn struct {
|
|||
// that you can add event handlers to it. See AddHandler() for details.
|
||||
func New(nick, user, name string) *Conn {
|
||||
conn := &Conn{
|
||||
Registry: event.NewRegistry(),
|
||||
in: make(chan *Line, 32),
|
||||
out: make(chan string, 32),
|
||||
Err: make(chan os.Error, 4),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue