From 7a8dfd0c6bd81f9fa75e477dbf551e34d3c957dc Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Sun, 6 Aug 2023 04:41:10 -0400 Subject: [PATCH] notify edited boosted status, fix #542 --- .../notification/notification.component.html | 22 ++++++++++++------- .../notifications/notifications.component.ts | 3 ++- .../stream/status/status.component.html | 11 ++++++++++ .../stream/status/status.component.scss | 4 ++++ .../stream/status/status.component.ts | 5 +++-- .../stream-notifications.component.ts | 2 +- src/app/services/streaming.service.ts | 5 +---- src/app/services/user-notification.service.ts | 2 +- src/sass/_variables.scss | 1 + 9 files changed, 38 insertions(+), 17 deletions(-) diff --git a/src/app/components/floating-column/manage-account/notifications/notification/notification.component.html b/src/app/components/floating-column/manage-account/notifications/notification/notification.component.html index 93d2f28d..59bc569c 100644 --- a/src/app/components/floating-column/manage-account/notifications/notification/notification.component.html +++ b/src/app/components/floating-column/manage-account/notifications/notification/notification.component.html @@ -22,7 +22,7 @@ (click)="acceptFollowRequest()"> - @@ -69,12 +69,18 @@ - + + + + + - \ No newline at end of file diff --git a/src/app/components/floating-column/manage-account/notifications/notifications.component.ts b/src/app/components/floating-column/manage-account/notifications/notifications.component.ts index f766ca70..c1e8bf60 100644 --- a/src/app/components/floating-column/manage-account/notifications/notifications.component.ts +++ b/src/app/components/floating-column/manage-account/notifications/notifications.component.ts @@ -101,7 +101,7 @@ export class NotificationsComponent extends BrowseBase { this.isLoading = true; this.isProcessingInfiniteScroll = true; - this.mastodonService.getNotifications(this.account.info, ['mention', 'update'], this.lastId) + this.mastodonService.getNotifications(this.account.info, ['mention'], this.lastId) .then((notifications: Notification[]) => { if (notifications.length === 0) { this.maxReached = true; @@ -152,6 +152,7 @@ export class NotificationWrapper { case 'reblog': case 'favourite': case 'poll': + case 'update': this.status = new StatusWrapper(notification.status, provider, applyCw, hideStatus); break; } diff --git a/src/app/components/stream/status/status.component.html b/src/app/components/stream/status/status.component.html index 0d0371d0..9db3c0e2 100644 --- a/src/app/components/stream/status/status.component.html +++ b/src/app/components/stream/status/status.component.html @@ -34,6 +34,17 @@ boosted your status +
+
+ +
+
+ + edited the status you boosted +
+
diff --git a/src/app/components/stream/status/status.component.scss b/src/app/components/stream/status/status.component.scss index 9a5aad81..da273f0e 100644 --- a/src/app/components/stream/status/status.component.scss +++ b/src/app/components/stream/status/status.component.scss @@ -258,6 +258,10 @@ color: $boost-color; } +.update { + color: $update-color; +} + .favorite { color: $favorite-color; } diff --git a/src/app/components/stream/status/status.component.ts b/src/app/components/stream/status/status.component.ts index eb37e202..8b08b397 100644 --- a/src/app/components/stream/status/status.component.ts +++ b/src/app/components/stream/status/status.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, Input, Output, EventEmitter, ViewChild, ElementRef } from "@angular/core"; -import { faStar, faRetweet, faList, faThumbtack } from "@fortawesome/free-solid-svg-icons"; +import { faStar, faRetweet, faList, faThumbtack, faEdit } from "@fortawesome/free-solid-svg-icons"; import { Subscription } from "rxjs"; import { Status, Account, Translation } from "../../../services/models/mastodon.interfaces"; @@ -23,6 +23,7 @@ export class StatusComponent implements OnInit { faRetweet = faRetweet; faList = faList; faThumbtack = faThumbtack; + faEdit = faEdit; displayedStatus: Status; displayedStatusWrapper: StatusWrapper; @@ -52,7 +53,7 @@ export class StatusComponent implements OnInit { @Input() isThreadDisplay: boolean; - @Input() notificationType: 'mention' | 'reblog' | 'favourite' | 'poll'; + @Input() notificationType: 'mention' | 'reblog' | 'favourite' | 'poll' | 'update'; @Input() notificationAccount: Account; private _statusWrapper: StatusWrapper; diff --git a/src/app/components/stream/stream-notifications/stream-notifications.component.ts b/src/app/components/stream/stream-notifications/stream-notifications.component.ts index 05d202d7..c79b4ed2 100644 --- a/src/app/components/stream/stream-notifications/stream-notifications.component.ts +++ b/src/app/components/stream/stream-notifications/stream-notifications.component.ts @@ -126,7 +126,7 @@ export class StreamNotificationsComponent extends BrowseBase { this.loadMentions(userNotifications); }); - this.mastodonService.getNotifications(this.account, ['update'], null, null, 10) //FIXME: disable edition update until supported + this.mastodonService.getNotifications(this.account, [], null, null, 10) .then((notifications: Notification[]) => { this.isNotificationsLoading = false; diff --git a/src/app/services/streaming.service.ts b/src/app/services/streaming.service.ts index 92f91ff3..2e610657 100644 --- a/src/app/services/streaming.service.ts +++ b/src/app/services/streaming.service.ts @@ -96,7 +96,7 @@ export class StreamingWrapper { } private pullNewNotifications() { - this.mastodonService.getNotifications(this.account, ['update'], null, this.since_id_notifications, 10) + this.mastodonService.getNotifications(this.account, [], null, this.since_id_notifications, 10) .then((notifications: Notification[]) => { //notifications = notifications.sort((a, b) => a.id.localeCompare(b.id)); let soundMuted = !this.since_id_notifications; @@ -168,9 +168,6 @@ export class StreamingWrapper { newUpdate.type = EventEnum.unknow; } - if(newUpdate.notification && newUpdate.notification.type === 'update') { //FIXME: disabling edition update until supported - return; - } this.statusUpdateSubjet.next(newUpdate); } diff --git a/src/app/services/user-notification.service.ts b/src/app/services/user-notification.service.ts index 370d4dc1..6ca0fb9d 100644 --- a/src/app/services/user-notification.service.ts +++ b/src/app/services/user-notification.service.ts @@ -66,7 +66,7 @@ export class UserNotificationService { this.notificationService.notifyHttpError(err, account); }); - let getNotificationPromise = this.mastodonService.getNotifications(account, ['mention', 'update'], null, null, 10) + let getNotificationPromise = this.mastodonService.getNotifications(account, ['mention'], null, null, 10) .then((notifications: Notification[]) => { this.processMentionsAndNotifications(account, notifications, NotificationTypeEnum.UserNotification); }) diff --git a/src/sass/_variables.scss b/src/sass/_variables.scss index 10f4171c..54741cb5 100644 --- a/src/sass/_variables.scss +++ b/src/sass/_variables.scss @@ -21,6 +21,7 @@ $status-primary-color: #fff; $status-secondary-color: #4e5572; $status-links-color: #d9e1e8; $boost-color : #5098eb; +$update-color : #95e470; $favorite-color: #ffc16f; $bookmarked-color: #ff5050;