@azure/communication-signaling
Advanced tools
Comparing version 1.0.0-beta.31 to 1.0.0-beta.32
{ | ||
"name": "@azure/communication-signaling", | ||
"version": "1.0.0-beta.31", | ||
"version": "1.0.0-beta.32", | ||
"description": "Azure Communication Signaling Client", | ||
@@ -5,0 +5,0 @@ "sdk-type": "client", |
@@ -148,2 +148,16 @@ // Copyright (c) Microsoft Corporation. | ||
function toChatMessageEditedEvent<T extends ChatMessageEditedEvent, P extends MessageEditedPayload>( | ||
payload: P, | ||
resourceEndpoint: string, | ||
gatewayApiVersion: string | ||
): T { | ||
return { | ||
...toChatMessageReceivedEvent(payload, resourceEndpoint, gatewayApiVersion), | ||
editedOn: new Date(payload.edittime), | ||
policyViolation: toPolicyViolation( | ||
parseJsonString(payload.policyViolation) as PolicyViolationPayload | ||
) | ||
} | ||
} | ||
const toEventPayload = ( | ||
@@ -167,3 +181,3 @@ event: ChatEventId, | ||
const payload = genericPayload as StreamingChatMessageChunkReceivedPayload; | ||
return toChatMessageReceivedEvent(payload, resourceEndpoint, gatewayApiVersion); | ||
return toChatMessageEditedEvent(payload, resourceEndpoint, gatewayApiVersion); | ||
} | ||
@@ -173,24 +187,3 @@ | ||
const payload = genericPayload as MessageEditedPayload; | ||
const eventPayload: ChatMessageEditedEvent = { | ||
threadId: payload.groupId, | ||
sender: constructIdentifierKindFromMri(payload.senderId), | ||
senderDisplayName: payload.senderDisplayName, | ||
recipient: constructIdentifierKindFromMri(payload.recipientMri), | ||
id: payload.messageId, | ||
createdOn: new Date(payload.originalArrivalTime), | ||
version: payload.version, | ||
message: payload.messageBody, | ||
editedOn: new Date(payload.edittime), | ||
type: payload.messageType, | ||
metadata: (parseJsonString(payload.acsChatMessageMetadata) as Record<string, string>) || {}, | ||
attachments: transformEndpoint( | ||
(parseJsonString(payload.attachments) as ChatAttachment[]) || [], | ||
resourceEndpoint, | ||
gatewayApiVersion | ||
), | ||
policyViolation: toPolicyViolation( | ||
parseJsonString(payload.policyViolation) as PolicyViolationPayload | ||
), | ||
}; | ||
return eventPayload; | ||
return toChatMessageEditedEvent(payload, resourceEndpoint, gatewayApiVersion); | ||
} | ||
@@ -197,0 +190,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
3748772
13515