about summary refs log tree commit diff
path: root/app/services/post_status_service.rb
AgeCommit message (Collapse)Author
2020-03-25Fix media not being marked sensitive when client sets a CW but no text (#13277)ThibG
Mastodon enforces the “sensitive” flag on media attachments whenever a toot is posted with a Content Warning. However, it does so *after* potentially converting the Content Warning to toot text (when there is no toot text), which leads to inconsistent and surprising behavior for API clients. This commit fixes this inconsistency.
2020-03-08Change local media attachments to perform heavy processing asynchronously ↵Eugen Rochko
(#13210) Fix #9106
2020-03-08Fix public posts from silenced accounts not being changed to unlisted ↵ThibG
visibility (#13096)
2020-03-08Add specific rate limits for posting and following (#13172)Eugen Rochko
2019-09-29Add voters count support (#11917)ThibG
* Add voters count to polls * Add ActivityPub serialization and parsing of voters count * Add support for voters count in WebUI * Move incrementation of voters count out of redis lock * Reword “voters” to “people”
2019-07-06Remove Salmon and PubSubHubbub (#11205)Eugen Rochko
* Remove Salmon and PubSubHubbub endpoints * Add error when trying to follow OStatus accounts * Fix new accounts not being created in ResolveAccountService
2019-06-19Add audio uploads (#11123)Eugen Rochko
* Add audio uploads Fix #4827 Accept uploads of OGG, WAV, FLAC, OPUS and MP3 files, and converts them to OGG. Media attachments get a new `audio` type. In the UI, audio uploads are displayed identically to video uploads. * Improve code style
2019-05-14Record account suspend/silence time and keep track of domain blocks (#10660)ThibG
* Record account suspend/silence time and keep track of domain blocks * Also unblock users who were suspended/silenced before dates were recorded * Add tests * Keep track of suspending date for users suspended through the CLI * Show accurate number of accounts that would be affected by unsuspending an instance * Change migration to set silenced_at and suspended_at * Revert "Also unblock users who were suspended/silenced before dates were recorded" This reverts commit a015c65d2d1e28c7b7cfab8b3f8cd5fb48b8b71c. * Switch from using suspended and silenced to suspended_at and silenced_at * Add post-deployment migration script to remove `suspended` and `silenced` columns * Use Account#silence! and Account#suspend! instead of updating the underlying property * Add silenced_at and suspended_at migration to post-migration * Change account fabricator to translate suspended and silenced attributes * Minor fixes * Make unblocking domains always retroactive
2019-03-28Rename :poll to :preloadable_poll and :owned_poll to :poll on Status (#10401)Eugen Rochko
Also, fix some n+1 queries Resolve #10365
2019-03-15Fix detailed poll validation errors not being returned in the API (#10261)Eugen Rochko
No more "Owned poll is invalid"
2019-03-11Support pushing and receiving updates to poll tallies (#10209)ThibG
* Process incoming poll tallies update * Send Update on poll vote * Do not send Updates for a poll more often than once every 3 minutes * Include voters in people to notify of results update * Schedule closing poll worker on poll creation * Add new notification type for ending polls * Add front-end support for ended poll notifications * Fix UpdatePollSerializer * Fix Updates not being triggered by local votes * Fix tests failure * Fix web push notifications for closing polls * Minor cleanup * Notify voters of both remote and local polls when those close * Fix delivery of poll updates to mentioned accounts and voters
2019-03-04Correctly make polls and media mutually exclusive (#10141)ThibG
2019-03-03Add polls (#10111)Eugen Rochko
* Add polls Fix #1629 * Add tests * Fixes * Change API for creating polls * Use name instead of content for votes * Remove poll validation for remote polls * Add polls to public pages * When updating the poll, update options just in case they were changed * Fix public pages showing both poll and other media
2019-02-02Create Redisable#redis (#9633)ysksn
* Create Redisable * Use #redis instead of Redis.current
2019-01-26Prevent posting toots with media attachments from someone else (#9921)ThibG
2019-01-21Fix scheduled toot with media immediately creating a toot (#9894)ThibG
* Add test for not persisting status when attaching media to scheduled toot * Prevent status used for validation from being persisted to the database Fixes #9893 Thanks to tateisu for the help investigating this.
2019-01-19Fix error when `scheduled_at` attribute is malformed (#9866)Eugen Rochko
2019-01-06Fix wrong param name in scheduled statuses and return params in API (#9725)Eugen Rochko
The database column and API param are called in_reply_to_id, not in_reply_to_status_id, so it makes no sense to encode it that way
2019-01-05Add scheduled statuses (#9706)Eugen Rochko
Fix #340
2018-12-30Avoid duplicate work by merging ReplyDistributionWorker into ↵ThibG
DistributionWorker (#9660)
2018-12-24Limit maximum visibility of local silenced users to unlisted (#9583)ThibG
Fixes #9580
2018-07-16Fix activity:interactions counter to count all interactions (#8037)Eugen Rochko
2018-07-03Fix check for PotentialFriendshipTracker when replying (#7933)Eugen Rochko
2018-07-03Re-add follow recommendations API (#7918)Eugen Rochko
* Re-add follow recommendations API GET /api/v1/suggestions Removed in 8efa081f210d72ed450c39ac4cde0fd84fb3d3fb due to Neo4J dependency. The algorithm uses triadic closures, takes into account suspensions, blocks, mutes, domain blocks, excludes locked and moved accounts, and prefers more recently updated accounts. * Track interactions with people you don't follow Replying to, favouriting and reblogging someone you're not following will make them show up in follow recommendations. The interactions have different weights: - Replying is 1 - Favouriting is 10 (decidedly positive interaction, but private) - Reblogging is 20 Following them, muting or blocking will remove them from the list, obviously. * Remove triadic closures, ensure potential friendships are trimmed
2018-06-17Allow selecting default posting language instead of auto-detect (#7828)Eugen Rochko
* Allow selecting default posting language instead of auto-detect * Enable default language setting in credentials API * Fix form saving
2018-06-15Remove placeholder text for media-only toots (#7806)Eugen Rochko
Ref: cfa9b6e13ab3c434f3901df6f614d0aa94a3d1ed This breaks compatibility with pre-2.3.0 Mastodon and older software, but at the time of writing the network is >80% above that version. Compatibility broken only for toots with no text.
2018-06-04Do not mark remote status sensitive even if spoiler text is present (#7395)Akihiko Odaki
Old statuses and statuses from Pawoo, which runs a modified version of Mastodon, may not have been marked sensitive even if spoiler text is present. Such statuses are still not marked sensitve if they are local or arrived before version upgrade. Marking recently fetched remote status sensitive contradicts the behavior. Considering what people expected when they authored such statuses, this change removes the sensitivity enforcement.
2018-05-14Call media.present? because media may be nil (#7474)abcang
2018-05-08Fix hashtags not being federated on mentions (fixes #6900) (#7406)ThibG
2018-05-07Support explicitly supplying language code for status via REST API (#7389)Eugen Rochko
2018-04-09When creating status, if no sensitive status is given, use default (#7057)Renato "Lond" Cerqueira
Clients using the API that do not provide the sensitive flag are always posting with false sensitive option.
2018-03-08For now, put a "." into no-text statuses with media for backcompat (#6691)Eugen Rochko
2018-03-07Remove text requirement when media attached from statuses (#6672)Eugen Rochko
2017-12-06Using double splat operator (#5859)Yamagishi Kazutoshi
2017-10-27Instantiate service classes for each call (fixes #5540) (#5543)ThibG
2017-09-16Fix filterable_languages method of SettingsHelper (#4966)Akihiko Odaki
2017-09-09Fix #4850 - When visibility missing from API call to toot, fallback to user ↵Eugen Rochko
preference (#4861)
2017-08-30Forward ActivityPub creates that reply to local statuses (#4709)Eugen Rochko
* Forward ActivityPub creates that reply to local statuses * Fix test * Fix wrong signers
2017-08-13ActivityPub delivery (#4566)Eugen Rochko
* Deliver ActivityPub Like * Deliver ActivityPub Undo-Like * Deliver ActivityPub Create/Announce activities * Deliver ActivityPub creates from mentions * Deliver ActivityPub Block/Undo-Block * Deliver ActivityPub Accept/Reject-Follow * Deliver ActivityPub Undo-Follow * Deliver ActivityPub Follow * Deliver ActivityPub Delete activities Incidentally fix #889 * Adjust BatchedRemoveStatusService for ActivityPub * Add tests for ActivityPub workers * Add tests for FollowService * Add tests for FavouriteService, UnfollowService and PostStatusService * Add tests for ReblogService, BlockService, UnblockService, ProcessMentionsService * Add tests for AuthorizeFollowService, RejectFollowService, RemoveStatusService * Add tests for BatchedRemoveStatusService * Deliver updates to a local account to ActivityPub followers * Minor adjustments
2017-07-14Fix #4149, fix #1199 - Store emojis as unicode (#4189)Eugen Rochko
- Use unicode when selecting emoji through picker - Convert shortcodes to unicode when storing text input server-side - Do not convert shortcodes in JS anymore
2017-05-31Misc tidying and clean ups (#3445)Matt Jankowski
* Remove trailing whitespace in i18n mailers * Use query methods instead of #present? on AR attributes * Delegate Status#account_domain method * Delegate Mention #account_username and #account_acct methods
2017-04-27OEmbed support for PreviewCard (#2337)Eugen Rochko
* OEmbed support for PreviewCard * Improve ProviderDiscovery code failure treatment * Do not crawl links if there is a content warning, since those don't display a link card anyway * Reset db schema * Fresh migrate * Fix rubocop style issues Fix #1681 - return existing access token when applicable instead of creating new * Fix test * Extract http client to helper * Improve oembed controller
2017-04-26attach_media should be in transaction of creation status (#2426)Keiji, Yoshimi
2017-04-25Fix #2402 - Add Idempotency-Key header to PostStatusService that prevents ↵Eugen Rochko
(#2419) duplicates. Web UI regenerates UUID for that header every time the compose form is changed or successfully submitted Also, fix Farsi i18n overwriting the English one
2017-04-18Language detection refactor (#2099)Matt Jankowski
* Extract detect_language to separate class * Use default locale, not just en * Add spec to confirm that whatlanguage cant identify empty string * Allow account locale to override default in language detector * PostStatusService supplies an account to detect language
2017-04-17reduce unneed query when post without attachements. (#1907)Keiji, Yoshimi
* reduce unneed query when post without attachements. This commit reduce following query: ``` MediaAttachment Load (0.9ms) SELECT "media_attachments".* FROM "media_attachments" WHERE "media_attachments"."status _id" IS NULL AND 1=0 ORDER BY id asc ``` * fixed for more simple changes.
2017-04-16Fix #1957 - WhatLanguage can return null. Fallback to 'en' (#1959)Eugen
2017-04-16Add language detection (#1772)Eugen
* Add language detection via WhatLanguage and (de)serialization of it through Atom * Fix default language in ProcessFeedService * Re-add newline before 'react-rails' Gem to fix groupings Fixes Code Climate issue
2017-04-07Use I18n for media attachment validation errorsChad Pytel
These are currently user facing errors, but are not localized. This adds the ability for these messages to be localized.
2017-02-26Add validation of media attachments, clean up mastodon-own exception classesEugen Rochko