Changeset 244 in code for trunk


Ignore:
Timestamp:
Apr 7, 2020, 1:02:44 PM (5 years ago)
Author:
contact
Message:

Fix upstream NICK handling

  • uc.nicl was compared to msg.Prefix.Name after being updated to the new nick
  • The new nick wasn't marshaled
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/upstream.go

    r240 r244  
    547547                }
    548548
     549                me := false
    549550                if msg.Prefix.Name == uc.nick {
    550551                        uc.logger.Printf("changed nick from %q to %q", uc.nick, newNick)
     552                        me = true
    551553                        uc.nick = newNick
    552554                }
     
    560562                }
    561563
    562                 if msg.Prefix.Name != uc.nick {
     564                if !me {
    563565                        uc.forEachDownstream(func(dc *downstreamConn) {
    564566                                dc.SendMessage(&irc.Message{
    565567                                        Prefix:  dc.marshalUserPrefix(uc, msg.Prefix),
    566568                                        Command: "NICK",
    567                                         Params:  []string{newNick},
     569                                        Params:  []string{dc.marshalEntity(uc, newNick)},
    568570                                })
    569571                        })
Note: See TracChangeset for help on using the changeset viewer.