Skip to content

Commit c5e94fb

Browse files
Merge pull request #20 from MarcelRobitaille/merge/2.2.0
Merge/2.2.0
2 parents 6dfa21d + 3c18daf commit c5e94fb

15 files changed

Lines changed: 382 additions & 385 deletions

.github/workflows/psalm.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
server-versions: 'dev-stable28'
3434
- php-versions: '8.3'
3535
server-versions: 'dev-master'
36+
fail-fast: false
3637

3738
name: Nextcloud
3839
steps:

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010

1111
- Further improve error messages in browser popup
1212

13+
### New ported from upstream 2.2.0
14+
15+
- Adding prefix, suffix and middle name to contacts
16+
17+
### Fixes ported from upstream 2.2.0
18+
- fix(GoogleDriveAPIService): Make sure target path is not a shared folder
19+
- fix(GoogleCalendarAPIService): Sanitize calendar name
20+
- fix(GoogleDriveAPIService): Don't break if a file causes hiccups
21+
- Fix(l10n): Update translations from Transifex
22+
1323
## [2.1.1] - 2024-04-21
1424

1525
### Changed

l10n/ast.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
OC.L10N.register(
2+
"integration_google",
3+
{
4+
"Google" : "Google",
5+
"Authentication" : "Autenticación",
6+
"Contacts" : "Contautos",
7+
"Calendars" : "Calendarios",
8+
"Photos" : "Semeyes"
9+
},
10+
"nplurals=2; plural=(n != 1);");

l10n/ast.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{ "translations": {
2+
"Google" : "Google",
3+
"Authentication" : "Autenticación",
4+
"Contacts" : "Contautos",
5+
"Calendars" : "Calendarios",
6+
"Photos" : "Semeyes"
7+
},"pluralForm" :"nplurals=2; plural=(n != 1);"
8+
}

l10n/ko.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ OC.L10N.register(
77
"Connected accounts" : "계정 연결됨",
88
"Client ID" : "클라이언트 ID",
99
"Client secret" : "클라이언트 비밀 값",
10+
"No Google OAuth app configured. Ask your Nextcloud administrator to configure Google connected accounts admin section." : "설정된 Google OAuth 앱이 없습니다. 이 Nextcloud 관리자에게 Google 계정 연결을 설정하도록 요청하십시오.",
1011
"Authentication" : "인증",
1112
"Sign in with Google" : "구글 계정으로 로그인",
1213
"Connected as {user}" : "[user]로 연결됨",

l10n/ko.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"Connected accounts" : "계정 연결됨",
66
"Client ID" : "클라이언트 ID",
77
"Client secret" : "클라이언트 비밀 값",
8+
"No Google OAuth app configured. Ask your Nextcloud administrator to configure Google connected accounts admin section." : "설정된 Google OAuth 앱이 없습니다. 이 Nextcloud 관리자에게 Google 계정 연결을 설정하도록 요청하십시오.",
89
"Authentication" : "인증",
910
"Sign in with Google" : "구글 계정으로 로그인",
1011
"Connected as {user}" : "[user]로 연결됨",

l10n/sc.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ OC.L10N.register(
1313
"Data migration" : "Tramudadura de datos",
1414
"Google integration" : "Integratzione Google",
1515
"Import Google data into Nextcloud" : "Importa is datos de Google in Nextcloud",
16-
"If you want to allow your Nextcloud users to authenticate to Google, create an OAuth application in your Google settings." : "Si cheres cunsentire a is utentes tuos de Nextcloud de s'autenticare in Google, crea un'aplicatzione OAuth in is impostatziones de Google.",
17-
"Google API settings" : "Impostatziones Google API",
16+
"If you want to allow your Nextcloud users to authenticate to Google, create an OAuth application in your Google settings." : "Si boles cunsentire a is utentes tuos de Nextcloud de s'autenticare in Google, crea un'aplicatzione OAuth in sa cunfiguratzione de Google.",
17+
"Google API settings" : "Cunfiguratzione de Google API",
1818
"Go to \"APIs & Services\" => \"Credentials\" and click on \"+ CREATE CREDENTIALS\" -> \"OAuth client ID\"." : "Bae a \"APIs & Servìtzios\" => \"Credentziales\" e incarca subra de \"+ CREA CREDENTZIALES\" -> \"OAuth client ID\".",
1919
"Set the \"Application type\" to \"Web application\" and give a name to the application." : "Imposta sa \"Genia de aplicatzione\" to \"Aplicatzione web\" e dae unu nùmene a s'aplicatzione.",
2020
"Make sure you set one \"Authorized redirect URI\" to" : "Segura·ti de àere impostadu unu \"\"URI de re-deretamentu autorizadu\" a",
2121
"Put the \"Client ID\" and \"Client secret\" below." : "Inserta·nche suta su \"ID client\" e \"Segreto del client\" in fatu.",
2222
"Finally, go to \"APIs & Services\" => \"Library\" and add the following APIs: \"Google Drive API\", \"Google Calendar API\", \"People API\" and \"Photos Library API\"." : "A ùrtimu, bae a \"API e servizi\" => \"Libreria\" e agiunghe is API imbenientes: \"Google Drive API\", \"Google Calendar API\", \"People API\" e \"Photos Library API\".",
23-
"Your Nextcloud users will then see a \"Connect to Google\" button in their personal settings." : "Is utentes tuos Nextcloud ant a bìdere unu butone \"Connete a Google\" in is impostatziones personales issoro.",
23+
"Your Nextcloud users will then see a \"Connect to Google\" button in their personal settings." : "Is utentes tuos Nextcloud ant a bìdere unu butone \"Connete a Google\" in sa cunfiguratzione personale issoro.",
2424
"Client ID" : "Cliente ID",
2525
"Client ID of your Google application" : "Cliente ID de s'aplicatzione de Google tua",
2626
"Client secret" : "Cliente segretu",

l10n/sc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
"Data migration" : "Tramudadura de datos",
1212
"Google integration" : "Integratzione Google",
1313
"Import Google data into Nextcloud" : "Importa is datos de Google in Nextcloud",
14-
"If you want to allow your Nextcloud users to authenticate to Google, create an OAuth application in your Google settings." : "Si cheres cunsentire a is utentes tuos de Nextcloud de s'autenticare in Google, crea un'aplicatzione OAuth in is impostatziones de Google.",
15-
"Google API settings" : "Impostatziones Google API",
14+
"If you want to allow your Nextcloud users to authenticate to Google, create an OAuth application in your Google settings." : "Si boles cunsentire a is utentes tuos de Nextcloud de s'autenticare in Google, crea un'aplicatzione OAuth in sa cunfiguratzione de Google.",
15+
"Google API settings" : "Cunfiguratzione de Google API",
1616
"Go to \"APIs & Services\" => \"Credentials\" and click on \"+ CREATE CREDENTIALS\" -> \"OAuth client ID\"." : "Bae a \"APIs & Servìtzios\" => \"Credentziales\" e incarca subra de \"+ CREA CREDENTZIALES\" -> \"OAuth client ID\".",
1717
"Set the \"Application type\" to \"Web application\" and give a name to the application." : "Imposta sa \"Genia de aplicatzione\" to \"Aplicatzione web\" e dae unu nùmene a s'aplicatzione.",
1818
"Make sure you set one \"Authorized redirect URI\" to" : "Segura·ti de àere impostadu unu \"\"URI de re-deretamentu autorizadu\" a",
1919
"Put the \"Client ID\" and \"Client secret\" below." : "Inserta·nche suta su \"ID client\" e \"Segreto del client\" in fatu.",
2020
"Finally, go to \"APIs & Services\" => \"Library\" and add the following APIs: \"Google Drive API\", \"Google Calendar API\", \"People API\" and \"Photos Library API\"." : "A ùrtimu, bae a \"API e servizi\" => \"Libreria\" e agiunghe is API imbenientes: \"Google Drive API\", \"Google Calendar API\", \"People API\" e \"Photos Library API\".",
21-
"Your Nextcloud users will then see a \"Connect to Google\" button in their personal settings." : "Is utentes tuos Nextcloud ant a bìdere unu butone \"Connete a Google\" in is impostatziones personales issoro.",
21+
"Your Nextcloud users will then see a \"Connect to Google\" button in their personal settings." : "Is utentes tuos Nextcloud ant a bìdere unu butone \"Connete a Google\" in sa cunfiguratzione personale issoro.",
2222
"Client ID" : "Cliente ID",
2323
"Client ID of your Google application" : "Cliente ID de s'aplicatzione de Google tua",
2424
"Client secret" : "Cliente segretu",

lib/Controller/ConfigController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ public function setConfig(array $values): DataResponse {
7676
$result['user_name'] = '';
7777
} else {
7878
if (isset($values['drive_output_dir'])) {
79-
/** @var \OCP\Files\IRootFolder $root */
80-
$root = \OC::$server->get(\OCP\Files\IRootFolder::class);
79+
$root = \OCP\Server::get(\OCP\Files\IRootFolder::class);
8180
$userRoot = $root->getUserFolder($this->userId);
8281
$result['free_space'] = \OCA\Google\Settings\Personal::getFreeSpace($userRoot, $values['drive_output_dir']);
8382
}

lib/Service/GoogleCalendarAPIService.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ public function importCalendar(string $userId, string $calId, string $calName, ?
209209
$params['{http://apple.com/ns/ical/}calendar-color'] = $color;
210210
}
211211

212-
$newCalName = trim($calName) . ' (' . $this->l10n->t('Google Calendar import') .')';
212+
$newCalName = urlencode(trim($calName) . ' (' . $this->l10n->t('Google Calendar import') .')');
213213
$ncCalId = $this->calendarExists($userId, $newCalName);
214214
$calendarIsNew = is_null($ncCalId);
215215
if (is_null($ncCalId)) {
@@ -234,6 +234,7 @@ public function importCalendar(string $userId, string $calId, string $calName, ?
234234
$nbAdded = 0;
235235
$nbUpdated = 0;
236236

237+
/** @var array{id: string, start?: array{date?: string, dateTime?: string}, end?: array{date?: string, dateTime?: string}, colorId?: string, summary?: string, visibility?: string, sequence?: string, location?: string, description?: string, status?: string, created?: string, updated?: string, reminders?: array{useDefault?: bool, overrides?: list{array{minutes?: string, hours?: string, days?: string, weeks?: string}}}, recurrence?: list<string>} $e */
237238
foreach ($events as $e) {
238239
$objectUri = $e['id'];
239240

@@ -249,6 +250,9 @@ public function importCalendar(string $userId, string $calId, string $calName, ?
249250
// check if it already exists and if we should update it
250251
$existingEvent = $this->caldavBackend->getCalendarObject($ncCalId, $objectUri);
251252
if ($existingEvent !== null) {
253+
if (!isset($e['updated'])) {
254+
continue;
255+
}
252256
$remoteEventUpdatedTimestamp = (new DateTime($e['updated']))->getTimestamp();
253257
$localEventUpdatedTimestamp = $this->getEventLastModifiedTimestamp($existingEvent['calendardata']);
254258
if ($localEventUpdatedTimestamp !== null && $remoteEventUpdatedTimestamp <= $localEventUpdatedTimestamp) {
@@ -269,7 +273,7 @@ public function importCalendar(string $userId, string $calId, string $calName, ?
269273
}
270274
$calData .= isset($e['summary'])
271275
? ('SUMMARY:' . substr(str_replace("\n", '\n', $e['summary']), 0, 250) . "\n")
272-
: ($e['visibility'] ?? '' === 'private'
276+
: (($e['visibility'] ?? '') === 'private'
273277
? ('SUMMARY:' . $this->l10n->t('Private event') . "\n")
274278
: '');
275279
$calData .= isset($e['sequence']) ? ('SEQUENCE:' . $e['sequence'] . "\n") : '';

0 commit comments

Comments
 (0)