Add prof.get_current_window API to Retrieve Current Window Title
#34
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Updated Issue
Description
Currently, the CProof's Python API provides functions like
prof.get_current_recipientandprof.get_current_mucto retrieve context-specific information about the active chat. However, there is no way to retrieve the title of the currently active window, which is useful for plugins that need to display or act on the window's titlebar content (e.g., for UI customization or context-aware commands).This is particularly crucial for plugin windows, where the title matches the window tag used for communication (e.g., in
prof_win_showand similar API functions). Plugins rely on tags to target specific windows for operations like displaying messages. Retrieving the current window title allows plugins to dynamically obtain the tag if the active window is a plugin window, enabling seamless interaction without hardcoding tags.Proposed Solution
prof.get_current_window()to the API that returns the title of the current window as a string, matching the titlebar displayapi_win_show(and similar functions) to support additional window types, such as falling back tocons_showfor console or non-plugin windows if the tag doesn't match a plugin window.This would align with existing context-retrieval functions and enhance plugin functionality.
Use Case
prof.get_current_windowto get the title (tag for plugin windows) and then callprof.win_show(title, "Message")to display content in the active plugin window.api_win_showcould route to appropriate display functions (e.g.,cons_showfor console).Acceptance Criteria:
prof.get_current_window() -> strto the Python API.char* get_current_window()to the C API.api_win_showto handle non-plugin windows (e.g., via fallback tocons_show).Closed by #35