aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-01-14 10:24:49 +0100
committerChocobozzz <me@florianbigard.com>2019-01-14 10:24:49 +0100
commitb4593cd7ff34b94b60f6bfa0b57e371d74d63aa2 (patch)
tree06316fd7fa61778d14f2b3fed2d4e5b51468822e
parent7b95f31385eca59ac18197539de30268acc18986 (diff)
downloadPeerTube-b4593cd7ff34b94b60f6bfa0b57e371d74d63aa2.tar.gz
PeerTube-b4593cd7ff34b94b60f6bfa0b57e371d74d63aa2.tar.zst
PeerTube-b4593cd7ff34b94b60f6bfa0b57e371d74d63aa2.zip
Warn user when they want to delete a channel
Because they will not be able to create another channel with the same actor name
-rw-r--r--client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts10
-rw-r--r--server/lib/activitypub/actor.ts2
-rw-r--r--server/lib/activitypub/process/process.ts2
3 files changed, 9 insertions, 5 deletions
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts b/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts
index 0ab3e2067..da2c5bcd3 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts
+++ b/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts
@@ -35,10 +35,14 @@ export class MyAccountVideoChannelsComponent implements OnInit {
35 async deleteVideoChannel (videoChannel: VideoChannel) { 35 async deleteVideoChannel (videoChannel: VideoChannel) {
36 const res = await this.confirmService.confirmWithInput( 36 const res = await this.confirmService.confirmWithInput(
37 this.i18n( 37 this.i18n(
38 'Do you really want to delete {{videoChannelName}}? It will delete all videos uploaded in this channel too.', 38 'Do you really want to delete {{channelDisplayName}}? It will delete all videos uploaded in this channel, ' +
39 { videoChannelName: videoChannel.displayName } 39 'and you will not be able to create another channel with the same name ({{channelName}})!',
40 { channelDisplayName: videoChannel.displayName, channelName: videoChannel.name }
41 ),
42 this.i18n(
43 'Please type the display name of the video channel ({{displayName}}) to confirm',
44 { displayName: videoChannel.displayName }
40 ), 45 ),
41 this.i18n('Please type the name of the video channel to confirm'),
42 videoChannel.displayName, 46 videoChannel.displayName,
43 this.i18n('Delete') 47 this.i18n('Delete')
44 ) 48 )
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts
index f7bf7c65a..f80296725 100644
--- a/server/lib/activitypub/actor.ts
+++ b/server/lib/activitypub/actor.ts
@@ -296,7 +296,7 @@ async function fetchRemoteActor (actorUrl: string): Promise<{ statusCode?: numbe
296 296
297 const actorJSON: ActivityPubActor = requestResult.body 297 const actorJSON: ActivityPubActor = requestResult.body
298 if (isActorObjectValid(actorJSON) === false) { 298 if (isActorObjectValid(actorJSON) === false) {
299 logger.debug('Remote actor JSON is not valid.', { actorJSON: actorJSON }) 299 logger.debug('Remote actor JSON is not valid.', { actorJSON })
300 return { result: undefined, statusCode: requestResult.response.statusCode } 300 return { result: undefined, statusCode: requestResult.response.statusCode }
301 } 301 }
302 302
diff --git a/server/lib/activitypub/process/process.ts b/server/lib/activitypub/process/process.ts
index bcc5cac7a..2479d5da2 100644
--- a/server/lib/activitypub/process/process.ts
+++ b/server/lib/activitypub/process/process.ts
@@ -35,7 +35,7 @@ async function processActivities (
35 const actorsCache: { [ url: string ]: ActorModel } = {} 35 const actorsCache: { [ url: string ]: ActorModel } = {}
36 36
37 for (const activity of activities) { 37 for (const activity of activities) {
38 if (!options.signatureActor && [ 'Create', 'Announce', 'Like' ].indexOf(activity.type) === -1) { 38 if (!options.signatureActor && [ 'Create', 'Announce', 'Like' ].includes(activity.type) === false) {
39 logger.error('Cannot process activity %s (type: %s) without the actor signature.', activity.id, activity.type) 39 logger.error('Cannot process activity %s (type: %s) without the actor signature.', activity.id, activity.type)
40 continue 40 continue
41 } 41 }