Changeset 176 in code for trunk


Ignore:
Timestamp:
Mar 27, 2020, 11:07:20 PM (5 years ago)
Author:
delthas
Message:

Make upstream.SendMessageLabeled use an uint64 id

This commit is preparatory work for code that will call
SendMessageLabeled with a direct downstream id rather than a
downstreamConnection pointer.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r173 r176  
    11001100                        } else {
    11011101                                // NAMES on a channel we have not joined, ask upstream
    1102                                 uc.SendMessageLabeled(dc, &irc.Message{
     1102                                uc.SendMessageLabeled(dc.id, &irc.Message{
    11031103                                        Command: "NAMES",
    11041104                                        Params:  []string{upstreamChannel},
     
    11471147                }
    11481148
    1149                 uc.SendMessageLabeled(dc, &irc.Message{
     1149                uc.SendMessageLabeled(dc.id, &irc.Message{
    11501150                        Command: "WHO",
    11511151                        Params:  params,
     
    12041204                }
    12051205
    1206                 uc.SendMessageLabeled(dc, &irc.Message{
     1206                uc.SendMessageLabeled(dc.id, &irc.Message{
    12071207                        Command: "WHOIS",
    12081208                        Params:  params,
     
    12891289                uc := ucChannel
    12901290
    1291                 uc.SendMessageLabeled(dc, &irc.Message{
     1291                uc.SendMessageLabeled(dc.id, &irc.Message{
    12921292                        Command: "INVITE",
    12931293                        Params:  []string{upstreamUser, upstreamChannel},
  • trunk/upstream.go

    r175 r176  
    12281228}
    12291229
    1230 func (uc *upstreamConn) SendMessageLabeled(dc *downstreamConn, msg *irc.Message) {
     1230func (uc *upstreamConn) SendMessageLabeled(downstreamID uint64, msg *irc.Message) {
    12311231        if uc.labelsSupported {
    12321232                if msg.Tags == nil {
    12331233                        msg.Tags = make(map[string]irc.TagValue)
    12341234                }
    1235                 msg.Tags["label"] = irc.TagValue(fmt.Sprintf("sd-%d-%d", dc.id, uc.nextLabelID))
     1235                msg.Tags["label"] = irc.TagValue(fmt.Sprintf("sd-%d-%d", downstreamID, uc.nextLabelID))
    12361236                uc.nextLabelID++
    12371237        }
Note: See TracChangeset for help on using the changeset viewer.