aboutsummaryrefslogtreecommitdiff
path: root/clientapi/producers/syncapi.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-07-25 17:30:07 +0100
committerGitHub <noreply@github.com>2022-07-25 17:30:07 +0100
commit962b76da445e8af408d7473abfa0cb9d00423264 (patch)
tree2d7139afc142619766e1327281c8ce1741a3b613 /clientapi/producers/syncapi.go
parent497ab4e1b7cb4225f57b87932a3dccfbbec74463 (diff)
Make the User API responsible for sending account data output events (#2592)
* Make the User API responsible for sending account data output events * Clean up producer * Review comments
Diffstat (limited to 'clientapi/producers/syncapi.go')
-rw-r--r--clientapi/producers/syncapi.go32
1 files changed, 0 insertions, 32 deletions
diff --git a/clientapi/producers/syncapi.go b/clientapi/producers/syncapi.go
index 0ac63779..5933ce1a 100644
--- a/clientapi/producers/syncapi.go
+++ b/clientapi/producers/syncapi.go
@@ -21,7 +21,6 @@ import (
"strconv"
"time"
- "github.com/matrix-org/dendrite/internal/eventutil"
"github.com/matrix-org/dendrite/setup/jetstream"
"github.com/matrix-org/dendrite/syncapi/types"
userapi "github.com/matrix-org/dendrite/userapi/api"
@@ -32,7 +31,6 @@ import (
// SyncAPIProducer produces events for the sync API server to consume
type SyncAPIProducer struct {
- TopicClientData string
TopicReceiptEvent string
TopicSendToDeviceEvent string
TopicTypingEvent string
@@ -42,36 +40,6 @@ type SyncAPIProducer struct {
UserAPI userapi.ClientUserAPI
}
-// SendData sends account data to the sync API server
-func (p *SyncAPIProducer) SendData(userID string, roomID string, dataType string, readMarker *eventutil.ReadMarkerJSON, ignoredUsers *types.IgnoredUsers) error {
- m := &nats.Msg{
- Subject: p.TopicClientData,
- Header: nats.Header{},
- }
- m.Header.Set(jetstream.UserID, userID)
-
- data := eventutil.AccountData{
- RoomID: roomID,
- Type: dataType,
- ReadMarker: readMarker,
- IgnoredUsers: ignoredUsers,
- }
- var err error
- m.Data, err = json.Marshal(data)
- if err != nil {
- return err
- }
-
- log.WithFields(log.Fields{
- "user_id": userID,
- "room_id": roomID,
- "data_type": dataType,
- }).Tracef("Producing to topic '%s'", p.TopicClientData)
-
- _, err = p.JetStream.PublishMsg(m)
- return err
-}
-
func (p *SyncAPIProducer) SendReceipt(
ctx context.Context,
userID, roomID, eventID, receiptType string, timestamp gomatrixserverlib.Timestamp,