Hi,
When sending, editing and deleting chat messages of a ChatThreadClient, is it possible to bind a CommunicationUserIdentifier to the action, without adding the user id (as a string) as the senderDisplayName? Something like this:
await chatThreadClient.SendMessageAsync(content, ChatMessageType.Text, identifier);
orawait chatThreadClient.SendMessageAsync(content, ChatMessageType.Text, senderDisplayName, identifier);
instead of:
await chatThreadClient.SendMessageAsync(content, ChatMessageType.Text, senderDisplayName);
I was hoping to extract the id when loading the messages (with chatThreadClient.GetMessages() ) in order to determine how messages are rendered, depending on if they were typed by others, or the currently logged in user. E.g. in MS Teams, where messages by others are a bit to the left, while messages by me are to the right.
Using senderDisplayName as intended is unfortunately not sufficient enough, as I want the message senders to be able to have the same display names, while being perceived as different users. Currently, I've solved this by using the id of a ChatParticipant as the senderDisplayName, saving the id and name of a ChatParticipant in a separate lookup table,. Then I look up the name in the table using the id. However, this hack trickles down and causes issues elsewhere in my application. Such as deleting a user (removing them from the lookup table) and then not having a way of de-coding the id stored in the senderDisplayName
Specifications
Windows 10,
.Net C#
Azure.Communication.Chat v1.0.1
Azure.Communication.Identity v1.0.1
Kindly,
Isak