Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update to log attachments
  • Loading branch information
LeeParrishMSFT committed Mar 30, 2021
commit c0659652f5c8f2a2b6c5dc576c918b793faa5b0b
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ private TelemetryConstants() {

}

public static final String ATTACHMENTSPROPERTY = "attachments";
public static final String CHANNELIDPROPERTY = "channelId";
public static final String CONVERSATIONIDPROPERTY = "conversationId";
public static final String CONVERSATIONNAMEPROPERTY = "conversationName";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ protected CompletableFuture<Void> onDeleteActivity(Activity activity) {
* {@link BotTelemetryClient#trackEvent} method for the
* BotMessageReceived event.
*/
@SuppressWarnings("PMD.EmptyCatchBlock")
protected CompletableFuture<Map<String, String>> fillReceiveEventProperties(
Activity activity,
Map<String, String> additionalProperties
Expand Down Expand Up @@ -217,6 +218,14 @@ protected CompletableFuture<Map<String, String>> fillReceiveEventProperties(
if (!StringUtils.isEmpty(activity.getSpeak())) {
properties.put(TelemetryConstants.SPEAKPROPERTY, activity.getSpeak());
}

if (activity.getAttachments() != null && activity.getAttachments().size() > 0) {
try {
properties.put(TelemetryConstants.ATTACHMENTSPROPERTY,
Serialization.toString(activity.getAttachments()));
} catch (JsonProcessingException e) {
}
}
}

populateAdditionalChannelProperties(activity, properties);
Expand Down