4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-26 21:19:22 +00:00

Add support for dynamic IconURL (slack). Closes #43

This commit is contained in:
Wim
2016-11-05 01:11:28 +01:00
parent 50a0df4279
commit 2dbe0eb557
9 changed files with 61 additions and 36 deletions

View File

@ -123,12 +123,13 @@ func (b *Birc) Send(msg config.Message) error {
b.Command(&msg)
return nil
}
nick := config.GetNick(&msg, b.Config)
for _, text := range strings.Split(msg.Text, "\n") {
if len(b.Local) < b.Config.MessageQueue {
if len(b.Local) == b.Config.MessageQueue-1 {
text = text + " <message clipped>"
}
b.Local <- config.Message{Text: text, Username: msg.Username, Channel: msg.Channel}
b.Local <- config.Message{Text: text, Username: nick, Channel: msg.Channel}
} else {
flog.Debugf("flooding, dropping message (queue at %d)", len(b.Local))
}