🐛 Fix ws sync issue

This commit is contained in:
LittleSheep 2024-04-04 23:27:59 +08:00
parent 07fb64a680
commit f2f75269d5

View File

@ -82,14 +82,12 @@ func NewMessage(message models.Message) (models.Message, error) {
ChannelID: message.ChannelID, ChannelID: message.ChannelID,
}).Preload("Account").Find(&members).Error; err == nil { }).Preload("Account").Find(&members).Error; err == nil {
for _, member := range members { for _, member := range members {
if member.ID == message.Sender.ID { if member.ID != message.Sender.ID {
continue
}
err = NotifyAccount(member.Account, "New message at "+message.Channel.Name, message.Content, true) err = NotifyAccount(member.Account, "New message at "+message.Channel.Name, message.Content, true)
if err != nil { if err != nil {
log.Warn().Err(err).Msg("An error occurred when trying notify user.") log.Warn().Err(err).Msg("An error occurred when trying notify user.")
} }
}
message, _ = GetMessage(message.Channel, message.ID) message, _ = GetMessage(message.Channel, message.ID)
PushCommand(member.AccountID, models.UnifiedCommand{ PushCommand(member.AccountID, models.UnifiedCommand{