1
0
mirror of https://github.com/flarum/core.git synced 2025-10-13 07:54:25 +02:00

User Preferences Extender and Tests (#2463)

This commit is contained in:
Alexander Skvortsov
2020-12-04 15:45:08 -05:00
committed by GitHub
parent 641619e820
commit eed407812f
7 changed files with 99 additions and 14 deletions

View File

@@ -41,7 +41,7 @@ class AlertNotificationDriver implements NotificationDriverInterface
*/
public function registerType(string $blueprintClass, array $driversEnabledByDefault): void
{
User::addPreference(
User::registerPreference(
User::getNotificationPreferenceKey($blueprintClass::getType(), 'alert'),
'boolval',
in_array('alert', $driversEnabledByDefault)

View File

@@ -59,7 +59,7 @@ class EmailNotificationDriver implements NotificationDriverInterface
public function registerType(string $blueprintClass, array $driversEnabledByDefault): void
{
if ((new ReflectionClass($blueprintClass))->implementsInterface(MailableInterface::class)) {
User::addPreference(
User::registerPreference(
User::getNotificationPreferenceKey($blueprintClass::getType(), 'email'),
'boolval',
in_array('email', $driversEnabledByDefault)