Changeset 781 in code for trunk/upstream.go


Ignore:
Timestamp:
Feb 11, 2022, 6:41:46 PM (3 years ago)
Author:
delthas
Message:

Add support for the wip soju.im/read capability and READ command

READ lets downstream clients share information between each other about
what messages have been read by other downstreams.

Each target/entity has an optional corresponding read receipt, which is
stored as a timestamp.

  • When a downstream sends: READ #chan timestamp=2020-01-01T01:23:45.000Z the read receipt for that target is set to that date
  • soju sends READ to downstreams:
    • on JOIN, if the client uses the soju.im/read capability
    • when the read receipt timestamp is set by any downstream

The read receipt date is clamped by the previous receipt date and the
current time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/upstream.go

    r779 r781  
    13381338                if c == nil || !c.Detached {
    13391339                        uc.forEachDownstream(func(dc *downstreamConn) {
    1340                                 forwardChannel(dc, ch)
     1340                                forwardChannel(ctx, dc, ch)
    13411341                        })
    13421342                }
     
    17691769        }
    17701770        if ch.ReattachOn == FilterMessage || (ch.ReattachOn == FilterHighlight && uc.network.isHighlight(msg)) {
    1771                 uc.network.attach(ch)
     1771                uc.network.attach(ctx, ch)
    17721772                if err := uc.srv.db.StoreChannel(ctx, uc.network.ID, ch); err != nil {
    17731773                        uc.logger.Printf("failed to update channel %q: %v", ch.Name, err)
Note: See TracChangeset for help on using the changeset viewer.