Changeset 191 in code for trunk/downstream.go


Ignore:
Timestamp:
Mar 31, 2020, 5:39:06 PM (5 years ago)
Author:
contact
Message:

Expose message-tags capability downstream

Strip tags if the client doesn't support them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r190 r191  
    276276// goroutine.
    277277func (dc *downstreamConn) SendMessage(msg *irc.Message) {
     278        // TODO: strip tags if the client doesn't support them (see runNetwork)
    278279        dc.outgoing <- msg
    279280}
     
    451452                }
    452453
     454                caps = append(caps, "message-tags")
     455
    453456                // TODO: multi-line replies
    454457                dc.SendMessage(&irc.Message{
     
    496499
    497500                        switch name {
    498                         case "sasl":
     501                        case "sasl", "message-tags":
    499502                                dc.caps[name] = enable
    500503                        default:
     
    729732        }
    730733
     734        // TODO: can't be enabled/disabled on-the-fly
     735        msgTagsEnabled := dc.caps["message-tags"]
     736
    731737        consumer, ch := net.ring.NewConsumer(seqPtr)
    732738        go func() {
     
    765771                                        default:
    766772                                                panic("expected to consume a PRIVMSG message")
     773                                        }
     774
     775                                        if !msgTagsEnabled {
     776                                                msg.Tags = nil
    767777                                        }
    768778
Note: See TracChangeset for help on using the changeset viewer.