Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>preferred_providers</id>
<name>Preferred Providers</name>
<summary>Allow nextcloud to request user accounts</summary>
Expand All @@ -12,14 +11,14 @@
<category>files</category>
<bugs>https://github.com/nextcloud/preferred_providers</bugs>
<dependencies>
<nextcloud min-version="16" max-version="18"/>
<nextcloud min-version="17" max-version="18"/>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claiming to be compatible with a version that is not even started yet? did you misunderstand the max-version? Or what's the reason behind it? if you have max-version="17" it will work with all 17 versions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I want to be able to work with it in 18?
As soon as we branch off on server, this will be compatible with 17 and 18.
This pr will not be merged until 17 is released and branched off :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well but it defeats totally the porpuse of the field if you put it in the app store like this.
Same as before. the old version in the app store says it's compatible with 17, but it isnt 🤷

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this release is a mistake :)
So I should just do min 17 max 17, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and after stable17 is branched of you increase it in master

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nickvergessen :)

</dependencies>
<settings>
<admin>OCA\Preferred_Providers\Settings\Admin</admin>
<admin-section>OCA\Preferred_Providers\Settings\Section</admin-section>
<admin-section>OCA\Preferred_Providers\Settings\Section</admin-section>
</settings>
<background-jobs>
<job>OCA\Preferred_Providers\BackgroundJob\NotifyUnsetPassword</job>
<job>OCA\Preferred_Providers\BackgroundJob\ExpireUnverifiedAccounts</job>
<job>OCA\Preferred_Providers\BackgroundJob\NotifyUnsetPassword</job>
<job>OCA\Preferred_Providers\BackgroundJob\ExpireUnverifiedAccounts</job>
</background-jobs>
</info>
14 changes: 3 additions & 11 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
declare(strict_types=1);
/**
* @copyright Copyright (c) 2018 John Molakvoæ <[email protected]>
*
*
* @author John Molakvoæ <[email protected]>
*
* @license GNU AGPL version 3 or any later version
Expand Down Expand Up @@ -33,7 +33,7 @@ class Application extends App {

/** @var string */
protected $appName = 'preferred_providers';

public function __construct() {
parent::__construct($this->appName);
}
Expand All @@ -45,14 +45,6 @@ public function register() {

protected function registerNotifier(IServerContainer $server) {
$manager = $server->getNotificationManager();
$manager->registerNotifier(function() use ($server) {
return $server->query(Notifier::class);
}, function() use ($server) {
$l = $server->getL10N($this->appName);
return [
'id' => $this->appName,
'name' => $l->t('Simple signup'),
];
});
$manager->registerNotifierService(Notifier::class);
}
}
22 changes: 21 additions & 1 deletion lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,33 @@ public function __construct(string $appName,
$this->urlGenerator = $urlGenerator;
}

/**
* Identifier of the notifier, only use [a-z0-9_]
*
* @return string
* @since 17.0.0
*/
public function getID(): string {
return $this->appName;
}

/**
* Human readable name describing the notifier
*
* @return string
* @since 17.0.0
*/
public function getName(): string {
return $this->l10nFactory->get($this->appName)->t('Simple signup');
}

/**
* @param INotification $notification
* @param string $languageCode The code of the language that should be used to prepare the notification
* @return INotification
* @throws \InvalidArgumentException When the notification was not prepared by a notifier
*/
public function prepare(INotification $notification, $languageCode): INotification {
public function prepare(INotification $notification, string $languageCode): INotification {
if ($notification->getApp() !== $this->appName) {
throw new \InvalidArgumentException('Incorrect app');
}
Expand Down