mqttim

MQTT ↔ Instant Messaging Bridge
git clone https://git.instinctive.eu/mqttim.git
Log | Files | Refs | README | LICENSE

commit ecba883a621a9ec084c99d2f4721c0df86c8cc21
parent 3e402125306c461987b2c07051a5323d62b92f8c
Author: Natasha Kerensikova <natgh@instinctive.eu>
Date:   Thu, 23 Jan 2025 19:33:49 +0000

Minor style cleanups
Diffstat:
Mmain.go | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/main.go b/main.go @@ -146,7 +146,7 @@ func dup(src []byte) []byte { return res } -func mqtt2irc(m *mqtt.Client, l *mqttLogger, f mqttTopicFilter, c chan Msg, config *Config) { +func mqtt2irc(m *mqtt.Client, l *mqttLogger, f mqttTopicFilter, c chan<- Msg, config *Config) { var big *mqtt.BigMessage for { @@ -183,7 +183,7 @@ func mqtt2irc(m *mqtt.Client, l *mqttLogger, f mqttTopicFilter, c chan Msg, conf } } -func ircSender(config *IrcConfig, i *irc.Connection, c chan Msg) error { +func ircSender(config *IrcConfig, i *irc.Connection, c <-chan Msg) { var buf bytes.Buffer for { @@ -207,7 +207,7 @@ func ircSender(config *IrcConfig, i *irc.Connection, c chan Msg) error { buf.Write(m.Message[s : s+l]) buf.WriteString(config.ContSuffix) } - i.Privmsg(config.Channel, string(buf.Bytes())) + i.Privmsg(config.Channel, buf.String()) s += l } }