MCPcopy Create free account
hub / github.com/daodst/chat / SendTyping

Method SendTyping

federationapi/producers/syncapi.go:135–148  ·  view source on GitHub ↗
(
	ctx context.Context, userID, roomID string, typing bool, timeoutMS int64,
)

Source from the content-addressed store, hash-verified

133}
134
135func (p *SyncAPIProducer) SendTyping(
136 ctx context.Context, userID, roomID string, typing bool, timeoutMS int64,
137) error {
138 m := &nats.Msg{
139 Subject: p.TopicTypingEvent,
140 Header: nats.Header{},
141 }
142 m.Header.Set(jetstream.UserID, userID)
143 m.Header.Set(jetstream.RoomID, roomID)
144 m.Header.Set("typing", strconv.FormatBool(typing))
145 m.Header.Set("timeout_ms", strconv.Itoa(int(timeoutMS)))
146 _, err := p.JetStream.PublishMsg(m, nats.Context(ctx))
147 return err
148}
149
150func (p *SyncAPIProducer) SendPresence(
151 ctx context.Context, userID string, presence types.Presence, statusMsg *string, lastActiveAgo int64,

Callers 1

processEDUsMethod · 0.45

Calls 3

PublishMsgMethod · 0.80
ContextMethod · 0.80
SetMethod · 0.65

Tested by

no test coverage detected