Changeset 259 in code for trunk/downstream.go


Ignore:
Timestamp:
Apr 16, 2020, 2:57:33 PM (5 years ago)
Author:
contact
Message:

Kill downstreamConn.marshal{Nick,Channel}

We can just use downstreamConn.marshalEntity instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r258 r259  
    138138        }
    139139        return name + "/" + uc.network.GetName()
    140 }
    141 
    142 func (dc *downstreamConn) marshalChannel(uc *upstreamConn, name string) string {
    143         return dc.marshalEntity(uc, name)
    144 }
    145 
    146 func (dc *downstreamConn) marshalNick(uc *upstreamConn, name string) string {
    147         return dc.marshalEntity(uc, name)
    148140}
    149141
     
    244236        case "NICK":
    245237                // Nick change for another user
    246                 msg.Params[0] = dc.marshalNick(uc, msg.Params[0])
     238                msg.Params[0] = dc.marshalEntity(uc, msg.Params[0])
    247239        case "JOIN", "PART":
    248                 msg.Params[0] = dc.marshalChannel(uc, msg.Params[0])
     240                msg.Params[0] = dc.marshalEntity(uc, msg.Params[0])
    249241        case "KICK":
    250                 msg.Params[0] = dc.marshalChannel(uc, msg.Params[0])
    251                 msg.Params[1] = dc.marshalNick(uc, msg.Params[1])
     242                msg.Params[0] = dc.marshalEntity(uc, msg.Params[0])
     243                msg.Params[1] = dc.marshalEntity(uc, msg.Params[1])
    252244        case "TOPIC":
    253                 msg.Params[0] = dc.marshalChannel(uc, msg.Params[0])
     245                msg.Params[0] = dc.marshalEntity(uc, msg.Params[0])
    254246        case "MODE":
    255247                msg.Params[0] = dc.marshalEntity(uc, msg.Params[0])
     
    671663                                        Prefix:  dc.prefix(),
    672664                                        Command: "JOIN",
    673                                         Params:  []string{dc.marshalChannel(ch.conn, ch.Name)},
     665                                        Params:  []string{dc.marshalEntity(ch.conn, ch.Name)},
    674666                                })
    675667
Note: See TracChangeset for help on using the changeset viewer.