Skip to content

Commit

Permalink
Ignore special channels (&users and &messages)
Browse files Browse the repository at this point in the history
  • Loading branch information
hloeung committed Nov 19, 2022
1 parent dd789a0 commit 6a52ea4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mm-go-irckit/server_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ func CmdJoin(s Server, u *User, msg *irc.Message) error {
// you can only join existing channels
var err error

if strings.HasPrefix(channelName, "&") {
continue
}

channelID, topic, err := u.br.Join(channelName)
if err != nil {
logger.Errorf("Cannot join channel %s, id %s, err: %v", channelName, channelID, err)
Expand Down Expand Up @@ -373,7 +377,7 @@ func CmdPrivMsg(s Server, u *User, msg *irc.Message) error {

// are we sending to a channel
if ch, exists := s.HasChannel(query); exists {
if ch.ID() == "&messages" || ch.ID() == "&users" {
if strings.HasPrefix(ch.ID(), "&") {
return nil
}

Expand Down

0 comments on commit 6a52ea4

Please sign in to comment.