Add support for sharing URLs and text. (#3546)

* Add support for sharing URLs and text.

* Fix a bug where a stored draft would overwrite the shared text.

* Add tests.
This commit is contained in:
Doug
2024-11-21 14:48:38 +00:00
committed by GitHub
parent 3a9f54a9f6
commit c081e538b4
14 changed files with 219 additions and 83 deletions
@@ -13,6 +13,15 @@ enum ShareExtensionConstants {
enum ShareExtensionPayload: Hashable, Codable {
case mediaFile(roomID: String?, mediaFile: ShareExtensionMediaFile)
case text(roomID: String?, text: String)
var roomID: String? {
switch self {
case .mediaFile(let roomID, _),
.text(let roomID, _):
roomID
}
}
}
struct ShareExtensionMediaFile: Hashable, Codable {