Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 5f05c616d47b53696784bd7bccef6711a0b32347 Author: Wim <wim@42.be> Date: Thu Nov 08 00:29:30 2018 +0000 Make unparam linter happy diff --git a/bridge/irc/helper.go b/bridge/irc/helper.go index dd1cc46..31382aa 100644 --- a/bridge/irc/helper.go +++ b/bridge/irc/helper.go @@ -327 +327 @@ func tableformatter(nicks []string, nicksPerRow int, continued bool) string {  }  */   -func plainformatter(nicks []string, nicksPerRow int) string { +func plainformatter(nicks []string) string {   return strings.Join(nicks, ", ") + " currently on IRC"  }   diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go index c1cbdf6..25f6bee 100644 --- a/bridge/irc/irc.go +++ b/bridge/irc/irc.go @@ -27114 +27112 @@ func (b *Birc) endNames(client *girc.Client, event girc.Event) {   channel := event.Params[1]   sort.Strings(b.names[channel])   maxNamesPerPost := (300 / b.nicksPerRow()) * b.nicksPerRow() - continued := false   for len(b.names[channel]) > maxNamesPerPost { - b.Remote <- config.Message{Username: b.Nick, Text: b.formatnicks(b.names[channel][0:maxNamesPerPost], continued), + b.Remote <- config.Message{Username: b.Nick, Text: b.formatnicks(b.names[channel][0:maxNamesPerPost]),   Channel: channel, Account: b.Account}   b.names[channel] = b.names[channel][maxNamesPerPost:] - continued = true   } - b.Remote <- config.Message{Username: b.Nick, Text: b.formatnicks(b.names[channel], continued), + b.Remote <- config.Message{Username: b.Nick, Text: b.formatnicks(b.names[channel]),   Channel: channel, Account: b.Account}   b.names[channel] = nil   b.i.Handlers.Clear(girc.RPL_NAMREPLY) @@ -4646 +4626 @@ func (b *Birc) storeNames(client *girc.Client, event girc.Event) {   strings.Split(strings.TrimSpace(event.Trailing), " ")...)  }   -func (b *Birc) formatnicks(nicks []string, continued bool) string { - return plainformatter(nicks, b.nicksPerRow()) +func (b *Birc) formatnicks(nicks []string) string { + return plainformatter(nicks)  } diff --git a/bridge/matrix/matrix.go b/bridge/matrix/matrix.go index ba02d4a..18bc557 100644 --- a/bridge/matrix/matrix.go +++ b/bridge/matrix/matrix.go @@ -1297 +1297 @@ func (b *Bmatrix) getRoomID(channel string) string {   return ""  }   -func (b *Bmatrix) handlematrix() error { +func (b *Bmatrix) handlematrix() {   syncer := b.mc.Syncer.(*matrix.DefaultSyncer)   syncer.OnEventType("m.room.redaction", b.handleEvent)   syncer.OnEventType("m.room.message", b.handleEvent) @@ -1407 +1406 @@ func (b *Bmatrix) handlematrix() error {   }   }   }() - return nil  }    func (b *Bmatrix) handleEvent(ev *matrix.Event) { diff --git a/gateway/gateway.go b/gateway/gateway.go index fb2cff4..e699251 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -2187 +2187 @@ func (gw *Gateway) getDestChannel(msg *config.Message, dest bridge.Bridge) []con   }   continue   } - if strings.Contains(channel.Direction, "out") && channel.Account == dest.Account && gw.validGatewayDest(msg, channel) { + if strings.Contains(channel.Direction, "out") && channel.Account == dest.Account && gw.validGatewayDest(msg) {   channels = append(channels, *channel)   }   } @@ -5377 +5377 @@ func (gw *Gateway) handleFiles(msg *config.Message) {   }  }   -func (gw *Gateway) validGatewayDest(msg *config.Message, channel *config.ChannelInfo) bool { +func (gw *Gateway) validGatewayDest(msg *config.Message) bool {   return msg.Gateway == gw.Name  }