Changeset 688 in code for trunk


Ignore:
Timestamp:
Nov 15, 2021, 8:30:04 PM (4 years ago)
Author:
delthas
Message:

Return an empty CHATHISTORY TARGETS batch when in multi-upstream

When on an unbound bouncer network downstream, we should return no
targets (there are none, because there are no upstreams at all).

When on a multi-upstream downstream, we should return no targets as we
don't support multi-upstream CHATHISTORY TARGETS.

Before this patch, we returned a misleading error message:
:example.com 403 :Missing network suffix in name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r686 r688  
    23602360                        }
    23612361                case "TARGETS":
     2362                        if dc.network == nil {
     2363                                // Either an unbound bouncer network, in which case we should return no targets,
     2364                                // or a multi-upstream downstream, but we don't support CHATHISTORY TARGETS for those yet.
     2365                                dc.SendBatch("draft/chathistory-targets", nil, nil, func(batchRef irc.TagValue) {})
     2366                                return nil
     2367                        }
    23622368                        if err := parseMessageParams(msg, nil, &boundsStr[0], &boundsStr[1], &limitStr); err != nil {
    23632369                                return err
Note: See TracChangeset for help on using the changeset viewer.