π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Allow owners/admins to delete any comment
ashilkn46334b52fd8a
diff --git a/mobile/apps/photos/lib/ui/social/comments_screen.dart b/mobile/apps/photos/lib/ui/social/comments_screen.dartindex 8b83718a05..a5043fdc2d 100644--- a/mobile/apps/photos/lib/ui/social/comments_screen.dart+++ b/mobile/apps/photos/lib/ui/social/comments_screen.dart@@ -558,7 +558,7 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {final keyboardHeight = MediaQuery.of(context).viewInsets.bottom;final isDarkMode = Theme.of(context).brightness == Brightness.dark;final selectedCollection = _currentCollection;- final canModerateAnonComments = selectedCollection != null &&+ final canModerateComments = selectedCollection != null &&(selectedCollection.isOwner(_currentUserID) ||selectedCollection.isAdmin(_currentUserID));@@ -615,7 +615,7 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {comment: comment,user: _getUserForComment(comment),isOwnComment: comment.userID == _currentUserID,- canModerateAnonComments: canModerateAnonComments,+ canModerateComments: canModerateComments,currentUserID: _currentUserID,collectionID: _selectedCollectionID,isHighlighted: isHighlighted,diff --git a/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dartindex 3390e7f6ba..2a822b7750 100644--- a/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart+++ b/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart@@ -29,7 +29,7 @@ class CommentBubbleWidget extends StatefulWidget {final Comment comment;final User user;final bool isOwnComment;- final bool canModerateAnonComments;+ final bool canModerateComments;final int currentUserID;final int collectionID;final Future<Comment?> Function()? onFetchParent;@@ -48,7 +48,7 @@ class CommentBubbleWidget extends StatefulWidget {required this.comment,required this.user,required this.isOwnComment,- required this.canModerateAnonComments,+ required this.canModerateComments,required this.currentUserID,required this.collectionID,this.onFetchParent,@@ -474,8 +474,7 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget>double bubbleScale = 1.0,double capsuleOpacity = 1.0,}) {- final canDeleteComment = widget.isOwnComment ||- (widget.canModerateAnonComments && widget.comment.isAnonymous);+ final canDeleteComment = widget.isOwnComment || widget.canModerateComments;final actualCount = _reactions.where((r) => !r.isDeleted).length;final likeCount = (actualCount + _optimisticLikeDelta).clamp(0, 999999);