Mastodon: scheduled posts, polls, and visibility levels #152

Open
opened 2026-06-23 13:33:27 +00:00 by jmiller · 2 comments
Owner

Summary

The Mastodon API natively supports features our plugin doesn't use: scheduled posts, polls, visibility levels, and content warnings.

Features to Add

Scheduled Posts

  • scheduled_at parameter (ISO 8601, must be 5+ min in future)
  • Returns ScheduledStatus object instead of Status
  • Can be managed via /api/v1/scheduled_statuses

Polls

  • poll[options][] array parameter
  • poll[expires_in] seconds
  • poll[multiple] boolean
  • Mutually exclusive with media attachments

Visibility Levels

  • visibility parameter: public, unlisted, private (followers-only), direct
  • Default: public

Content Warnings

  • spoiler_text parameter
  • Hides post content behind a warning

Implementation

Add to MastodonService::publish():

  • Read $params['scheduled_at'] for scheduling
  • Read $params['poll'] for poll data
  • Read $params['visibility'] defaulting to public
  • Read $params['spoiler_text'] for CW

Acceptance Criteria

  • Scheduled posts via scheduled_at parameter
  • Poll creation with options and expiry
  • Visibility level selection (public/unlisted/private/direct)
  • Content warning / spoiler text support
  • Template placeholder {visibility} or config default

References

## Summary The Mastodon API natively supports features our plugin doesn't use: scheduled posts, polls, visibility levels, and content warnings. ## Features to Add ### Scheduled Posts - `scheduled_at` parameter (ISO 8601, must be 5+ min in future) - Returns `ScheduledStatus` object instead of `Status` - Can be managed via `/api/v1/scheduled_statuses` ### Polls - `poll[options][]` array parameter - `poll[expires_in]` seconds - `poll[multiple]` boolean - Mutually exclusive with media attachments ### Visibility Levels - `visibility` parameter: `public`, `unlisted`, `private` (followers-only), `direct` - Default: `public` ### Content Warnings - `spoiler_text` parameter - Hides post content behind a warning ## Implementation Add to `MastodonService::publish()`: - Read `$params['scheduled_at']` for scheduling - Read `$params['poll']` for poll data - Read `$params['visibility']` defaulting to `public` - Read `$params['spoiler_text']` for CW ## Acceptance Criteria - [ ] Scheduled posts via `scheduled_at` parameter - [ ] Poll creation with options and expiry - [ ] Visibility level selection (public/unlisted/private/direct) - [ ] Content warning / spoiler text support - [ ] Template placeholder `{visibility}` or config default ## References - [Mastodon Statuses API](https://docs.joinmastodon.org/methods/statuses/) - [Mastodon Scheduled Statuses](https://docs.joinmastodon.org/methods/scheduled_statuses/) - Mastodon 4.6 (June 2026) adds quote post verification
Author
Owner

Implemented in commit 5fee5d7. Added to MastodonService::publish(): visibility (public/unlisted/private/direct from params or plugin config), spoiler_text for content warnings, scheduled_at for scheduled posts, poll creation (options/expires_in/multiple, mutually exclusive with media), and language tags. Also fixed broken ${CLASS_NAME} namespace in mastodon.xml.

Implemented in commit `5fee5d7`. Added to `MastodonService::publish()`: visibility (public/unlisted/private/direct from params or plugin config), spoiler_text for content warnings, scheduled_at for scheduled posts, poll creation (options/expires_in/multiple, mutually exclusive with media), and language tags. Also fixed broken `${CLASS_NAME}` namespace in mastodon.xml.
Author
Owner

Testing Checklist

Migrated from #174

Test Steps

Visibility

  • Default visibility config dropdown in plugin settings (public/unlisted/private/direct)
  • Posts use configured default visibility
  • Visibility can be overridden per-post via params

Content Warnings

  • spoiler_text param adds CW to toot
  • Post content hidden behind warning on Mastodon

Scheduled Posts

  • scheduled_at param creates scheduled status (not immediate post)
  • Scheduled status appears in Mastodon scheduled queue
  • Must be 5+ minutes in future

Polls

  • Poll options sent when params['poll']['options'] provided
  • Poll expires_in configurable (default 86400 = 24h)
  • multiple flag enables multi-select polls
  • Polls mutually exclusive with media (no image + poll)

Language Tags

  • language param sets post language (BCP-47 code)

Namespace Fix

  • mastodon.xml namespace is Joomla\Plugin\MokoSuiteCross\Mastodon (not ${CLASS_NAME})

Related

  • #152 (implementation, closed)
## Testing Checklist _Migrated from #174_ ## Test Steps ### Visibility - [ ] Default visibility config dropdown in plugin settings (public/unlisted/private/direct) - [ ] Posts use configured default visibility - [ ] Visibility can be overridden per-post via params ### Content Warnings - [ ] spoiler_text param adds CW to toot - [ ] Post content hidden behind warning on Mastodon ### Scheduled Posts - [ ] scheduled_at param creates scheduled status (not immediate post) - [ ] Scheduled status appears in Mastodon scheduled queue - [ ] Must be 5+ minutes in future ### Polls - [ ] Poll options sent when params['poll']['options'] provided - [ ] Poll expires_in configurable (default 86400 = 24h) - [ ] multiple flag enables multi-select polls - [ ] Polls mutually exclusive with media (no image + poll) ### Language Tags - [ ] language param sets post language (BCP-47 code) ### Namespace Fix - [ ] mastodon.xml namespace is Joomla\Plugin\MokoSuiteCross\Mastodon (not ${CLASS_NAME}) ## Related - #152 (implementation, closed)
jmiller reopened this issue 2026-06-23 17:20:12 +00:00
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#152