Implement post editing functionality for Mastodon

Add ability to edit posts in Mastodon with full support for:
- Editing post text and content warnings
- Re-uploading or keeping existing media attachments
- Editing poll options (for posts with polls)
- Modifying visibility and language settings
- All features available through web interface

Changes:
- Add edit_post() method in Mastodon session to handle API calls
- Create editPost dialog class that loads existing post data
- Add edit_status() method to buffer controllers
- Add Edit menu item to base and notification menus
- Register edit_post action in all keymaps (no default key assigned)
- Add edit_post() action handler in main controller

The edit option is only enabled for the user's own posts (not boosts).
Users can access the feature through the context menu or by assigning
a keyboard shortcut in the keymap editor.
This commit is contained in:
Claude
2025-11-06 14:37:12 +00:00
parent cbafb7da69
commit 977de1332a
11 changed files with 121 additions and 0 deletions

View File

@@ -449,6 +449,15 @@ class Controller(object):
buffer = self.search_buffer(buffer.name, buffer.account)
buffer.destroy_status()
def edit_post(self, *args, **kwargs):
""" Edits a post in the current buffer.
Users can only edit their own posts."""
buffer = self.view.get_current_buffer()
if hasattr(buffer, "account"):
buffer = self.search_buffer(buffer.name, buffer.account)
if hasattr(buffer, "edit_status"):
buffer.edit_status()
def exit(self, *args, **kwargs):
if config.app["app-settings"]["ask_at_exit"] == True:
answer = commonMessageDialogs.exit_dialog(self.view)