-
Notifications
You must be signed in to change notification settings - Fork 530
添加websocket和smtp通知方法,添加bark通知,websocket为qq机器人预留。 #1254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
feat: add email and websocket notification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR introduces new notification methods via WebSocket and Email in the BetterGenshinImpact project, expanding the notification system's capabilities.
- Added EmailNotifier and WebSocketNotifier implementations
- Updated NotificationService to initialize and register these new notifiers based on configuration
- Enhanced NotificationConfig to include settings for the new notifiers
Reviewed Changes
File | Description |
---|---|
BetterGenshinImpact/Service/Notifier/EmailNotifier.cs | Adds asynchronous email sending via SMTP with basic error handling |
BetterGenshinImpact/Service/Notifier/WebSocketNotifier.cs | Introduces WebSocket-based notification sending with connection management |
BetterGenshinImpact/Service/Notification/NotificationService.cs | Includes initialization logic for WebSocketNotifier and EmailNotifier in the service startup |
BetterGenshinImpact/Service/Notification/NotificationConfig.cs | Extends configuration to support WebSocket and Email notifications |
BetterGenshinImpact/ViewModel/Pages/CommonSettingsPageViewModel.cs | Adds test command methods for WebSocket and Email notifications |
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
|
||
await smtpClient.SendMailAsync(mailMessage); | ||
} | ||
catch (System.Exception ex) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
话说邮件通知值得把图片加上吗 |
- 提升 EmailNotifier 中的 SmtpClient 为类的成员变量,并在构造函数中初始化,优化资源使用 - 改进 WebSocketNotifier 的连接和重连逻辑,提高稳定性 - 优化通知器的错误处理和日志记录,增强可维护性
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces three new notification methods—WebSocket, Email, and Bark—to enhance the notification system. It also updates configuration and initialization routines in the NotificationService and adds corresponding test commands in the settings page.
- Added EmailNotifier, WebSocketNotifier, and BarkNotifier classes
- Extended NotificationConfig with new properties, and updated NotificationService to register the new notifiers
- Added UI commands in the settings page to test the new notification channels
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
BetterGenshinImpact/Service/Notifier/EmailNotifier.cs | Introduces email notification functionality |
BetterGenshinImpact/Service/Notifier/WebSocketNotifier.cs | Adds WebSocket notifications with connection handling |
BetterGenshinImpact/Service/Notifier/BarkNotifier.cs | Implements Bark notifications; potential issue with device keys iteration |
BetterGenshinImpact/Service/Notification/NotificationService.cs | Updates notifier registration and adds resource disposal |
BetterGenshinImpact/Service/Notification/NotificationConfig.cs | Adds configuration for WebSocket, Email, and Bark |
BetterGenshinImpact/ViewModel/Pages/CommonSettingsPageViewModel.cs | Adds test command methods for new notifications |
fix: remove api.day.app
This pull request introduces several new features and enhancements to the notification system in the
BetterGenshinImpact
project. The most significant changes include the addition of WebSocket and Email notification support, as well as the necessary configurations and initializations for these new notifiers.New Notification Features:
Added WebSocket notification support:
WebSocketNotifier
class to handle WebSocket notifications.NotificationConfig
to include properties for WebSocket configuration.NotificationService
to initialize theWebSocketNotifier
based on configuration.Added Email notification support:
EmailNotifier
class to handle Email notifications.NotificationConfig
to include properties for Email configuration.NotificationService
to initialize theEmailNotifier
based on configuration.Configuration and Initialization:
NotificationConfig
class to include new properties for WebSocket and Email configurations.NotificationService
to initialize the new notifiers based on the provided configurations.Minor Changes:
NotificationConfig.cs
andNotificationService.cs
for new dependencies. [1] [2]CommonSettingsPage.xaml
to accommodate new settings.