diff options
author | Chocobozzz <me@florianbigard.com> | 2020-02-27 09:09:50 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-02-27 09:09:50 +0100 |
commit | 16ec5e0833a4f72e75ca2a4f4be00f0453c68c80 (patch) | |
tree | 5b33355cebd25e57cf4695ac59ada14c087c083c /server/lib | |
parent | e81871782db9927b2eb14b5deeb03b4e7b3cce0a (diff) | |
parent | 195ba6cdf38f4515a514cf8432930576539b0a04 (diff) | |
download | PeerTube-16ec5e0833a4f72e75ca2a4f4be00f0453c68c80.tar.gz PeerTube-16ec5e0833a4f72e75ca2a4f4be00f0453c68c80.tar.zst PeerTube-16ec5e0833a4f72e75ca2a4f4be00f0453c68c80.zip |
Merge branch 'release/2.1.0'
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/activitypub/actor.ts | 4 | ||||
-rw-r--r-- | server/lib/activitypub/process/process-follow.ts | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts index f802658cf..0b21de0ca 100644 --- a/server/lib/activitypub/actor.ts +++ b/server/lib/activitypub/actor.ts | |||
@@ -176,8 +176,8 @@ async function updateActorAvatarInstance (actor: MActorDefault, info: AvatarInfo | |||
176 | if (!info.name) return actor | 176 | if (!info.name) return actor |
177 | 177 | ||
178 | if (actor.Avatar) { | 178 | if (actor.Avatar) { |
179 | // Don't update the avatar if the filename did not change | 179 | // Don't update the avatar if the file URL did not change |
180 | if (actor.Avatar.fileUrl === info.fileUrl) return actor | 180 | if (info.fileUrl && actor.Avatar.fileUrl === info.fileUrl) return actor |
181 | 181 | ||
182 | try { | 182 | try { |
183 | await actor.Avatar.destroy({ transaction: t }) | 183 | await actor.Avatar.destroy({ transaction: t }) |
diff --git a/server/lib/activitypub/process/process-follow.ts b/server/lib/activitypub/process/process-follow.ts index 85f22d654..db7fb8568 100644 --- a/server/lib/activitypub/process/process-follow.ts +++ b/server/lib/activitypub/process/process-follow.ts | |||
@@ -59,7 +59,9 @@ async function processFollow (byActor: MActorSignature, targetActorURL: string) | |||
59 | transaction: t | 59 | transaction: t |
60 | }) | 60 | }) |
61 | 61 | ||
62 | if (actorFollow.state !== 'accepted' && CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL === false) { | 62 | // Set the follow as accepted if the remote actor follows a channel or account |
63 | // Or if the instance automatically accepts followers | ||
64 | if (actorFollow.state !== 'accepted' && (isFollowingInstance === false || CONFIG.FOLLOWERS.INSTANCE.MANUAL_APPROVAL === false)) { | ||
63 | actorFollow.state = 'accepted' | 65 | actorFollow.state = 'accepted' |
64 | await actorFollow.save({ transaction: t }) | 66 | await actorFollow.save({ transaction: t }) |
65 | } | 67 | } |