mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-18 08:26:21 +00:00
feat(api): add get_current_window call
Add prof_get_current_window API to retrieve the title of the currently active window, matching the titlebar display. The feature is especially useful to track currently used plugin window.
This commit is contained in:
@@ -830,6 +830,22 @@ def get_current_recipient() -> str | None:
|
||||
"""
|
||||
pass
|
||||
|
||||
def get_current_window() -> str:
|
||||
"""Retrieves the title of the current window as shown in the titlebar.
|
||||
|
||||
Returns the title of the currently active window, matching the titlebar display.
|
||||
Special cases:
|
||||
- For MUC configuration windows, includes "config" and an asterisk if modified (e.g., "room@example.com config \*").
|
||||
- For vCard windows, includes the bare JID and an asterisk if modified (e.g., "vCard user@example.com \*").
|
||||
|
||||
:return: The window title as a string.
|
||||
|
||||
Example::
|
||||
|
||||
title = prof.get_current_window()
|
||||
prof.cons_show(f"Current window: {title}")
|
||||
"""
|
||||
|
||||
def get_current_muc() -> str | None:
|
||||
"""Retrieves the Jabber ID of the current chat room.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user