notify edited boosted status, fix #542

This commit is contained in:
Nicolas Constant 2023-08-06 04:41:10 -04:00
parent 89c5c33de2
commit 7a8dfd0c6b
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
9 changed files with 38 additions and 17 deletions

View File

@ -22,7 +22,7 @@
(click)="acceptFollowRequest()">
<fa-icon class="follow_request__icon" [icon]="faCheck"></fa-icon>
</a>
<a href title="Reject" class="follow_request__link follow_request__link--cross"
<a href title="Reject" class="follow_request__link follow_request__link--cross"
(click)="refuseFollowRequest()">
<fa-icon class="follow_request__icon" [icon]="faTimes"></fa-icon>
</a>
@ -69,12 +69,18 @@
</a>
</div>
<app-status *ngIf="notification.status && notification.type !== 'mention'" class="stream__status" [statusWrapper]="notification.status"
[notificationAccount]="notification.account" [notificationType]="notification.type"
(browseAccountEvent)="browseAccount($event)" (browseHashtagEvent)="browseHashtag($event)"
(browseThreadEvent)="browseThread($event)"></app-status>
<app-status *ngIf="notification.status && notification.type === 'update'" class="stream__status"
[statusWrapper]="notification.status" [notificationAccount]="notification.account"
[notificationType]="notification.type" (browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)" (browseThreadEvent)="browseThread($event)"></app-status>
<app-status *ngIf="notification.status && notification.type === 'mention'" class="stream__status"
[statusWrapper]="notification.status" (browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)" (browseThreadEvent)="browseThread($event)"></app-status>
<app-status *ngIf="notification.status && notification.type !== 'mention' && notification.type !== 'update'"
class="stream__status" [statusWrapper]="notification.status" [notificationAccount]="notification.account"
[notificationType]="notification.type" (browseAccountEvent)="browseAccount($event)"
(browseHashtagEvent)="browseHashtag($event)" (browseThreadEvent)="browseThread($event)"></app-status>
<app-status *ngIf="notification.status && notification.type === 'mention'" class="stream__status" [statusWrapper]="notification.status"
(browseAccountEvent)="browseAccount($event)" (browseHashtagEvent)="browseHashtag($event)"
(browseThreadEvent)="browseThread($event)"></app-status>
</div>

View File

@ -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;
}

View File

@ -34,6 +34,17 @@
boosted your status
</div>
</div>
<div *ngIf="notificationType === 'update'">
<div class="notification--icon">
<fa-icon class="update" [icon]="faEdit"></fa-icon>
</div>
<div class="notification--label">
<a href class="notification--link" title="{{ notificationAccount.acct }}"
(click)="openAccount(notificationAccount)"
(auxclick)="openUrl(notificationAccount.url)" innerHTML="{{ notificationAccount | accountEmoji }}"></a>
edited the status you boosted
</div>
</div>
<div *ngIf="notificationType === 'poll'">
<div class="notification--icon">
<fa-icon class="boost" [icon]="faList"></fa-icon>

View File

@ -258,6 +258,10 @@
color: $boost-color;
}
.update {
color: $update-color;
}
.favorite {
color: $favorite-color;
}

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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);
})

View File

@ -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;