Skip to content

Commit 05cfa97

Browse files
committed
fix adoption
1 parent 77fb51c commit 05cfa97

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

files/lib/system/file/DiscordWebhookAvatarFileProcessor.class.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,18 @@ public function validateUpload(File $file): void
4848
#[Override]
4949
public function canAdopt(File $file, array $context): bool
5050
{
51-
return DiscordBot::findByFileID($file->fileID) === null;
51+
$botContext = $this->getBot($context);
52+
$botFile = DiscordBot::findByFileID($file->fileID);
53+
54+
if ($botFile === null) {
55+
return true;
56+
}
57+
58+
if ($botFile->botID === $botContext->botID) {
59+
return true;
60+
}
61+
62+
return false;
5263
}
5364

5465
#[Override]

package.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
<packagedescription>API to cummincate with Discord.</packagedescription>
88
<packagedescription language="de">API um mit Discord zu kommunizieren.</packagedescription>
99
<version>2.7.1</version>
10-
<date>2024-10-03</date>
10+
<date>2024-10-11</date>
1111
<license>https://creativecommons.org/publicdomain/zero/1.0/deed.en</license>
1212
</packageinformation>
1313
<authorinformation>
1414
<author>Hanashi Development</author>
1515
<authorurl>https://hanashi.dev/</authorurl>
1616
</authorinformation>
1717
<requiredpackages>
18-
<requiredpackage minversion="6.1.0 Beta 3">com.woltlab.wcf</requiredpackage>
18+
<requiredpackage minversion="6.1.0 RC 1">com.woltlab.wcf</requiredpackage>
1919
</requiredpackages>
2020
<excludedpackages>
2121
<excludedpackage version="7.0.0 Alpha 1">com.woltlab.wcf</excludedpackage>

0 commit comments

Comments
 (0)