( ctx context.Context, userID, roomID, eventID, receiptType string, timestamp gomatrixserverlib.Timestamp, )
| 41 | } |
| 42 | |
| 43 | func (p *SyncAPIProducer) SendReceipt( |
| 44 | ctx context.Context, |
| 45 | userID, roomID, eventID, receiptType string, timestamp gomatrixserverlib.Timestamp, |
| 46 | ) error { |
| 47 | m := &nats.Msg{ |
| 48 | Subject: p.TopicReceiptEvent, |
| 49 | Header: nats.Header{}, |
| 50 | } |
| 51 | m.Header.Set(jetstream.UserID, userID) |
| 52 | m.Header.Set(jetstream.RoomID, roomID) |
| 53 | m.Header.Set(jetstream.EventID, eventID) |
| 54 | m.Header.Set("type", receiptType) |
| 55 | m.Header.Set("timestamp", fmt.Sprintf("%d", timestamp)) |
| 56 | |
| 57 | log.WithFields(log.Fields{}).Tracef("Producing to topic '%s'", p.TopicReceiptEvent) |
| 58 | _, err := p.JetStream.PublishMsg(m, nats.Context(ctx)) |
| 59 | return err |
| 60 | } |
| 61 | |
| 62 | func (p *SyncAPIProducer) SendToDevice( |
| 63 | ctx context.Context, sender, userID, deviceID, eventType string, |
no test coverage detected