Add delete/unpublish from remote platform capability #131

Open
opened 2026-06-21 15:49:47 +00:00 by jmiller · 0 comments
Owner

Summary

There is currently no way to delete or unpublish a cross-posted item from the remote platform. The MokoSuiteCrossServiceInterface only defines publish() — there is no deletePost() or unpublish() method.

When a user unpublishes or trashes a Joomla article, the cross-posted content remains live on all platforms.

Proposed changes

1. Add deletePost() to the service interface

// MokoSuiteCrossServiceInterface.php
public function deletePost(string $platformPostId, array $credentials): array;
// Returns: ['success' => bool, 'message' => string]

2. Implement in service plugins

Not all platforms support deletion — the interface method should have a default "not supported" response, and each plugin can override where the API allows it:

Platform Supports delete? API
Facebook Yes DELETE /{post-id}
Twitter/X Yes DELETE /2/tweets/{id}
LinkedIn Yes DELETE /ugcPosts/{id}
Mastodon Yes DELETE /api/v1/statuses/{id}
Bluesky Yes com.atproto.repo.deleteRecord
Telegram Yes deleteMessage
Discord Yes DELETE webhook message
Medium No API doesn't support
WordPress Yes PUT /wp/v2/posts/{id} status=trash
Dev.to Yes DELETE /api/articles/{id}
Mailchimp N/A Campaign-based

3. Hook into Joomla content events

  • onContentChangeState (unpublish) → optionally delete from platforms
  • onContentAfterDelete (trash/delete) → optionally delete from platforms
  • Component config toggle: "Delete from platforms when article is unpublished/trashed"

4. UI additions

  • "Delete from platform" button per post in the Post Queue view
  • Bulk "Delete from platforms" action

Acceptance Criteria

  • deletePost() method added to interface with default "not supported" return
  • Implemented for platforms that support deletion
  • Config option to auto-delete on article unpublish/trash
  • Manual delete button in Post Queue UI
  • Logs record deletion attempts and results
## Summary There is currently no way to delete or unpublish a cross-posted item from the remote platform. The `MokoSuiteCrossServiceInterface` only defines `publish()` — there is no `deletePost()` or `unpublish()` method. When a user unpublishes or trashes a Joomla article, the cross-posted content remains live on all platforms. ## Proposed changes ### 1. Add `deletePost()` to the service interface ```php // MokoSuiteCrossServiceInterface.php public function deletePost(string $platformPostId, array $credentials): array; // Returns: ['success' => bool, 'message' => string] ``` ### 2. Implement in service plugins Not all platforms support deletion — the interface method should have a default "not supported" response, and each plugin can override where the API allows it: | Platform | Supports delete? | API | |----------|-----------------|-----| | Facebook | Yes | DELETE /{post-id} | | Twitter/X | Yes | DELETE /2/tweets/{id} | | LinkedIn | Yes | DELETE /ugcPosts/{id} | | Mastodon | Yes | DELETE /api/v1/statuses/{id} | | Bluesky | Yes | com.atproto.repo.deleteRecord | | Telegram | Yes | deleteMessage | | Discord | Yes | DELETE webhook message | | Medium | No | API doesn't support | | WordPress | Yes | PUT /wp/v2/posts/{id} status=trash | | Dev.to | Yes | DELETE /api/articles/{id} | | Mailchimp | N/A | Campaign-based | ### 3. Hook into Joomla content events - `onContentChangeState` (unpublish) → optionally delete from platforms - `onContentAfterDelete` (trash/delete) → optionally delete from platforms - Component config toggle: "Delete from platforms when article is unpublished/trashed" ### 4. UI additions - "Delete from platform" button per post in the Post Queue view - Bulk "Delete from platforms" action ## Acceptance Criteria - [ ] `deletePost()` method added to interface with default "not supported" return - [ ] Implemented for platforms that support deletion - [ ] Config option to auto-delete on article unpublish/trash - [ ] Manual delete button in Post Queue UI - [ ] Logs record deletion attempts and results
Sign in to join this conversation.
No labels
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoSuiteCross#131