From a6f37f1d617b4a963337fd164706ebaecf69ea5b Mon Sep 17 00:00:00 2001 From: Wim Date: Tue, 6 Mar 2018 20:41:34 +0100 Subject: Use default values (irc) --- bridge/irc/irc.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bridge/irc/irc.go') diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go index 0e817327..1c9ec90e 100644 --- a/bridge/irc/irc.go +++ b/bridge/irc/irc.go @@ -64,7 +64,7 @@ func (b *Birc) Command(msg *config.Message) string { } func (b *Birc) Connect() error { - b.Local = make(chan config.Message, b.GetInt("MessageQueue")+10) + b.Local = make(chan config.Message, b.MessageQueue+10) b.Log.Infof("Connecting %s", b.GetString("Server")) server, portstr, err := net.SplitHostPort(b.GetString("Server")) if err != nil { @@ -204,7 +204,7 @@ func (b *Birc) Send(msg config.Message) (string, error) { // split long messages on messageLength, to avoid clipped messages #281 if b.GetBool("MessageSplit") { - msg.Text = helper.SplitStringLength(msg.Text, b.GetInt("MessageLength")) + msg.Text = helper.SplitStringLength(msg.Text, b.MessageLength) } for _, text := range strings.Split(msg.Text, "\n") { if len(text) > b.MessageLength { @@ -214,8 +214,8 @@ func (b *Birc) Send(msg config.Message) (string, error) { } text += " " } - if len(b.Local) < b.GetInt("MessageQueue") { - if len(b.Local) == b.GetInt("MessageQueue")-1 { + if len(b.Local) < b.MessageQueue { + if len(b.Local) == b.MessageQueue-1 { text = text + " " } b.Local <- config.Message{Text: text, Username: msg.Username, Channel: msg.Channel, Event: msg.Event} -- cgit v1.2.3