Skip to content

Commit

Permalink
Merge in ignored_irc_hostmasks support.
Browse files Browse the repository at this point in the history
Previously this work was on another branch pending the respective PR
for `irc_ignored_hostmasks` to be merged. Since that is merged there is
no need for this on a separate branch.
  • Loading branch information
llmII committed Feb 16, 2021
1 parent ccb3acc commit db78d24
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Config struct {
PuppetUsername string // Username to connect to IRC with
IRCIgnores []glob.Glob
DiscordIgnores map[string]struct{} // Discord user IDs to not bridge
ConnectionLimit int // number of IRC connections we can spawn
ConnectionLimit int // number of IRC connections we can spawn

IRCPrejoinCommands []string

Expand Down
5 changes: 5 additions & 0 deletions bridge/irc_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ func userOnChannelFix(user string, channel irc.Channel) bool {
}

func (i *ircListener) OnNickRelayToDiscord(event *irc.Event) {
// Ignored hostmasks
if i.bridge.ircManager.isIgnoredHostmask(event.Source) {
return
}

oldNick := event.Nick
newNick := event.Message()

Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func main() {
dib, err := bridge.New(&bridge.Config{
AvatarURL: avatarURL,
DiscordBotToken: discordBotToken,
DiscordIgnoresIRC: matchers,
GuildID: guildID,
IRCListenerName: ircUsername,
IRCServer: ircServer,
Expand Down

0 comments on commit db78d24

Please sign in to comment.