AbuseState,
ActorInfo,
FollowState,
+ PluginType,
UserNotification as UserNotificationServer,
UserNotificationType,
UserRight,
}
}
+ plugin?: {
+ name: string
+ type: PluginType
+ latestVersion: string
+ }
+
+ peertube?: {
+ latestVersion: string
+ }
+
createdAt: string
updatedAt: string
// Additional fields
videoUrl?: string
commentUrl?: any[]
+
abuseUrl?: string
abuseQueryParams?: { [id: string]: string } = {}
+
videoAutoBlacklistUrl?: string
+
accountUrl?: string
+
videoImportIdentifier?: string
videoImportUrl?: string
+
instanceFollowUrl?: string
+ peertubeVersionLink?: string
+
+ pluginUrl?: string
+ pluginQueryParams?: { [id: string]: string } = {}
+
constructor (hash: UserNotificationServer, user: AuthUser) {
this.id = hash.id
this.type = hash.type
this.actorFollow = hash.actorFollow
if (this.actorFollow) this.setAccountAvatarUrl(this.actorFollow.follower)
+ this.plugin = hash.plugin
+ this.peertube = hash.peertube
+
this.createdAt = hash.createdAt
this.updatedAt = hash.updatedAt
case UserNotificationType.AUTO_INSTANCE_FOLLOWING:
this.instanceFollowUrl = '/admin/follows/following-list'
break
+
+ case UserNotificationType.NEW_PEERTUBE_VERSION:
+ this.peertubeVersionLink = 'https://joinpeertube.org/news'
+ break
+
+ case UserNotificationType.NEW_PLUGIN_VERSION:
+ this.pluginUrl = `/admin/plugins/list-installed`
+ this.pluginQueryParams.pluginType = this.plugin.type + ''
+ break
}
} catch (err) {
this.type = null
}
private buildAccountUrl (account: { name: string, host: string }) {
- return '/accounts/' + Actor.CREATE_BY_STRING(account.name, account.host)
+ return '/a/' + Actor.CREATE_BY_STRING(account.name, account.host)
}
private buildVideoImportUrl () {
}
private setAccountAvatarUrl (actor: { avatarUrl?: string, avatar?: { url?: string, path: string } }) {
- actor.avatarUrl = Account.GET_ACTOR_AVATAR_URL(actor)
+ actor.avatarUrl = Account.GET_ACTOR_AVATAR_URL(actor) || Account.GET_DEFAULT_AVATAR_URL()
}
private setVideoChannelAvatarUrl (actor: { avatarUrl?: string, avatar?: { url?: string, path: string } }) {
- actor.avatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(actor)
+ actor.avatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(actor) || VideoChannel.GET_DEFAULT_AVATAR_URL()
}
}