commit
7d42737c27
|
@ -1,15 +1,28 @@
|
||||||
|
const { join } = require("path");
|
||||||
const { app, Menu, MenuItem, BrowserWindow, shell } = require("electron");
|
const { app, Menu, MenuItem, BrowserWindow, shell } = require("electron");
|
||||||
|
|
||||||
// Keep a global reference of the window object, if you don't, the window will
|
// Keep a global reference of the window object, if you don't, the window will
|
||||||
// be closed automatically when the JavaScript object is garbage collected.
|
// be closed automatically when the JavaScript object is garbage collected.
|
||||||
let win;
|
let win;
|
||||||
|
const globalAny = global;
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV !== 'development') {
|
||||||
|
globalAny.__static = require('path').join(__dirname, '/assets/icons').replace(/\\/g, '\\\\');
|
||||||
|
}
|
||||||
|
|
||||||
function createWindow() {
|
function createWindow() {
|
||||||
// Create the browser window.
|
// Set icon
|
||||||
|
let icon = join(globalAny.__static, '/png/512x512.png');
|
||||||
|
if (process.platform === "win32") {
|
||||||
|
icon = join(globalAny.__static, '/win/icon.ico');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the browser window
|
||||||
win = new BrowserWindow({
|
win = new BrowserWindow({
|
||||||
width: 377,
|
width: 377,
|
||||||
height: 800,
|
height: 800,
|
||||||
title: "Sengi",
|
title: "Sengi",
|
||||||
|
icon: icon,
|
||||||
backgroundColor: "#131925",
|
backgroundColor: "#131925",
|
||||||
useContentSize: true,
|
useContentSize: true,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "sengi",
|
"name": "sengi",
|
||||||
"version": "0.32.0",
|
"version": "0.33.0",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"main": "main-electron.js",
|
"main": "main-electron.js",
|
||||||
"description": "A multi-account desktop client for Mastodon and Pleroma",
|
"description": "A multi-account desktop client for Mastodon and Pleroma",
|
||||||
|
|
|
@ -1,4 +1,35 @@
|
||||||
<div class="notification">
|
<div class="notification">
|
||||||
|
<div *ngIf="notification.type === 'follow_request' && !followRequestProcessed">
|
||||||
|
<div class="stream__notification--icon" title="{{notification.account.acct}}">
|
||||||
|
<fa-icon class="followed" [icon]="faUserClock"></fa-icon>
|
||||||
|
</div>
|
||||||
|
<div class="stream__notification--label">
|
||||||
|
<a href class="stream__link" title="{{notification.account.acct}}"
|
||||||
|
(click)="openAccount(notification.account)" (auxclick)="openUrl(notification.account.url)"
|
||||||
|
innerHTML="{{ notification.account | accountEmoji }}"></a>
|
||||||
|
submitted a follow request
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a href (click)="openAccount(notification.account)" (auxclick)="openUrl(notification.account.url)"
|
||||||
|
class="follow-account" title="{{notification.account.acct}}">
|
||||||
|
<img class="follow-account__avatar" src="{{ notification.account.avatar }}" />
|
||||||
|
<span class="follow-account__display-name" innerHTML="{{ notification.account | accountEmoji }}"></span>
|
||||||
|
<span class="follow-account__acct">@{{ notification.account.acct }}</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<div class="follow_request">
|
||||||
|
<a href title="Authorize" class="follow_request__link follow_request__link--check"
|
||||||
|
(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"
|
||||||
|
(click)="refuseFollowRequest()">
|
||||||
|
<fa-icon class="follow_request__icon" [icon]="faTimes"></fa-icon>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div *ngIf="notification.type === 'follow'">
|
<div *ngIf="notification.type === 'follow'">
|
||||||
<div class="stream__notification--icon" title="{{notification.account.acct}}">
|
<div class="stream__notification--icon" title="{{notification.account.acct}}">
|
||||||
<fa-icon class="followed" [icon]="faUserPlus"></fa-icon>
|
<fa-icon class="followed" [icon]="faUserPlus"></fa-icon>
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
color: $boost-color;
|
color: $boost-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$acccount-info-left: 70px;
|
||||||
.follow-account {
|
.follow-account {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
|
@ -62,8 +63,7 @@
|
||||||
height: 45px;
|
height: 45px;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
$acccount-info-left: 70px;
|
|
||||||
&__display-name {
|
&__display-name {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 7px;
|
top: 7px;
|
||||||
|
@ -81,5 +81,44 @@
|
||||||
left: $acccount-info-left;
|
left: $acccount-info-left;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: $status-links-color;
|
color: $status-links-color;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
width: calc(100% - #{$acccount-info-left});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.follow_request {
|
||||||
|
width: calc(100% - #{$acccount-info-left});
|
||||||
|
margin-left: $acccount-info-left;
|
||||||
|
|
||||||
|
&__link {
|
||||||
|
display: inline-block;
|
||||||
|
width: calc(50%);
|
||||||
|
padding: 2px;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
color: rgb(182, 182, 182);
|
||||||
|
transition: all .2s;
|
||||||
|
|
||||||
|
// outline: 1px dotted greenyellow;
|
||||||
|
|
||||||
|
&--check {
|
||||||
|
&:hover {
|
||||||
|
color: greenyellow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&--cross {
|
||||||
|
&:hover {
|
||||||
|
color: orangered;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__icon {
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,22 +1,30 @@
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { faUserPlus } from "@fortawesome/free-solid-svg-icons";
|
import { faUserPlus, faUserClock, faCheck, faTimes } from "@fortawesome/free-solid-svg-icons";
|
||||||
|
|
||||||
import { NotificationWrapper } from '../notifications.component';
|
import { NotificationWrapper } from '../notifications.component';
|
||||||
import { ToolsService } from '../../../../../services/tools.service';
|
import { ToolsService } from '../../../../../services/tools.service';
|
||||||
import { Account } from '../../../../../services/models/mastodon.interfaces';
|
import { Account } from '../../../../../services/models/mastodon.interfaces';
|
||||||
import { BrowseBase } from '../../../../../components/common/browse-base';
|
import { BrowseBase } from '../../../../../components/common/browse-base';
|
||||||
|
import { MastodonWrapperService } from '../../../../../services/mastodon-wrapper.service';
|
||||||
|
import { NotificationService } from '../../../../../services/notification.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-notification',
|
selector: 'app-notification',
|
||||||
templateUrl: './notification.component.html',
|
templateUrl: './notification.component.html',
|
||||||
styleUrls: ['./notification.component.scss']
|
styleUrls: ['./notification.component.scss']
|
||||||
})
|
})
|
||||||
export class NotificationComponent extends BrowseBase {
|
export class NotificationComponent extends BrowseBase {
|
||||||
faUserPlus = faUserPlus;
|
faUserPlus = faUserPlus;
|
||||||
|
faUserClock = faUserClock;
|
||||||
|
faCheck = faCheck;
|
||||||
|
faTimes = faTimes;
|
||||||
|
|
||||||
@Input() notification: NotificationWrapper;
|
@Input() notification: NotificationWrapper;
|
||||||
|
|
||||||
constructor(private readonly toolsService: ToolsService) {
|
constructor(
|
||||||
|
private readonly notificationsService: NotificationService,
|
||||||
|
private readonly mastodonService: MastodonWrapperService,
|
||||||
|
private readonly toolsService: ToolsService) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,9 +39,47 @@ export class NotificationComponent extends BrowseBase {
|
||||||
this.browseAccountEvent.next(accountName);
|
this.browseAccountEvent.next(accountName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
openUrl(url: string): boolean {
|
openUrl(url: string): boolean {
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
followRequestWorking: boolean;
|
||||||
|
followRequestProcessed: boolean;
|
||||||
|
acceptFollowRequest(): boolean {
|
||||||
|
if(this.followRequestWorking) return false;
|
||||||
|
this.followRequestWorking = true;
|
||||||
|
|
||||||
|
this.mastodonService.authorizeFollowRequest(this.notification.provider, this.notification.notification.account.id)
|
||||||
|
.then(res => {
|
||||||
|
this.followRequestProcessed = true;
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
this.notificationsService.notifyHttpError(err, this.notification.provider);
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
this.followRequestWorking = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
refuseFollowRequest(): boolean {
|
||||||
|
if(this.followRequestWorking) return false;
|
||||||
|
this.followRequestWorking = true;
|
||||||
|
|
||||||
|
this.mastodonService.rejectFollowRequest(this.notification.provider, this.notification.notification.account.id)
|
||||||
|
.then(res => {
|
||||||
|
this.followRequestProcessed = true;
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
this.notificationsService.notifyHttpError(err, this.notification.provider);
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
this.followRequestWorking = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,11 +158,13 @@ export class NotificationWrapper {
|
||||||
this.account = notification.account;
|
this.account = notification.account;
|
||||||
this.wrapperId = `${this.type}-${notification.id}`;
|
this.wrapperId = `${this.type}-${notification.id}`;
|
||||||
this.notification = notification;
|
this.notification = notification;
|
||||||
|
this.provider = provider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
provider: AccountInfo;
|
||||||
notification: Notification;
|
notification: Notification;
|
||||||
wrapperId: string;
|
wrapperId: string;
|
||||||
account: Account;
|
account: Account;
|
||||||
status: StatusWrapper;
|
status: StatusWrapper;
|
||||||
type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll';
|
type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll' | 'follow_request';
|
||||||
}
|
}
|
|
@ -128,6 +128,8 @@ export class StreamNotificationsComponent extends BrowseBase {
|
||||||
|
|
||||||
this.mastodonService.getNotifications(this.account, null, null, null, 10)
|
this.mastodonService.getNotifications(this.account, null, null, null, 10)
|
||||||
.then((notifications: Notification[]) => {
|
.then((notifications: Notification[]) => {
|
||||||
|
console.warn(notifications);
|
||||||
|
|
||||||
this.isNotificationsLoading = false;
|
this.isNotificationsLoading = false;
|
||||||
|
|
||||||
this.notifications = notifications.map(x => {
|
this.notifications = notifications.map(x => {
|
||||||
|
@ -235,7 +237,7 @@ export class StreamNotificationsComponent extends BrowseBase {
|
||||||
|
|
||||||
this.isMentionsLoading = true;
|
this.isMentionsLoading = true;
|
||||||
|
|
||||||
this.mastodonService.getNotifications(this.account, ['follow', 'favourite', 'reblog', 'poll'], this.lastMentionId)
|
this.mastodonService.getNotifications(this.account, ['follow', 'favourite', 'reblog', 'poll', 'follow_request'], this.lastMentionId)
|
||||||
.then((result: Notification[]) => {
|
.then((result: Notification[]) => {
|
||||||
if (result.length === 0) {
|
if (result.length === 0) {
|
||||||
this.mentionsMaxReached = true;
|
this.mentionsMaxReached = true;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<h2 class="profile__floating-header__names__display-name"
|
<h2 class="profile__floating-header__names__display-name"
|
||||||
innerHTML="{{displayedAccount | accountEmoji }}" title="{{displayedAccount.display_name}}"></h2>
|
innerHTML="{{displayedAccount | accountEmoji }}" title="{{displayedAccount.display_name}}"></h2>
|
||||||
<a class="profile__floating-header__names__fullhandle" href="{{displayedAccount.url}}"
|
<a class="profile__floating-header__names__fullhandle" href="{{displayedAccount.url}}"
|
||||||
target="_blank" title="{{displayedAccount.acct}}">@{{displayedAccount.acct}}</a>
|
target="_blank" title="{{displayedAccount.acct}}">@{{displayedAccount.acct}}</a> <fa-icon class="fa-lock" *ngIf="displayedAccount.locked" [icon]="faLock" title="account locked"></fa-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="profile__floating-header__follow" *ngIf="relationship && !displayedAccount.moved">
|
<div class="profile__floating-header__follow" *ngIf="relationship && !displayedAccount.moved">
|
||||||
|
@ -118,7 +118,7 @@
|
||||||
<h2 class="profile-name__link profile-name__display-name"
|
<h2 class="profile-name__link profile-name__display-name"
|
||||||
innerHTML="{{displayedAccount | accountEmoji }}" title="{{displayedAccount.display_name}}"></h2>
|
innerHTML="{{displayedAccount | accountEmoji }}" title="{{displayedAccount.display_name}}"></h2>
|
||||||
<h2 class="profile-name__link profile-name__fullhandle"><a href="{{displayedAccount.url}}"
|
<h2 class="profile-name__link profile-name__fullhandle"><a href="{{displayedAccount.url}}"
|
||||||
target="_blank" title="{{displayedAccount.acct}}">@{{displayedAccount.acct}}</a></h2>
|
target="_blank" title="{{displayedAccount.acct}}">@{{displayedAccount.acct}}</a> <fa-icon class="fa-lock" *ngIf="displayedAccount.locked" [icon]="faLock" title="account locked"></fa-icon></h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="profile-follows">
|
<div class="profile-follows">
|
||||||
|
|
|
@ -402,6 +402,12 @@ $floating-header-height: 60px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fa-lock {
|
||||||
|
margin-left: 5px;
|
||||||
|
color: gray;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
//Mastodon styling
|
//Mastodon styling
|
||||||
:host ::ng-deep .profile-fields__field--value {
|
:host ::ng-deep .profile-fields__field--value {
|
||||||
// font-size: 14px;
|
// font-size: 14px;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Component, OnInit, Input, Output, EventEmitter, ViewChild, ElementRef } from '@angular/core';
|
import { Component, OnInit, Input, Output, EventEmitter, ViewChild, ElementRef } from '@angular/core';
|
||||||
import { HttpErrorResponse } from '@angular/common/http';
|
import { HttpErrorResponse } from '@angular/common/http';
|
||||||
import { faUser, faHourglassHalf, faUserCheck, faExclamationTriangle, faLink } from "@fortawesome/free-solid-svg-icons";
|
import { faUser, faHourglassHalf, faUserCheck, faExclamationTriangle, faLink, faLock } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { faUser as faUserRegular } from "@fortawesome/free-regular-svg-icons";
|
import { faUser as faUserRegular } from "@fortawesome/free-regular-svg-icons";
|
||||||
import { Observable, Subscription } from 'rxjs';
|
import { Observable, Subscription } from 'rxjs';
|
||||||
import { Store } from '@ngxs/store';
|
import { Store } from '@ngxs/store';
|
||||||
|
@ -29,6 +29,7 @@ export class UserProfileComponent extends BrowseBase {
|
||||||
faUserCheck = faUserCheck;
|
faUserCheck = faUserCheck;
|
||||||
faExclamationTriangle = faExclamationTriangle;
|
faExclamationTriangle = faExclamationTriangle;
|
||||||
faLink = faLink;
|
faLink = faLink;
|
||||||
|
faLock = faLock;
|
||||||
|
|
||||||
displayedAccount: Account;
|
displayedAccount: Account;
|
||||||
hasNote: boolean;
|
hasNote: boolean;
|
||||||
|
|
|
@ -252,7 +252,7 @@ export class MastodonWrapperService {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getNotifications(account: AccountInfo, excludeTypes: ('follow' | 'favourite' | 'reblog' | 'mention' | 'poll')[] = null, maxId: string = null, sinceId: string = null, limit: number = 15): Promise<Notification[]> {
|
getNotifications(account: AccountInfo, excludeTypes: ('follow' | 'favourite' | 'reblog' | 'mention' | 'poll' | 'follow_request')[] = null, maxId: string = null, sinceId: string = null, limit: number = 15): Promise<Notification[]> {
|
||||||
return this.refreshAccountIfNeeded(account)
|
return this.refreshAccountIfNeeded(account)
|
||||||
.then((refreshedAccount: AccountInfo) => {
|
.then((refreshedAccount: AccountInfo) => {
|
||||||
return this.mastodonService.getNotifications(refreshedAccount, excludeTypes, maxId, sinceId, limit);
|
return this.mastodonService.getNotifications(refreshedAccount, excludeTypes, maxId, sinceId, limit);
|
||||||
|
@ -405,4 +405,18 @@ export class MastodonWrapperService {
|
||||||
return this.mastodonService.getFollowers(refreshedAccount, accountId, maxId, sinceId, limit);
|
return this.mastodonService.getFollowers(refreshedAccount, accountId, maxId, sinceId, limit);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
authorizeFollowRequest(account: AccountInfo, id: number): Promise<Relationship> {
|
||||||
|
return this.refreshAccountIfNeeded(account)
|
||||||
|
.then((refreshedAccount: AccountInfo) => {
|
||||||
|
return this.mastodonService.authorizeFollowRequest(refreshedAccount, id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
rejectFollowRequest(account: AccountInfo, id: number): Promise<Relationship> {
|
||||||
|
return this.refreshAccountIfNeeded(account)
|
||||||
|
.then((refreshedAccount: AccountInfo) => {
|
||||||
|
return this.mastodonService.rejectFollowRequest(refreshedAccount, id);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -311,7 +311,7 @@ export class MastodonService {
|
||||||
return this.httpClient.put<Attachment>(route, input, { headers: headers }).toPromise();
|
return this.httpClient.put<Attachment>(route, input, { headers: headers }).toPromise();
|
||||||
}
|
}
|
||||||
|
|
||||||
getNotifications(account: AccountInfo, excludeTypes: ('follow' | 'favourite' | 'reblog' | 'mention' | 'poll')[] = null, maxId: string = null, sinceId: string = null, limit: number = 15): Promise<Notification[]> {
|
getNotifications(account: AccountInfo, excludeTypes: ('follow' | 'favourite' | 'reblog' | 'mention' | 'poll' | 'follow_request')[] = null, maxId: string = null, sinceId: string = null, limit: number = 15): Promise<Notification[]> {
|
||||||
let route = `https://${account.instance}${this.apiRoutes.getNotifications}?limit=${limit}`;
|
let route = `https://${account.instance}${this.apiRoutes.getNotifications}?limit=${limit}`;
|
||||||
|
|
||||||
if (maxId) {
|
if (maxId) {
|
||||||
|
@ -490,6 +490,7 @@ export class MastodonService {
|
||||||
return new FollowingResult(lastId, res.body)
|
return new FollowingResult(lastId, res.body)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getFollowing(account: AccountInfo, targetAccountId: number, maxId: string, sinceId: string, limit: number = 40): Promise<FollowingResult> {
|
getFollowing(account: AccountInfo, targetAccountId: number, maxId: string, sinceId: string, limit: number = 40): Promise<FollowingResult> {
|
||||||
const route = `https://${account.instance}${this.apiRoutes.getFollowing}`.replace('{0}', targetAccountId.toString());
|
const route = `https://${account.instance}${this.apiRoutes.getFollowing}`.replace('{0}', targetAccountId.toString());
|
||||||
|
|
||||||
|
@ -511,6 +512,20 @@ export class MastodonService {
|
||||||
return new FollowingResult(lastId, res.body)
|
return new FollowingResult(lastId, res.body)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
authorizeFollowRequest(account: AccountInfo, id: number): Promise<Relationship> {
|
||||||
|
const route = `https://${account.instance}${this.apiRoutes.authorizeFollowRequest}`.replace('{0}', id.toString());
|
||||||
|
|
||||||
|
const headers = new HttpHeaders({ 'Authorization': `Bearer ${account.token.access_token}` });
|
||||||
|
return this.httpClient.post<Relationship>(route, null, { headers: headers }).toPromise();
|
||||||
|
}
|
||||||
|
|
||||||
|
rejectFollowRequest(account: AccountInfo, id: number): Promise<Relationship> {
|
||||||
|
const route = `https://${account.instance}${this.apiRoutes.rejectFollowRequest}`.replace('{0}', id.toString());
|
||||||
|
|
||||||
|
const headers = new HttpHeaders({ 'Authorization': `Bearer ${account.token.access_token}` });
|
||||||
|
return this.httpClient.post<Relationship>(route, null, { headers: headers }).toPromise();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum VisibilityEnum {
|
export enum VisibilityEnum {
|
||||||
|
|
|
@ -21,8 +21,8 @@ export class ApiRoutes {
|
||||||
getBlocks = '/api/v1/blocks';
|
getBlocks = '/api/v1/blocks';
|
||||||
getFavourites = '/api/v1/favourites';
|
getFavourites = '/api/v1/favourites';
|
||||||
getFollowRequests = '/api/v1/follow_requests';
|
getFollowRequests = '/api/v1/follow_requests';
|
||||||
authorizeFollowRequest = '/api/v1/follow_requests/authorize';
|
authorizeFollowRequest = '/api/v1/follow_requests/{0}/authorize';
|
||||||
rejectFollowRequest = '/api/v1/follow_requests/reject';
|
rejectFollowRequest = '/api/v1/follow_requests/{0}/reject';
|
||||||
followRemote = '/api/v1/follows';
|
followRemote = '/api/v1/follows';
|
||||||
getInstance = '/api/v1/instance';
|
getInstance = '/api/v1/instance';
|
||||||
uploadMediaAttachment = '/api/v1/media';
|
uploadMediaAttachment = '/api/v1/media';
|
||||||
|
|
|
@ -26,7 +26,7 @@ export interface Account {
|
||||||
username: string;
|
username: string;
|
||||||
acct: string;
|
acct: string;
|
||||||
display_name: string;
|
display_name: string;
|
||||||
locked: string;
|
locked: boolean;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
followers_count: number;
|
followers_count: number;
|
||||||
following_count: number;
|
following_count: number;
|
||||||
|
@ -130,7 +130,7 @@ export interface Mention {
|
||||||
|
|
||||||
export interface Notification {
|
export interface Notification {
|
||||||
id: string;
|
id: string;
|
||||||
type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll';
|
type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll' | 'follow_request';
|
||||||
created_at: string;
|
created_at: string;
|
||||||
account: Account;
|
account: Account;
|
||||||
status?: Status;
|
status?: Status;
|
||||||
|
|
|
@ -58,7 +58,7 @@ export class UserNotificationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private startFetchingNotifications(account: AccountInfo) {
|
private startFetchingNotifications(account: AccountInfo) {
|
||||||
let getMentionsPromise = this.mastodonService.getNotifications(account, ['favourite', 'follow', 'reblog', 'poll'], null, null, 10)
|
let getMentionsPromise = this.mastodonService.getNotifications(account, ['favourite', 'follow', 'reblog', 'poll', 'follow_request'], null, null, 10)
|
||||||
.then((notifications: Notification[]) => {
|
.then((notifications: Notification[]) => {
|
||||||
this.processMentionsAndNotifications(account, notifications, NotificationTypeEnum.UserMention);
|
this.processMentionsAndNotifications(account, notifications, NotificationTypeEnum.UserMention);
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue