Skip to content

Commit

Permalink
enhance: 通知内のフォロワーへのメッセージで絵文字を表示するように
Browse files Browse the repository at this point in the history
  • Loading branch information
4ster1sk committed Nov 21, 2024
1 parent ba26c61 commit 6abe23b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/view/notification_page/notification_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ class NotificationItem extends ConsumerWidget {
if (type is FollowRequestAccepted && type.message != null)
SimpleMfmText(
S.of(context).messageForFollower(type.message ?? ""),
emojis: type.user?.emojis ?? {},
)
],
),
Expand Down
14 changes: 10 additions & 4 deletions lib/view/notification_page/notification_page_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ class MentionQuoteNotificationData extends NotificationData {
sealed class FollowNotificationDataType {
String Function(BuildContext, String) get name;
static final follow = _Follow();
factory FollowNotificationDataType.followRequestAccepted(String? message) =>
FollowRequestAccepted(message);
factory FollowNotificationDataType.followRequestAccepted(
String? message,
User? user,
) =>
FollowRequestAccepted(message, user);
static final receiveFollowRequest = _ReceiveFollowRequest();
}

Expand All @@ -77,7 +80,8 @@ class _Follow implements FollowNotificationDataType {

class FollowRequestAccepted implements FollowNotificationDataType {
final String? message;
FollowRequestAccepted(this.message);
final User? user;
FollowRequestAccepted(this.message, this.user);
@override
String Function(BuildContext context, String userName) get name =>
(context, userName) =>
Expand Down Expand Up @@ -241,7 +245,9 @@ extension INotificationsResponseExtension on Iterable<INotificationsResponse> {
user: element.user,
createdAt: element.createdAt,
type: FollowNotificationDataType.followRequestAccepted(
element.message),
element.message,
element.user,
),
id: element.id,
),
);
Expand Down

0 comments on commit 6abe23b

Please sign in to comment.