Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Licensed under the MIT License.
"""Middleware Component for logging Activity messages."""
from typing import Awaitable, Callable, List, Dict
from jsonpickle import encode

from botbuilder.schema import Activity, ConversationReference, ActivityTypes
from botbuilder.schema.teams import TeamsChannelData, TeamInfo
from botframework.connector import Channels
Expand Down Expand Up @@ -33,7 +35,7 @@ def telemetry_client(self) -> BotTelemetryClient:

@property
def log_personal_information(self) -> bool:
""" Gets a value indicating whether determines whether to log personal
"""Gets a value indicating whether determines whether to log personal
information that came from the user."""
return self._log_personal_information

Expand Down Expand Up @@ -217,10 +219,10 @@ async def fill_send_event_properties(

# Use the LogPersonalInformation flag to toggle logging PII data, text and user name are common examples
if self.log_personal_information:
if activity.attachments and activity.attachments.strip():
properties[
TelemetryConstants.ATTACHMENTS_PROPERTY
] = activity.attachments
if activity.attachments and len(activity.attachments) > 0:
properties[TelemetryConstants.ATTACHMENTS_PROPERTY] = encode(
activity.attachments
)
if activity.from_property.name and activity.from_property.name.strip():
properties[
TelemetryConstants.FROM_NAME_PROPERTY
Expand Down