mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Drop the status block from new-device notifications
New devices are never registered, so the status line only ever read "Not registered" and added no information. Remove it from the single new-device notification body (the consolidated summary never had one). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
f0d939f685
commit
3ebb35933e
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
## Backend
|
## Backend
|
||||||
|
|
||||||
- [ ] In notifications, when its a new device(s) found notification, remove the status block (new devices are never registered)
|
- [x] In notifications, when its a new device(s) found notification, remove the status block (new devices are never registered)
|
||||||
- [x] In notifications, when the vendor is empty put (unknown)
|
- [x] In notifications, when the vendor is empty put (unknown)
|
||||||
- [ ] Implement the pushover API call directly to support HTML content and review notification text to use it
|
- [ ] Implement the pushover API call directly to support HTML content and review notification text to use it
|
||||||
|
|
||||||
|
|||||||
@@ -196,9 +196,6 @@ fn render_new_device(device: &Device) -> (String, String) {
|
|||||||
writeln!(body, " Vendor: {}", vendor_or_placeholder(device)).unwrap();
|
writeln!(body, " Vendor: {}", vendor_or_placeholder(device)).unwrap();
|
||||||
writeln!(body, " Type: {}", device_type_or_placeholder(device)).unwrap();
|
writeln!(body, " Type: {}", device_type_or_placeholder(device)).unwrap();
|
||||||
writeln!(body).unwrap();
|
writeln!(body).unwrap();
|
||||||
writeln!(body, "Status").unwrap();
|
|
||||||
writeln!(body, " {}", registration_line(device)).unwrap();
|
|
||||||
writeln!(body).unwrap();
|
|
||||||
write!(
|
write!(
|
||||||
body,
|
body,
|
||||||
"If you do not recognise this device, consider investigating before \
|
"If you do not recognise this device, consider investigating before \
|
||||||
@@ -688,7 +685,9 @@ mod tests {
|
|||||||
assert!(body.contains("Name: printer.local"));
|
assert!(body.contains("Name: printer.local"));
|
||||||
assert!(body.contains("Vendor: Apple, Inc."));
|
assert!(body.contains("Vendor: Apple, Inc."));
|
||||||
assert!(body.contains("Type: Smartphone"));
|
assert!(body.contains("Type: Smartphone"));
|
||||||
assert!(body.contains("Not registered"));
|
// New devices are never registered, so the status block is omitted entirely.
|
||||||
|
assert!(!body.contains("Status"));
|
||||||
|
assert!(!body.contains("registered"));
|
||||||
assert!(body.contains("If you do not recognise this device"));
|
assert!(body.contains("If you do not recognise this device"));
|
||||||
// Private data must never appear in the body.
|
// Private data must never appear in the body.
|
||||||
assert!(!body.contains("aa:bb:cc:dd:ee:ff"));
|
assert!(!body.contains("aa:bb:cc:dd:ee:ff"));
|
||||||
|
|||||||
Reference in New Issue
Block a user