mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 11:23:11 -06:00
Fix necessary field not set properly in TypingEvent; clean up OutputTypingEvent
Signed-off-by: Alex Chen <minecnly@gmail.com>
This commit is contained in:
parent
2a9dab21f8
commit
e7cf44946f
|
|
@ -23,8 +23,6 @@ type OutputTypingEvent struct {
|
||||||
// ExpireTime is the interval after which the user should no longer be
|
// ExpireTime is the interval after which the user should no longer be
|
||||||
// considered typing. Only available if Event.Typing is true.
|
// considered typing. Only available if Event.Typing is true.
|
||||||
ExpireTime *time.Time
|
ExpireTime *time.Time
|
||||||
// Users typing in the room when the event was generated.
|
|
||||||
TypingUsers []string `json:"typing_users"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TypingEvent represents a matrix edu event of type 'm.typing'.
|
// TypingEvent represents a matrix edu event of type 'm.typing'.
|
||||||
|
|
|
||||||
|
|
@ -57,15 +57,14 @@ func (t *TypingServerInputAPI) InputTypingEvent(
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TypingServerInputAPI) sendEvent(ite *api.InputTypingEvent) error {
|
func (t *TypingServerInputAPI) sendEvent(ite *api.InputTypingEvent) error {
|
||||||
userIDs := t.Cache.GetTypingUsers(ite.RoomID)
|
|
||||||
ev := &api.TypingEvent{
|
ev := &api.TypingEvent{
|
||||||
Type: gomatrixserverlib.MTyping,
|
Type: gomatrixserverlib.MTyping,
|
||||||
RoomID: ite.RoomID,
|
RoomID: ite.RoomID,
|
||||||
UserID: ite.UserID,
|
UserID: ite.UserID,
|
||||||
|
Typing: ite.Typing,
|
||||||
}
|
}
|
||||||
ote := &api.OutputTypingEvent{
|
ote := &api.OutputTypingEvent{
|
||||||
Event: *ev,
|
Event: *ev,
|
||||||
TypingUsers: userIDs,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ev.Typing {
|
if ev.Typing {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue