Remove references to discord.

This commit is contained in:
James Cole 2024-12-09 06:00:43 +01:00
parent 2f7a1c941e
commit c841fa3620
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
5 changed files with 3 additions and 13 deletions

View File

@ -25,6 +25,7 @@ declare(strict_types=1);
namespace FireflyIII\Events; namespace FireflyIII\Events;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;
/** /**
* Class NewVersionAvailable * Class NewVersionAvailable
@ -40,6 +41,7 @@ class NewVersionAvailable extends Event
*/ */
public function __construct(string $message) public function __construct(string $message)
{ {
Log::debug(__METHOD__);
$this->message = $message; $this->message = $message;
} }
} }

View File

@ -41,7 +41,6 @@ class NotificationController extends Controller
$subTitle = (string) trans('firefly.title_owner_notifications'); $subTitle = (string) trans('firefly.title_owner_notifications');
$subTitleIcon = 'envelope-o'; $subTitleIcon = 'envelope-o';
$slackUrl = app('fireflyconfig')->get('slack_webhook_url', '')->data; $slackUrl = app('fireflyconfig')->get('slack_webhook_url', '')->data;
$discordUrl = app('fireflyconfig')->get('discord_webhook_url', '')->data;
$channels = config('notifications.channels'); $channels = config('notifications.channels');
@ -54,7 +53,7 @@ class NotificationController extends Controller
} }
return view('admin.notifications.index', compact('title', 'subTitle', 'mainTitleIcon', 'subTitleIcon', 'channels', 'slackUrl', 'discordUrl', 'notifications')); return view('admin.notifications.index', compact('title', 'subTitle', 'mainTitleIcon', 'subTitleIcon', 'channels', 'slackUrl', 'notifications'));
} }
public function postIndex(NotificationRequest $request): RedirectResponse public function postIndex(NotificationRequest $request): RedirectResponse
@ -69,15 +68,9 @@ class NotificationController extends Controller
if ('' === $all['slack_url']) { if ('' === $all['slack_url']) {
app('fireflyconfig')->delete('slack_webhook_url'); app('fireflyconfig')->delete('slack_webhook_url');
} }
if ('' === $all['discord_url']) {
app('fireflyconfig')->delete('discord_webhook_url');
}
if ('' !== $all['slack_url']) { if ('' !== $all['slack_url']) {
app('fireflyconfig')->set('slack_webhook_url', $all['slack_url']); app('fireflyconfig')->set('slack_webhook_url', $all['slack_url']);
} }
if ('' !== $all['discord_url']) {
app('fireflyconfig')->set('discord_webhook_url', $all['discord_url']);
}
session()->flash('success', (string) trans('firefly.notification_settings_saved')); session()->flash('success', (string) trans('firefly.notification_settings_saved'));
@ -95,7 +88,6 @@ class NotificationController extends Controller
session()->flash('error', (string) trans('firefly.notification_test_failed', ['channel' => $channel])); session()->flash('error', (string) trans('firefly.notification_test_failed', ['channel' => $channel]));
break; break;
case 'email': case 'email':
case 'discord':
case 'slack': case 'slack':
/** @var User $user */ /** @var User $user */
$user = auth()->user(); $user = auth()->user();

View File

@ -44,7 +44,6 @@ class NotificationRequest extends FormRequest
} }
$return[$key] = $value; $return[$key] = $value;
} }
$return['discord_url'] = $this->convertString('discord_url');
$return['slack_url'] = $this->convertString('slack_url'); $return['slack_url'] = $this->convertString('slack_url');
return $return; return $return;
} }
@ -55,7 +54,6 @@ class NotificationRequest extends FormRequest
public function rules(): array public function rules(): array
{ {
$rules = [ $rules = [
'discord_url' => ['nullable', 'url', 'min:1', new IsValidDiscordUrl()],
'slack_url' => ['nullable', 'url', 'min:1', new IsValidSlackUrl()], 'slack_url' => ['nullable', 'url', 'min:1', new IsValidSlackUrl()],
]; ];
foreach (config('notifications.notifications.owner') as $key => $info) { foreach (config('notifications.notifications.owner') as $key => $info) {

View File

@ -24,7 +24,6 @@ return [
'channels' => [ 'channels' => [
'email' => ['enabled' => true, 'ui_configurable' => 0,], 'email' => ['enabled' => true, 'ui_configurable' => 0,],
'slack' => ['enabled' => true, 'ui_configurable' => 1,], 'slack' => ['enabled' => true, 'ui_configurable' => 1,],
'discord' => ['enabled' => true, 'ui_configurable' => 1,],
'nfty' => ['enabled' => false, 'ui_configurable' => 0,], 'nfty' => ['enabled' => false, 'ui_configurable' => 0,],
'pushover' => ['enabled' => false, 'ui_configurable' => 0,], 'pushover' => ['enabled' => false, 'ui_configurable' => 0,],
'gotify' => ['enabled' => false, 'ui_configurable' => 0,], 'gotify' => ['enabled' => false, 'ui_configurable' => 0,],

View File

@ -25,7 +25,6 @@
{% endfor %} {% endfor %}
<p style="margin-top:2em;">{{ 'channel_settings'|_ }}</p> <p style="margin-top:2em;">{{ 'channel_settings'|_ }}</p>
{{ ExpandedForm.text('slack_url', slackUrl, {'label' : 'slack_url_label'|_}) }} {{ ExpandedForm.text('slack_url', slackUrl, {'label' : 'slack_url_label'|_}) }}
{{ ExpandedForm.text('discord_url', discordUrl, {'label' : 'discord_url_label'|_}) }}
</div> </div>
<div class="box-footer"> <div class="box-footer">
<button type="submit" class="btn btn-success"> <button type="submit" class="btn btn-success">