Mastodon Channel #35

Open
opened 2025-07-09 23:35:55 +02:00 by myrmidex · 0 comments
myrmidex commented 2025-07-09 23:35:55 +02:00 (Migrated from codeberg.org)

Summary

Add Mastodon as a second publishing platform alongside Lemmy.

Context

Currently only Lemmy is supported. Mastodon uses a fundamentally different API (OAuth2, statuses with character limits vs full posts). This requires both new platform-specific code and refactoring the publishing pipeline to be platform-agnostic.

Architecture Changes

  • Create PlatformPublisherInterface with publishToChannel() contract
  • Make LemmyPublisher implement the new interface
  • Refactor ArticlePublishingService.makePublisher() to resolve publisher by platform type
  • Refactor ArticlePublishingService.publishToChannel() to handle platform-agnostic response structures (currently reads Lemmy-specific post_view.post.id)

Mastodon Implementation

  • Add PlatformEnum::MASTODON
  • MastodonApiService — OAuth2 authentication, status creation, timeline fetching
  • MastodonAuthService — OAuth2 token management (different from Lemmy's JWT)
  • MastodonPublisher implementing PlatformPublisherInterface
  • Content transformation: Mastodon statuses have character limits (~500 chars) — need to truncate/summarize article content + append link

Sync & Duplicate Detection

  • Extend SyncChannelPostsJob for Mastodon (currently Lemmy-only)
  • Mastodon duplicate detection via PlatformChannelPost

UI & Account Management

  • OAuth2 flow for account setup (vs Lemmy's username/password)
  • Account management UI changes for Mastodon-specific fields
  • Platform selection in channel/account creation forms

Tests

  • MastodonApiService unit tests
  • MastodonPublisher unit tests
  • PlatformPublisherInterface integration tests
  • Refactored ArticlePublishingService tests
## Summary Add Mastodon as a second publishing platform alongside Lemmy. ## Context Currently only Lemmy is supported. Mastodon uses a fundamentally different API (OAuth2, statuses with character limits vs full posts). This requires both new platform-specific code and refactoring the publishing pipeline to be platform-agnostic. ## Architecture Changes - [ ] Create `PlatformPublisherInterface` with `publishToChannel()` contract - [ ] Make `LemmyPublisher` implement the new interface - [ ] Refactor `ArticlePublishingService.makePublisher()` to resolve publisher by platform type - [ ] Refactor `ArticlePublishingService.publishToChannel()` to handle platform-agnostic response structures (currently reads Lemmy-specific `post_view.post.id`) ## Mastodon Implementation - [ ] Add `PlatformEnum::MASTODON` - [ ] `MastodonApiService` — OAuth2 authentication, status creation, timeline fetching - [ ] `MastodonAuthService` — OAuth2 token management (different from Lemmy's JWT) - [ ] `MastodonPublisher` implementing `PlatformPublisherInterface` - [ ] Content transformation: Mastodon statuses have character limits (~500 chars) — need to truncate/summarize article content + append link ## Sync & Duplicate Detection - [ ] Extend `SyncChannelPostsJob` for Mastodon (currently Lemmy-only) - [ ] Mastodon duplicate detection via `PlatformChannelPost` ## UI & Account Management - [ ] OAuth2 flow for account setup (vs Lemmy's username/password) - [ ] Account management UI changes for Mastodon-specific fields - [ ] Platform selection in channel/account creation forms ## Tests - [ ] MastodonApiService unit tests - [ ] MastodonPublisher unit tests - [ ] PlatformPublisherInterface integration tests - [ ] Refactored ArticlePublishingService tests
myrmidex modified the milestone from v1.1.0 to v1.2.0 2026-03-07 15:50:21 +01:00
myrmidex modified the milestone from v1.2.0 to v2.0.0 2026-03-08 17:42:13 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lvl0/fedi-feed-router#35
No description provided.