Prevent message duplication with sender check

This commit is contained in:
Marcel Baumgartner
2023-04-26 18:25:39 +02:00
parent 762d487ec9
commit 9fc439a5e8
2 changed files with 12 additions and 2 deletions

View File

@@ -37,7 +37,12 @@ public class SupportChatAdminService
await Event.On<SupportChatMessage>($"supportChat.{Recipient.Id}.message", this, async message =>
{
if (OnMessage != null)
{
if(message.Sender != null && message.Sender.Id == User.Id)
return;
await OnMessage.Invoke(message);
}
});
await Event.On<User>($"supportChat.{Recipient.Id}.typing", this, async user =>

View File

@@ -36,7 +36,12 @@ public class SupportChatClientService : IDisposable
await Event.On<SupportChatMessage>($"supportChat.{User.Id}.message", this, async message =>
{
if (OnMessage != null)
{
if(message.Sender != null && message.Sender.Id == User.Id)
return;
await OnMessage.Invoke(message);
}
});
await Event.On<User>($"supportChat.{User.Id}.typing", this, async user =>