Skip to content

Add optional desktop notifications to owly receive - #144

Open
sneurlax wants to merge 1 commit into
t4t5:mainfrom
sneurlax:feat/receive-desktop-notifications
Open

sneurlax wants to merge 1 commit into
t4t5:mainfrom
sneurlax:feat/receive-desktop-notifications

Conversation

@sneurlax

Copy link
Copy Markdown

This adds owly receive --notify, allowing a receiver running in a terminal or in the background to present incoming AirDrop requests through the desktop notification service.

The implementation uses the existing zbus dependency to connect to org.freedesktop.Notifications over the session bus. It adds no new crate dependencies.

For incoming requests, the notification includes Accept and Decline actions alongside the existing terminal prompt. Either input path can resolve the request, and the other prompt is then closed. The shared 15-second deadline remains in effect, and closed stdin no longer immediately declines a request while a notification action is still available.

Notifications also report completed file transfers, received links, and transfer failures. Failure to connect to the notification service is non-fatal and leaves the normal terminal behavior intact.

All remotely supplied names, filenames, URLs, and error text are length-limited, stripped of control characters, and escaped before being passed to the markup-capable notification body.

Tests cover text sanitization and markup escaping, action mapping, offer summaries, and received-file summaries.

Test:

`cargo test -p owly-cli`

Add `--notify` to `owly receive`, connecting to `org.freedesktop.Notifications` over session D-Bus with `zbus` (no new crate dependencies).

Incoming `ASK-2` requests present Accept/Decline notification actions alongside the terminal prompt, cleanly close notifications answered in the terminal, handle closed-stdin background invocation without stalling the 15 s prompt, sanitize untrusted metadata per SEC-4, and notify when files, URLs, or errors finish.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant