Skip to content

Commit 25dc298

Browse files
authored
Merge branch 'master' into excludedisabled
2 parents c82fb96 + 58437de commit 25dc298

File tree

69 files changed

+1021
-816
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1021
-816
lines changed

.github/workflows/phpunit-32bits.yml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ jobs:
2626

2727
if: ${{ github.repository_owner != 'nextcloud-gmbh' }}
2828

29-
container: shivammathur/node:latest-i386
30-
3129
strategy:
3230
fail-fast: false
3331
matrix:
34-
php-versions: ["8.2", "8.3", "8.4"]
32+
php-versions: ["8.4"]
3533

3634
steps:
3735
- name: Checkout server
@@ -40,32 +38,22 @@ jobs:
4038
persist-credentials: false
4139
submodules: true
4240

43-
- name: Install tools
44-
run: |
45-
sudo apt-get update
46-
sudo apt-get install -y ffmpeg imagemagick libmagickcore-6.q16-3-extra
47-
48-
- name: Set up php ${{ matrix.php-versions }}
49-
uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f #v2.35.5
50-
with:
51-
php-version: ${{ matrix.php-versions }}
52-
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, imagick, intl, json, libxml, mbstring, openssl, pcntl, posix, redis, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite, apcu, ldap
53-
coverage: none
54-
ini-file: development
55-
ini-values: apc.enabled=on, apc.enable_cli=on, disable_functions= # https://github.com/shivammathur/setup-php/discussions/573
56-
env:
57-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58-
5941
- name: Set up dependencies
60-
run: composer i
42+
uses: docker://ghcr.io/nextcloud/continuous-integration-php8.4-32bit:latest
43+
with:
44+
args: /bin/sh -c "
45+
git config --global --add safe.directory /github/workspace &&
46+
composer install --no-interaction"
6147

6248
- name: Set up Nextcloud
63-
env:
64-
DB_PORT: 4444
65-
run: |
66-
mkdir data
67-
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=rootpassword --admin-user admin --admin-pass admin
68-
php -f tests/enable_all.php
49+
uses: docker://ghcr.io/nextcloud/continuous-integration-php8.4-32bit:latest
50+
with:
51+
args: /bin/sh -c "
52+
mkdir data &&
53+
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-user=autotest --database-pass=rootpassword --admin-user admin --admin-pass admin &&
54+
php -f tests/enable_all.php"
6955

7056
- name: PHPUnit
71-
run: composer run test -- --exclude-group PRIMARY-azure --exclude-group PRIMARY-s3 --exclude-group PRIMARY-swift --exclude-group Memcached --exclude-group Redis --exclude-group RoutingWeirdness
57+
uses: docker://ghcr.io/nextcloud/continuous-integration-php8.4-32bit:latest
58+
with:
59+
args: /bin/sh -c "composer run test -- --exclude-group PRIMARY-azure,PRIMARY-s3,PRIMARY-swift,Memcached,Redis,RoutingWeirdness"

apps/comments/l10n/fi.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ OC.L10N.register(
1515
"Delete comment" : "Poista kommentti",
1616
"Cancel edit" : "Peruuta muokkaus",
1717
"New comment" : "Uusi kommentti",
18+
"Write a comment …" : "Kirjoita kommentti …",
1819
"Post comment" : "Lähetä viesti",
1920
"@ for mentions, : for emoji, / for smart picker" : "@ maininnoille, : emojille, / älykkäälle valitsimelle",
2021
"Could not reload comments" : "Kommenttien lataus epäonnistui",

apps/comments/l10n/fi.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"Delete comment" : "Poista kommentti",
1414
"Cancel edit" : "Peruuta muokkaus",
1515
"New comment" : "Uusi kommentti",
16+
"Write a comment …" : "Kirjoita kommentti …",
1617
"Post comment" : "Lähetä viesti",
1718
"@ for mentions, : for emoji, / for smart picker" : "@ maininnoille, : emojille, / älykkäälle valitsimelle",
1819
"Could not reload comments" : "Kommenttien lataus epäonnistui",

apps/dav/lib/CalDAV/Schedule/IMipService.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
use OC\URLGenerator;
1212
use OCA\DAV\CalDAV\EventReader;
1313
use OCP\AppFramework\Utility\ITimeFactory;
14-
use OCP\IConfig;
14+
use OCP\Config\IUserConfig;
15+
use OCP\IAppConfig;
1516
use OCP\IDBConnection;
1617
use OCP\IL10N;
1718
use OCP\IUserManager;
@@ -41,12 +42,13 @@ class IMipService {
4142

4243
public function __construct(
4344
private URLGenerator $urlGenerator,
44-
private IConfig $config,
4545
private IDBConnection $db,
4646
private ISecureRandom $random,
4747
private L10NFactory $l10nFactory,
4848
private ITimeFactory $timeFactory,
4949
private readonly IUserManager $userManager,
50+
private readonly IUserConfig $userConfig,
51+
private readonly IAppConfig $appConfig,
5052
) {
5153
$language = $this->l10nFactory->findGenericLanguage();
5254
$locale = $this->l10nFactory->findLocale($language);
@@ -887,8 +889,8 @@ public function setL10nFromAttendee(Property $attendee) {
887889
$users = $this->userManager->getByEmail($userAddress);
888890
if ($users !== []) {
889891
$user = array_shift($users);
890-
$language = $this->config->getUserValue($user->getUID(), 'core', 'lang', null);
891-
$locale = $this->config->getUserValue($user->getUID(), 'core', 'locale', null);
892+
$language = $this->userConfig->getValueString($user->getUID(), 'core', 'lang', '') ?: null;
893+
$locale = $this->userConfig->getValueString($user->getUID(), 'core', 'locale', '') ?: null;
892894
}
893895
// fallback to attendee LANGUAGE parameter if language not set
894896
if ($language === null && isset($attendee['LANGUAGE']) && $attendee['LANGUAGE'] instanceof Parameter) {
@@ -996,20 +998,20 @@ public function getAbsoluteImagePath($path): string {
996998
* The default is 'no', which matches old behavior, and is privacy preserving.
997999
*
9981000
* To enable including attendees in invitation emails:
999-
* % php occ config:app:set dav invitation_list_attendees --value yes
1001+
* % php occ config:app:set dav invitation_list_attendees --value yes --type bool
10001002
*
10011003
* @param IEMailTemplate $template
10021004
* @param IL10N $this->l10n
10031005
* @param VEvent $vevent
10041006
* @author brad2014 on github.com
10051007
*/
10061008
public function addAttendees(IEMailTemplate $template, VEvent $vevent) {
1007-
if ($this->config->getAppValue('dav', 'invitation_list_attendees', 'no') === 'no') {
1009+
if (!$this->appConfig->getValueBool('dav', 'invitation_list_attendees')) {
10081010
return;
10091011
}
10101012

10111013
if (isset($vevent->ORGANIZER)) {
1012-
/** @var Property | Property\ICalendar\CalAddress $organizer */
1014+
/** @var Property&Property\ICalendar\CalAddress $organizer */
10131015
$organizer = $vevent->ORGANIZER;
10141016
$organizerEmail = substr($organizer->getNormalizedValue(), 7);
10151017
/** @var string|null $organizerName */
@@ -1039,8 +1041,14 @@ public function addAttendees(IEMailTemplate $template, VEvent $vevent) {
10391041
$attendeesHTML = [];
10401042
$attendeesText = [];
10411043
foreach ($attendees as $attendee) {
1044+
/** @var Property&Property\ICalendar\CalAddress $attendee */
10421045
$attendeeEmail = substr($attendee->getNormalizedValue(), 7);
1043-
$attendeeName = isset($attendee['CN']) ? $attendee['CN']->getValue() : null;
1046+
$attendeeName = null;
1047+
if (isset($attendee['CN'])) {
1048+
/** @var Parameter $cn */
1049+
$cn = $attendee['CN'];
1050+
$attendeeName = $cn->getValue();
1051+
}
10441052
$attendeeHTML = sprintf('<a href="%s">%s</a>',
10451053
htmlspecialchars($attendee->getNormalizedValue()),
10461054
htmlspecialchars($attendeeName ?: $attendeeEmail));

apps/dav/lib/CalDAV/TimezoneService.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use OCA\DAV\Db\PropertyMapper;
1313
use OCP\Calendar\ICalendar;
1414
use OCP\Calendar\IManager;
15+
use OCP\Config\IUserConfig;
1516
use OCP\IConfig;
1617
use Sabre\VObject\Component\VCalendar;
1718
use Sabre\VObject\Component\VTimeZone;
@@ -22,13 +23,14 @@ class TimezoneService {
2223

2324
public function __construct(
2425
private IConfig $config,
26+
private IUserConfig $userConfig,
2527
private PropertyMapper $propertyMapper,
2628
private IManager $calendarManager,
2729
) {
2830
}
2931

3032
public function getUserTimezone(string $userId): ?string {
31-
$fromConfig = $this->config->getUserValue(
33+
$fromConfig = $this->userConfig->getValueString(
3234
$userId,
3335
'core',
3436
'timezone',
@@ -51,7 +53,7 @@ public function getUserTimezone(string $userId): ?string {
5153
}
5254

5355
$principal = 'principals/users/' . $userId;
54-
$uri = $this->config->getUserValue($userId, 'dav', 'defaultCalendar', CalDavBackend::PERSONAL_CALENDAR_URI);
56+
$uri = $this->userConfig->getValueString($userId, 'dav', 'defaultCalendar', CalDavBackend::PERSONAL_CALENDAR_URI);
5557
$calendars = $this->calendarManager->getCalendarsForPrincipal($principal);
5658

5759
/** @var ?VTimeZone $personalCalendarTimezone */

apps/dav/tests/unit/CalDAV/Schedule/IMipPluginCharsetTest.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
use OCA\DAV\CalDAV\Schedule\IMipPlugin;
1515
use OCA\DAV\CalDAV\Schedule\IMipService;
1616
use OCP\AppFramework\Utility\ITimeFactory;
17+
use OCP\Config\IUserConfig;
1718
use OCP\Defaults;
1819
use OCP\IAppConfig;
19-
use OCP\IConfig;
2020
use OCP\IDBConnection;
2121
use OCP\IURLGenerator;
2222
use OCP\IUser;
@@ -46,7 +46,7 @@ class IMipPluginCharsetTest extends TestCase {
4646
// Dependencies
4747
private Defaults&MockObject $defaults;
4848
private IAppConfig&MockObject $appConfig;
49-
private IConfig&MockObject $config;
49+
private IUserConfig&MockObject $userConfig;
5050
private IDBConnection&MockObject $db;
5151
private IFactory $l10nFactory;
5252
private IManager&MockObject $mailManager;
@@ -77,7 +77,8 @@ protected function setUp(): void {
7777

7878
// IMipService
7979
$this->urlGenerator = $this->createMock(URLGenerator::class);
80-
$this->config = $this->createMock(IConfig::class);
80+
$this->userConfig = $this->createMock(IUserConfig::class);
81+
$this->appConfig = $this->createMock(IAppConfig::class);
8182
$this->db = $this->createMock(IDBConnection::class);
8283
$this->random = $this->createMock(ISecureRandom::class);
8384
$l10n = $this->createMock(L10N::class);
@@ -92,19 +93,19 @@ protected function setUp(): void {
9293
$this->userManager->method('getByEmail')->willReturn([]);
9394
$this->imipService = new IMipService(
9495
$this->urlGenerator,
95-
$this->config,
9696
$this->db,
9797
$this->random,
9898
$this->l10nFactory,
9999
$this->timeFactory,
100-
$this->userManager
100+
$this->userManager,
101+
$this->userConfig,
102+
$this->appConfig,
101103
);
102104

103105
// EventComparisonService
104106
$this->eventComparisonService = new EventComparisonService();
105107

106108
// IMipPlugin
107-
$this->appConfig = $this->createMock(IAppConfig::class);
108109
$message = new \OC\Mail\Message(new Email(), false);
109110
$this->mailer = $this->createMock(IMailer::class);
110111
$this->mailer->method('createMessage')
@@ -177,8 +178,13 @@ public function testCharsetMailer(): void {
177178
public function testCharsetMailProvider(): void {
178179
// Arrange
179180
$this->appConfig->method('getValueBool')
180-
->with('core', 'mail_providers_enabled', true)
181-
->willReturn(true);
181+
->willReturnCallback(function ($app, $key, $default) {
182+
if ($app === 'core') {
183+
$this->assertEquals($key, 'mail_providers_enabled');
184+
return true;
185+
}
186+
return $default;
187+
});
182188
$mailMessage = new MailProviderMessage();
183189
$mailService = $this->createMockForIntersectionOfInterfaces([IService::class, IMessageSend::class]);
184190
$mailService->method('initiateMessage')

apps/dav/tests/unit/CalDAV/Schedule/IMipServiceTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
use OCA\DAV\CalDAV\EventReader;
1414
use OCA\DAV\CalDAV\Schedule\IMipService;
1515
use OCP\AppFramework\Utility\ITimeFactory;
16-
use OCP\IConfig;
16+
use OCP\Config\IUserConfig;
17+
use OCP\IAppConfig;
1718
use OCP\IDBConnection;
1819
use OCP\IL10N;
1920
use OCP\IUserManager;
@@ -26,7 +27,8 @@
2627

2728
class IMipServiceTest extends TestCase {
2829
private URLGenerator&MockObject $urlGenerator;
29-
private IConfig&MockObject $config;
30+
private IUserConfig&MockObject $userConfig;
31+
private IAppConfig&MockObject $appConfig;
3032
private IDBConnection&MockObject $db;
3133
private ISecureRandom&MockObject $random;
3234
private IFactory&MockObject $l10nFactory;
@@ -47,7 +49,8 @@ protected function setUp(): void {
4749
parent::setUp();
4850

4951
$this->urlGenerator = $this->createMock(URLGenerator::class);
50-
$this->config = $this->createMock(IConfig::class);
52+
$this->userConfig = $this->createMock(IUserConfig::class);
53+
$this->appConfig = $this->createMock(IAppConfig::class);
5154
$this->db = $this->createMock(IDBConnection::class);
5255
$this->random = $this->createMock(ISecureRandom::class);
5356
$this->l10nFactory = $this->createMock(IFactory::class);
@@ -63,12 +66,13 @@ protected function setUp(): void {
6366
->willReturn($this->l10n);
6467
$this->service = new IMipService(
6568
$this->urlGenerator,
66-
$this->config,
6769
$this->db,
6870
$this->random,
6971
$this->l10nFactory,
7072
$this->timeFactory,
71-
$this->userManager
73+
$this->userManager,
74+
$this->userConfig,
75+
$this->appConfig,
7276
);
7377

7478
// construct calendar with a 1 hour event and same start/end time zones

apps/dav/tests/unit/CalDAV/TimezoneServiceTest.php

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@
99
namespace OCA\DAV\Tests\unit\CalDAV;
1010

1111
use DateTimeZone;
12+
use OCA\DAV\CalDAV\CalDavBackend;
1213
use OCA\DAV\CalDAV\CalendarImpl;
1314
use OCA\DAV\CalDAV\TimezoneService;
1415
use OCA\DAV\Db\Property;
1516
use OCA\DAV\Db\PropertyMapper;
1617
use OCP\Calendar\ICalendar;
1718
use OCP\Calendar\IManager;
19+
use OCP\Config\IUserConfig;
1820
use OCP\IConfig;
1921
use PHPUnit\Framework\MockObject\MockObject;
2022
use Sabre\VObject\Component\VTimeZone;
2123
use Test\TestCase;
2224

2325
class TimezoneServiceTest extends TestCase {
2426
private IConfig&MockObject $config;
27+
private IUserConfig&MockObject $userConfig;
2528
private PropertyMapper&MockObject $propertyMapper;
2629
private IManager&MockObject $calendarManager;
2730
private TimezoneService $service;
@@ -30,19 +33,21 @@ protected function setUp(): void {
3033
parent::setUp();
3134

3235
$this->config = $this->createMock(IConfig::class);
36+
$this->userConfig = $this->createMock(IUserConfig::class);
3337
$this->propertyMapper = $this->createMock(PropertyMapper::class);
3438
$this->calendarManager = $this->createMock(IManager::class);
3539

3640
$this->service = new TimezoneService(
3741
$this->config,
42+
$this->userConfig,
3843
$this->propertyMapper,
3944
$this->calendarManager,
4045
);
4146
}
4247

4348
public function testGetUserTimezoneFromSettings(): void {
44-
$this->config->expects(self::once())
45-
->method('getUserValue')
49+
$this->userConfig->expects(self::once())
50+
->method('getValueString')
4651
->with('test123', 'core', 'timezone', '')
4752
->willReturn('Europe/Warsaw');
4853

@@ -52,8 +57,8 @@ public function testGetUserTimezoneFromSettings(): void {
5257
}
5358

5459
public function testGetUserTimezoneFromAvailability(): void {
55-
$this->config->expects(self::once())
56-
->method('getUserValue')
60+
$this->userConfig->expects(self::once())
61+
->method('getValueString')
5762
->with('test123', 'core', 'timezone', '')
5863
->willReturn('');
5964
$property = new Property();
@@ -76,11 +81,11 @@ public function testGetUserTimezoneFromAvailability(): void {
7681
}
7782

7883
public function testGetUserTimezoneFromPersonalCalendar(): void {
79-
$this->config->expects(self::exactly(2))
80-
->method('getUserValue')
84+
$this->userConfig->expects(self::exactly(2))
85+
->method('getValueString')
8186
->willReturnMap([
82-
['test123', 'core', 'timezone', '', ''],
83-
['test123', 'dav', 'defaultCalendar', '', 'personal-1'],
87+
['test123', 'core', 'timezone', '', false, ''],
88+
['test123', 'dav', 'defaultCalendar', CalDavBackend::PERSONAL_CALENDAR_URI, false, 'personal-1'],
8489
]);
8590
$other = $this->createMock(ICalendar::class);
8691
$other->method('getUri')->willReturn('other');
@@ -105,11 +110,11 @@ public function testGetUserTimezoneFromPersonalCalendar(): void {
105110
}
106111

107112
public function testGetUserTimezoneFromAny(): void {
108-
$this->config->expects(self::exactly(2))
109-
->method('getUserValue')
113+
$this->userConfig->expects(self::exactly(2))
114+
->method('getValueString')
110115
->willReturnMap([
111-
['test123', 'core', 'timezone', '', ''],
112-
['test123', 'dav', 'defaultCalendar', '', 'personal-1'],
116+
['test123', 'core', 'timezone', '', false, ''],
117+
['test123', 'dav', 'defaultCalendar', CalDavBackend::PERSONAL_CALENDAR_URI, false, 'personal-1'],
113118
]);
114119
$other = $this->createMock(ICalendar::class);
115120
$other->method('getUri')->willReturn('other');

apps/federatedfilesharing/l10n/fi.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ OC.L10N.register(
2626
"Copied!" : "Kopioitu!",
2727
"Federated Cloud" : "Federoitu pilvi",
2828
"Share it so your friends can share files with you:" : "Jaa se, jotta ystäväsi voivat jakaa tiedostoja kanssasi:",
29+
"Bluesky" : "Bluesky",
2930
"Facebook" : "Facebook",
3031
"Mastodon" : "Mastodon",
3132
"Add to your website" : "Lisää verkkosivuillesi",

0 commit comments

Comments
 (0)