Skip to content

Allow sharing text mimetype content via android's share menu #6296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2022

Conversation

ouchadam
Copy link
Contributor

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Allows text/* content types to be shared via android share menu as file attachments.

Motivation and context

Fixes #6285

Screenshots / GIFs

Before After
share-ics after-share-calendar

Tests

  • Attempt to share an .ics file to element from another app, like google chrome

Tested devices

  • Physical
  • Emulator
  • OS version(s): 28

@ouchadam ouchadam added the PR-Small PR with less than 20 updated lines label Jun 13, 2022
@ouchadam ouchadam requested review from a team, Claire1817 and fedrunov and removed request for a team June 13, 2022 16:45
@@ -214,7 +214,7 @@ class AttachmentsHelper(val context: Context, val callback: Callback) : Restorab
it.toContentAttachmentData()
}
)
} else if (type.startsWith("application") || type.startsWith("file") || type.startsWith("*")) {
} else if (type.startsWith("application") || type.startsWith("file") || type.startsWith("text") || type.startsWith("*")) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to explicitly handle all the possible cases? or should our else case allow handling any type as a file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me i prefer to explicitly handle all the possible cases to keep the control of what we send. It's easy to add a new type if a user need it.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@@ -214,7 +214,7 @@ class AttachmentsHelper(val context: Context, val callback: Callback) : Restorab
it.toContentAttachmentData()
}
)
} else if (type.startsWith("application") || type.startsWith("file") || type.startsWith("*")) {
} else if (type.startsWith("application") || type.startsWith("file") || type.startsWith("text") || type.startsWith("*")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me i prefer to explicitly handle all the possible cases to keep the control of what we send. It's easy to add a new type if a user need it.

Copy link
Contributor

@fedrunov fedrunov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ouchadam ouchadam merged commit baae737 into develop Jun 16, 2022
@ouchadam ouchadam deleted the feature/adm/attach-ics branch June 16, 2022 08:33
@ouchadam ouchadam mentioned this pull request Jul 5, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Small PR with less than 20 updated lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow 'Share' function to work on .ics/calendar files
3 participants