mirror of
https://github.com/ErikReider/SwayNotificationCenter.git
synced 2024-11-29 05:36:57 +03:00
Added ability to toggle parsing of notification 2fa codes (#260)
This commit is contained in:
parent
a8b04b9cf0
commit
28ed6342cc
@ -8,6 +8,7 @@
|
||||
"control-center-margin-bottom": 0,
|
||||
"control-center-margin-right": 0,
|
||||
"control-center-margin-left": 0,
|
||||
"notification-2fa-action": true,
|
||||
"notification-icon-size": 64,
|
||||
"notification-body-image-height": 100,
|
||||
"notification-body-image-width": 200,
|
||||
|
@ -541,6 +541,11 @@ namespace SwayNotificationCenter {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If each notification should display a 'COPY \"1234\"' action
|
||||
*/
|
||||
public bool notification_2fa_action { get; set; default = true; }
|
||||
|
||||
/**
|
||||
* Notification icon size, in pixels.
|
||||
*/
|
||||
|
@ -64,6 +64,11 @@
|
||||
"description": "The margin (in pixels) at the left of the notification center. 0 to disable",
|
||||
"default": 0
|
||||
},
|
||||
"notification-2fa-action": {
|
||||
"type": "boolean",
|
||||
"description": "If each notification should display a 'COPY \"1234\"' action",
|
||||
"default": true
|
||||
},
|
||||
"notification-icon-size": {
|
||||
"type": "integer",
|
||||
"description": "The notification icon size (in pixels)",
|
||||
|
@ -293,6 +293,7 @@ namespace SwayNotificationCenter {
|
||||
|
||||
/** Returns the first code found, else null */
|
||||
private string ? parse_body_codes () {
|
||||
if (!ConfigModel.instance.notification_2fa_action) return null;
|
||||
string body = this.body.get_text ().strip ();
|
||||
if (body.length == 0) return null;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user