🐛 Fix broadcast typing status to wrong user
This commit is contained in:
parent
57444f58f4
commit
ea94fd7b54
@ -53,13 +53,14 @@ func SetTypingStatus(channelId uint, userId uint) error {
|
|||||||
var channel models.Channel
|
var channel models.Channel
|
||||||
if err := database.C.
|
if err := database.C.
|
||||||
Preload("Members").
|
Preload("Members").
|
||||||
|
Preload("Members.Account").
|
||||||
Where("id = ?", channelId).
|
Where("id = ?", channelId).
|
||||||
First(&channel).Error; err != nil {
|
First(&channel).Error; err != nil {
|
||||||
return fmt.Errorf("channel not found: %v", err)
|
return fmt.Errorf("channel not found: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, item := range channel.Members {
|
for _, item := range channel.Members {
|
||||||
broadcastTarget = append(broadcastTarget, uint64(item.AccountID))
|
broadcastTarget = append(broadcastTarget, uint64(item.Account.ExternalID))
|
||||||
}
|
}
|
||||||
|
|
||||||
data = map[string]any{
|
data = map[string]any{
|
||||||
|
Loading…
Reference in New Issue
Block a user