client: Allow disabling simplification of events
This commit is contained in:
parent
4764651a23
commit
18bee1651e
@ -39,6 +39,9 @@ type ServerConnection struct {
|
||||
InitialNick string
|
||||
InitialUser string
|
||||
InitialRealName string
|
||||
|
||||
// options
|
||||
SimplifyEvents bool
|
||||
}
|
||||
|
||||
// newServerConnection returns an initialised ServerConnection, for internal
|
||||
@ -55,6 +58,8 @@ func newServerConnection(name string) *ServerConnection {
|
||||
|
||||
sc.Features.Parse("CHANTYPES=#", "LINELEN=512", "PREFIX=(ov)@+")
|
||||
|
||||
sc.SimplifyEvents = true
|
||||
|
||||
return &sc
|
||||
}
|
||||
|
||||
@ -140,14 +145,16 @@ func (sc *ServerConnection) ReceiveLoop() {
|
||||
info["params"] = message.Params
|
||||
|
||||
// simplify event
|
||||
err = SimplifyEvent(info)
|
||||
if sc.SimplifyEvents {
|
||||
err = SimplifyEvent(info)
|
||||
|
||||
if err != nil {
|
||||
fmt.Println("Could not simplify incoming IRC message, skipping line.")
|
||||
fmt.Println("line:", line)
|
||||
fmt.Println("error:", err)
|
||||
fmt.Println("info:", info)
|
||||
continue
|
||||
if err != nil {
|
||||
fmt.Println("Could not simplify incoming IRC message, skipping line.")
|
||||
fmt.Println("line:", line)
|
||||
fmt.Println("error:", err)
|
||||
fmt.Println("info:", info)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
// IRC commands are case-insensitive
|
||||
|
Loading…
Reference in New Issue
Block a user