Changeset 42 in code for trunk/downstream.go


Ignore:
Timestamp:
Feb 7, 2020, 11:19:42 AM (5 years ago)
Author:
contact
Message:

Allow changing nickname

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r40 r42  
    235235func (c *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
    236236        switch msg.Command {
    237         case "NICK", "USER":
     237        case "USER":
    238238                return ircError{&irc.Message{
    239239                        Command: irc.ERR_ALREADYREGISTERED,
    240                         Params: []string{
    241                                 c.nick,
    242                                 "You may not reregister",
    243                         },
     240                        Params:  []string{c.nick, "You may not reregister"},
    244241                }}
     242        case "NICK":
     243                c.user.forEachUpstream(func(uc *upstreamConn) {
     244                        uc.messages <- msg
     245                })
    245246        default:
    246247                c.logger.Printf("unhandled message: %v", msg)
    247248                return newUnknownCommandError(msg.Command)
    248249        }
    249 }
     250        return nil
     251}
Note: See TracChangeset for help on using the changeset viewer.