feat: add shared_file_urls helper to extract SharePoint links from HTML attachments#498
Open
dcaayushd wants to merge 6 commits into
Open
feat: add shared_file_urls helper to extract SharePoint links from HTML attachments#498dcaayushd wants to merge 6 commits into
dcaayushd wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a MessageActivity.shared_file_urls convenience property to extract SharePoint file links from text/html attachments, addressing a Teams platform behavior where shared cloud files appear only as embedded HTML rather than structured attachment metadata.
Changes:
- Introduced
shared_file_urlsproperty onMessageActivityto parse URLs from HTML attachments. - Added unit tests validating URL extraction and the empty-list behavior when no HTML attachments exist.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/api/src/microsoft_teams/api/activities/message/message.py | Adds shared_file_urls helper to extract SharePoint links from text/html attachment content. |
| packages/api/tests/unit/test_message_activities.py | Adds unit tests for the new URL extraction property. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
lilyydu
reviewed
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #487
when a user shares a file via the Teams compose box, Teams embeds the
file link in a text/html attachment rather than sending structured file
metadata. the activity payload has no file info, just HTML content.
added a shared_file_urls property on MessageActivity that parses
SharePoint/OneDrive URLs from text/html attachments as a practical
workaround for this Teams platform behavior.
added two tests: one confirming URL extraction works, one confirming
empty list returned when no HTML attachments present.