diff --git a/lib/extension/note_extension.dart b/lib/extension/note_extension.dart index 21c429c7e..eaa94ea25 100644 --- a/lib/extension/note_extension.dart +++ b/lib/extension/note_extension.dart @@ -4,6 +4,7 @@ extension NoteExtension on Note { bool get isRenote => renoteId != null && text == null && + replyId == null && cw == null && files.isEmpty && poll == null; diff --git a/lib/extension/notes_create_request_extension.dart b/lib/extension/notes_create_request_extension.dart index 5548cab58..ab2b6e007 100644 --- a/lib/extension/notes_create_request_extension.dart +++ b/lib/extension/notes_create_request_extension.dart @@ -4,12 +4,13 @@ extension NotesCreateRequestExtension on NotesCreateRequest { bool get isRenote => renoteId != null && (text?.isEmpty ?? true) && + replyId == null && (cw?.isEmpty ?? true) && (fileIds?.isEmpty ?? true) && poll == null; bool get canPost => - ((text?.isNotEmpty ?? false) || poll != null) && + ((text?.isNotEmpty ?? false) || poll != null || renoteId != null) && (poll == null || (poll!.choices.length >= 2 && poll!.choices.every((choice) => choice.isNotEmpty))); diff --git a/lib/view/page/post_page.dart b/lib/view/page/post_page.dart index ae84dd8ad..531a6c9ce 100644 --- a/lib/view/page/post_page.dart +++ b/lib/view/page/post_page.dart @@ -179,7 +179,7 @@ class PostPage extends HookConsumerWidget { reply?.visibility != NoteVisibility.specified; final canChangeChannel = (renote?.channel?.allowRenoteToExternal ?? true) && reply?.channel == null; - final canPost = request.isRenote || request.canPost || attaches.isNotEmpty; + final canPost = request.canPost || attaches.isNotEmpty; final needsUpload = attaches.any((file) => file is LocalPostFile); final (buttonText, buttonIcon) = needsUpload ? (t.misskey.upload, Icons.upload) diff --git a/lib/view/widget/cw_button.dart b/lib/view/widget/cw_button.dart index 75aeb5652..c0ed0c2ed 100644 --- a/lib/view/widget/cw_button.dart +++ b/lib/view/widget/cw_button.dart @@ -38,7 +38,7 @@ class CwButton extends StatelessWidget { text: [ if (note case Note(:final text?)) t.misskey.cw_.chars(count: text.length), - if (note.renote != null) t.misskey.quote, + if (note.renoteId != null) t.misskey.quote, if (note.files.isNotEmpty) t.misskey.cw_.files(count: note.files.length), if (note.poll != null) t.misskey.poll, diff --git a/lib/view/widget/post_form.dart b/lib/view/widget/post_form.dart index 887d9d989..dfea625f7 100644 --- a/lib/view/widget/post_form.dart +++ b/lib/view/widget/post_form.dart @@ -342,7 +342,7 @@ class PostForm extends HookConsumerWidget { tooltip: request.isRenote ? t.misskey.renote : t.misskey.send, - onPressed: request.isRenote || request.canPost + onPressed: request.canPost || attaches.isNotEmpty ? () => _post(ref, focusNode) : null, icon: Icon(