Repository navigation
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
zbusdependency to connect toorg.freedesktop.Notificationsover 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: