A Rails engine that enhances Mastodon conversations with custom API endpoints for the Patchwork social network platform.
This gem extends Mastodon's conversation functionality by providing specialized API endpoints for conversation management. It integrates seamlessly with the Patchwork ecosystem, offering features like conversation checking between accounts and bulk read status management.
Add this line to your application's Gemfile:
gem 'conversations', git: 'https://github.com/patchwork-hub/conversations.git'And then execute:
bundle installRun the installation generator:
rails generate conversations:install- Check Conversation: Verify if a conversation exists between the current user and a target account
- Mark All as Read: Bulk operation to mark all unread conversations as read for the current account
GET /api/v1/patchwork/conversations/check_conversation # Check conversation with target account
POST /api/v1/patchwork/conversations/read_all # Mark all conversations as read
Returns the conversation with a specified target account if one exists.
Parameters:
target_account_id(required) - The ID of the account to check conversation with
Scopes Required: read or read:statuses
Marks all unread conversations for the current account as read.
Response:
success- Boolean indicating operation successupdated_count- Number of conversations marked as readmessage- Human-readable result message
Scopes Required: write or write:conversations
The gem creates an initializer at config/initializers/prepend_conversations.rb where you can add custom configuration using Rails.application.config.to_prepare.
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/patchwork-hub/conversations. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the AGPL-3.0 License.
Everyone interacting in the Conversations project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.