π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] Include album descriptions in shared links (#12262)
Aman Raj31bed6eda413
diff --git a/mobile/apps/photos/lib/ui/sharing/manage_links_widget.dart b/mobile/apps/photos/lib/ui/sharing/manage_links_widget.dartindex 4c47b17d5e..f09d0bd45f 100644--- a/mobile/apps/photos/lib/ui/sharing/manage_links_widget.dart+++ b/mobile/apps/photos/lib/ui/sharing/manage_links_widget.dart@@ -329,7 +329,13 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {title: context.strings.sendLink,icon: HugeIcons.strokeRoundedSent,onTap: () async {- await shareAlbumLink(context, urlValue, sendLinkButtonKey);+ await shareAlbumLink(+ context,+ urlValue,+ sendLinkButtonKey,+ albumName: widget.collection!.displayName,+ albumDescription: widget.collection!.displayDescription,+ );},),ShareMenuItem(diff --git a/mobile/apps/photos/lib/ui/sharing/public_link_enabled_actions_widget.dart b/mobile/apps/photos/lib/ui/sharing/public_link_enabled_actions_widget.dartindex 93d7024abc..c8925f4a88 100644--- a/mobile/apps/photos/lib/ui/sharing/public_link_enabled_actions_widget.dart+++ b/mobile/apps/photos/lib/ui/sharing/public_link_enabled_actions_widget.dart@@ -60,7 +60,13 @@ class PublicLinkEnabledActionsWidget extends StatelessWidget {title: context.strings.sendLink,icon: HugeIcons.strokeRoundedSent,onTap: () async {- await shareAlbumLink(context, url, effectiveKey);+ await shareAlbumLink(+ context,+ url,+ effectiveKey,+ albumName: collection.displayName,+ albumDescription: collection.displayDescription,+ );},),ShareMenuItem(diff --git a/mobile/apps/photos/lib/utils/share_util.dart b/mobile/apps/photos/lib/utils/share_util.dartindex 191ba5afa6..5deee249ff 100644--- a/mobile/apps/photos/lib/utils/share_util.dart+++ b/mobile/apps/photos/lib/utils/share_util.dart@@ -135,6 +135,20 @@ Future<ShareResult> shareText(String formatMemoryShareText(String title, String shareUrl) =>'$title: $shareUrl';+String formatAlbumShareText(+ String albumName,+ String? albumDescription,+ String shareUrl,+) {+ final sharedDescription =+ albumDescription != null && albumDescription.characters.length > 100+ ? '${albumDescription.characters.take(100)}...'+ : albumDescription;+ return sharedDescription == null+ ? '$albumName: $shareUrl'+ : '$albumName - $sharedDescription: $shareUrl';+}+Future<ShareResult> shareLinkWithDescription(String url, {String? description,@@ -238,9 +252,15 @@ void shareSelected(Future<void> shareAlbumLink(BuildContext context,String url,- GlobalKey key,-) async {- await shareLinkWithDescription(url, context: context, key: key);+ GlobalKey key, {+ required String albumName,+ String? albumDescription,+}) async {+ await shareText(+ formatAlbumShareText(albumName, albumDescription, url),+ context: context,+ key: key,+ );}// iPad share sheets require a source rectangle.