Skip to content

Commit e656f98

Browse files
authored
Merge pull request #87 from nextcloud/feat/external-search
Feat: mark external search providers as external & bump NC version to 33
2 parents 918028c + e1590b6 commit e656f98

File tree

7 files changed

+253
-181
lines changed

7 files changed

+253
-181
lines changed

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ and a unified search provider for messages. It also lets you send files to Matte
2020
<screenshot>https://raw.githubusercontent.com/nextcloud/integration_mattermost/main/img/screenshot2.jpg</screenshot>
2121
<screenshot>https://raw.githubusercontent.com/nextcloud/integration_mattermost/main/img/screenshot3.jpg</screenshot>
2222
<dependencies>
23-
<nextcloud min-version="32" max-version="32"/>
23+
<nextcloud min-version="32" max-version="33"/>
2424
</dependencies>
2525
<background-jobs>
2626
<job>OCA\Mattermost\BackgroundJob\DailySummaryWebhook</job>

composer.lock

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/Controller/ConfigController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ public function oauthRedirect(string $code = '', string $state = ''): RedirectRe
356356
$this->config->deleteUserValue($this->userId, Application::APP_ID, 'oauth_origin');
357357
if ($oauthOrigin === 'settings') {
358358
return new RedirectResponse(
359-
$this->urlGenerator->linkToRoute('settings.PersonalSettings.index', ['section' => 'connected-accounts']) .
360-
'?mattermostToken=success'
359+
$this->urlGenerator->linkToRoute('settings.PersonalSettings.index', ['section' => 'connected-accounts'])
360+
. '?mattermostToken=success'
361361
);
362362
} elseif ($oauthOrigin === 'dashboard') {
363363
return new RedirectResponse(
@@ -384,8 +384,8 @@ public function oauthRedirect(string $code = '', string $state = ''): RedirectRe
384384
$result = $this->l->t('Error during OAuth exchanges');
385385
}
386386
return new RedirectResponse(
387-
$this->urlGenerator->linkToRoute('settings.PersonalSettings.index', ['section' => 'connected-accounts']) .
388-
'?mattermostToken=error&message=' . urlencode($result)
387+
$this->urlGenerator->linkToRoute('settings.PersonalSettings.index', ['section' => 'connected-accounts'])
388+
. '?mattermostToken=error&message=' . urlencode($result)
389389
);
390390
}
391391

lib/Search/MattermostSearchMessagesProvider.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@
3333
use OCP\IL10N;
3434
use OCP\IURLGenerator;
3535
use OCP\IUser;
36+
use OCP\Search\IExternalProvider;
3637
use OCP\Search\IProvider;
3738
use OCP\Search\ISearchQuery;
3839
use OCP\Search\SearchResult;
3940
use OCP\Search\SearchResultEntry;
4041

41-
class MattermostSearchMessagesProvider implements IProvider {
42+
class MattermostSearchMessagesProvider implements IProvider, IExternalProvider {
4243

4344
public function __construct(
4445
private IAppManager $appManager,
@@ -176,4 +177,8 @@ protected function getThumbnailUrl(array $entry): string {
176177
)
177178
: '';
178179
}
180+
181+
public function isExternalProvider(): bool {
182+
return true;
183+
}
179184
}

vendor-bin/cs-fixer/composer.lock

Lines changed: 24 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)