Changeset 781 in code for trunk/db.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/db.go

    r712 r781  
    2929        ListDeliveryReceipts(ctx context.Context, networkID int64) ([]DeliveryReceipt, error)
    3030        StoreClientDeliveryReceipts(ctx context.Context, networkID int64, client string, receipts []DeliveryReceipt) error
     31
     32        GetReadReceipt(ctx context.Context, networkID int64, name string) (*ReadReceipt, error)
     33        StoreReadReceipt(ctx context.Context, networkID int64, receipt *ReadReceipt) error
    3134}
    3235
     
    181184        InternalMsgID string
    182185}
     186
     187type ReadReceipt struct {
     188        ID        int64
     189        Target    string // channel or nick
     190        Timestamp time.Time
     191}
Note: See TracChangeset for help on using the changeset viewer.