Skip to content

Commit 033c596

Browse files
authored
Update data-loss-prevention with API changes
Update data-loss-prevention with API changes based on the new API view
1 parent 211d345 commit 033c596

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

articles/communication-services/how-tos/chat-sdk/data-loss-prevention.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ let chatClient = new ChatClient(endpointUrl, new AzureCommunicationTokenCredenti
2929

3030
await chatClient.startRealtimeNotifications();
3131
chatClient.on("chatMessageEdited", (e) => {
32-
if (e.messageBody == "" &&
33-
e.sender.kind == "microsoftTeamsUser") {
32+
if (e.policyViolation.result == "contentBlocked") {
3433
// Show UI message blocked
3534
}
3635
});
@@ -40,8 +39,7 @@ chatClient.on("chatMessageEdited", (e) => {
4039
```javascript
4140
const messages = chatThreadClient.listMessages();
4241
for await (const message of messages) {
43-
if (message.content?.message == "" &&
44-
message.sender?.kind == "microsoftTeamsUser") {
42+
if (message.policyViolation.result == "contentBlocked") {
4543
// Show UI message blocked
4644
}
4745
}

0 commit comments

Comments
 (0)