Skip to content

feat(notifications): inline replies to message notifications - #263

Merged
zackb merged 1 commit into
zackb:mainfrom
aashish-thapa:inline-reply
Oct 23, 2026
Merged

zackb merged 1 commit into
zackb:mainfrom
aashish-thapa:inline-reply

Conversation

@aashish-thapa

Copy link
Copy Markdown
Contributor

What

Reply to an SMS/iMessage straight from its desktop notification, the way macOS lets you type into the banner, instead of the Reply button opening tether-gtk.

On notification servers that advertise the inline-reply capability (swaync, KDE Plasma), message notifications now carry an inline-reply action plus the x-kde-reply-placeholder-text hint. The server shows a text field and answers with the NotificationReplied(id, text) signal, which tetherd sends to the conversation over MAP, the same path --bt-send uses.

Servers without the capability are unchanged: they get the existing Reply button, which opens the thread in tether-gtk. Clicking the notification body still opens the thread everywhere.

How

  • DesktopNotifier::set_reply_handler, alongside the existing copy handler.
  • The notifier subscribes to NotificationReplied from its own GLib thread, so the signal lands on the context that owns the notification id → thread map. Entries are dropped on reply or when the notification closes (swaync emits NotificationReplied before closing).
  • Capability is checked per notification, since the server can be restarted or swapped while tetherd runs.
  • The "send on a worker thread, then broadcast bt_message/bt_send_result" block behind bt_send_message moves into send_bt_message_async, so the IPC command and inline replies share it and the GUI history updates either way.
  • A failed inline reply raises a "Reply not sent" notification with the error, since there's no window to show it in.
  • po/tether.pot regenerated for the two new strings ("Reply…", "Reply not sent"); the .po files are left for translators.

Testing

  • Arch Linux, Hyprland 0.56.2, swaync 0.12.6 (with notification-inline-replies enabled), iPhone over BR/EDR + LE.
  • Received an iMessage, replied from the notification's field; the reply was delivered and shows as sent in the thread.
  • ctest: 595/595 pass, including po_template.
  • Not tested on KDE Plasma, which uses the same inline-reply / NotificationReplied convention.

🤖 Generated with Claude Code

On notification servers that advertise the "inline-reply" capability
(swaync, KDE Plasma), message notifications get a reply field instead of
the plain Reply button. Text typed there arrives as NotificationReplied
and is sent to the conversation over MAP, the same path as --bt-send.
Servers without the capability keep the existing Reply button, which
opens the thread in tether-gtk.

The send-in-background-and-broadcast logic behind bt_send_message moves
into send_bt_message_async so both entry points share it. A failed
inline reply raises a "Reply not sent" notification, since there is no
window to show the error in.

@zackb zackb left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool!

@zackb
zackb merged commit 3fa35bf into zackb:main Oct 23, 2026
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.

2 participants