Changeset 193 in code for trunk/upstream.go


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

Request server-time cap

If the server didn't populate the time tag, do it ourselves.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/upstream.go

    r192 r193  
    366366
    367367                        requestCaps := make([]string, 0, 16)
    368                         for _, c := range []string{"message-tags", "batch", "labeled-response"} {
     368                        for _, c := range []string{"message-tags", "batch", "labeled-response", "server-time"} {
    369369                                if _, ok := uc.caps[c]; ok {
    370370                                        requestCaps = append(requestCaps, c)
     
    12081208                }
    12091209
     1210                if _, ok := msg.Tags["time"]; !ok {
     1211                        msg.Tags["time"] = irc.TagValue(time.Now().Format(serverTimeLayout))
     1212                }
     1213
    12101214                target := nick
    12111215                if nick == uc.nick {
     
    13741378        case "labeled-response":
    13751379                uc.labelsSupported = ok
     1380        case "batch", "server-time":
     1381                // Nothing to do
     1382        default:
     1383                uc.logger.Printf("received CAP ACK/NAK for a cap we don't support: %v", name)
    13761384        }
    13771385        return nil
Note: See TracChangeset for help on using the changeset viewer.