Skip to content

Commit

Permalink
refactor: MessageReceiverUser GetEqualityValues (#571)
Browse files Browse the repository at this point in the history
* refactor: Optimize SMS sending

* fix:Receivers Variables Lost

* refactor: MessageReceiverUser GetEqualityValues
  • Loading branch information
wzh425 authored Jun 18, 2024
1 parent b5254bd commit b5fa858
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ protected override IEnumerable<object> GetEqualityValues()
{
yield return UserId;
yield return ChannelUserIdentity;

foreach (var variable in Variables.OrderBy(x => x.Key))
{
yield return variable.Key;
yield return variable.Value?.ToString() ?? string.Empty;
}
}

private MessageReceiverUser() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public async Task<IEnumerable<MessageReceiverUser>> GetReceiverUsersAsync(AppCha
var groupReceivers = await TransformGroupReceiversAsync(channel, variables, receivers.Where(x => x.Type == MessageTaskReceiverTypes.Group));
receiverUsers.AddRange(groupReceivers);

return receiverUsers.DistinctBy(x => new { x.UserId, x.ChannelUserIdentity });

return receiverUsers.Distinct();
}

public async Task<IEnumerable<MessageReceiverUser>> TransformUserReceivers(AppChannel Channel, ExtraPropertyDictionary variables, IEnumerable<MessageTaskReceiver> receivers)
Expand Down

0 comments on commit b5fa858

Please sign in to comment.