kopia lustrzana https://gitlab.com/mysocialportal/relatica
Fix missing reshare/reblog status from Mastodon format.
rodzic
9031ab98f5
commit
3da3762324
|
@ -38,6 +38,9 @@ class NotificationControl extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final manager = context.watch<NotificationsManager>();
|
||||
if (notification.type == NotificationType.reblog) {
|
||||
print(notification);
|
||||
}
|
||||
return ListTile(
|
||||
tileColor: notification.dismissed ? null : Colors.black12,
|
||||
leading: GestureDetector(
|
||||
|
@ -64,6 +67,7 @@ class NotificationControl extends StatelessWidget {
|
|||
case NotificationType.favourite:
|
||||
case NotificationType.mention:
|
||||
case NotificationType.reshare:
|
||||
case NotificationType.reblog:
|
||||
case NotificationType.status:
|
||||
_goToStatus(context);
|
||||
break;
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
import 'package:logging/logging.dart';
|
||||
|
||||
final _logger = Logger('NotificationType');
|
||||
|
||||
enum NotificationType {
|
||||
favourite,
|
||||
follow,
|
||||
follow_request,
|
||||
mention,
|
||||
reshare,
|
||||
reblog,
|
||||
status,
|
||||
unknown;
|
||||
|
||||
|
@ -18,6 +23,7 @@ enum NotificationType {
|
|||
case NotificationType.mention:
|
||||
return 'mentioned you on';
|
||||
case NotificationType.reshare:
|
||||
case NotificationType.reblog:
|
||||
return 'reshared';
|
||||
case NotificationType.status:
|
||||
return 'updated';
|
||||
|
@ -33,7 +39,10 @@ enum NotificationType {
|
|||
|
||||
return NotificationType.values.firstWhere(
|
||||
(e) => e.name == text,
|
||||
orElse: () => unknown,
|
||||
orElse: () {
|
||||
_logger.severe('Parsing error, unknown type string: $text');
|
||||
return unknown;
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ extension NotificationMastodonExtension on UserNotification {
|
|||
case NotificationType.favourite:
|
||||
case NotificationType.mention:
|
||||
case NotificationType.reshare:
|
||||
case NotificationType.reblog:
|
||||
case NotificationType.status:
|
||||
final status = TimelineEntryMastodonExtensions.fromJson(json['status']);
|
||||
statusId = status.id;
|
||||
|
|
Ładowanie…
Reference in New Issue