about summary refs log tree commit diff
path: root/app/serializers/rest
AgeCommit message (Collapse)Author
2019-03-07Immediately display poll results to poll author (#10187)Eugen Rochko
* Immediately display poll results to poll author * Refactor Poll#loaded_options and add Poll#voted? to improve DRYness
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-16Add vapid_key to the application entity in the REST API (#10058)Eugen Rochko
Fix #8785
2019-02-16Add registrations attribute to instance entity in REST API (#10060)Eugen Rochko
Fix #9350
2019-02-02Make displaying application used to toot opt-in (#9897)ThibG
* Make storing and displaying application used to toot opt-in * Revert to storing application info, and display it to the author via API
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-11-19Fix filter ID not being a string in REST API (#9303)Eugen Rochko
2018-10-28Include preview cards in status entity in REST API (#9120)Eugen Rochko
* Include preview cards in status entity in REST API * Display preview card in-stream * Improve in-stream display of preview cards
2018-10-19Add unread indicator to conversations (#9009)Eugen Rochko
2018-10-17Improve support for aspects/circles (#8950)Eugen Rochko
* Add silent column to mentions * Save silent mentions in ActivityPub Create handler and optimize it Move networking calls out of the database transaction * Add "limited" visibility level masked as "private" in the API Unlike DMs, limited statuses are pushed into home feeds. The access control rules between direct and limited statuses is almost the same, except for counter and conversation logic * Ensure silent column is non-null, add spec * Ensure filters don't check silent mentions for blocks/mutes As those are "this person is also allowed to see" rather than "this person is involved", therefore does not warrant filtering * Clean up code * Use Status#active_mentions to limit returned mentions * Fix code style issues * Use Status#active_mentions in Notification And remove stream_entry eager-loading from Notification
2018-10-12Fix type of conversation ID in conversations API (#8961)Eugen Rochko
2018-10-07Add conversations API (#8832)Eugen Rochko
* Add conversations API * Add web UI for conversations * Add test for conversations API * Add tests for ConversationAccount * Improve web UI * Rename ConversationAccount to AccountConversation * Remove conversations on block and mute * Change last_status_id to be a denormalization of status_ids * Add optimistic locking
2018-10-04Fix link verification for remote accounts (#8868)Eugen Rochko
2018-09-18Redesign forms, verify link ownership with rel="me" (#8703)Eugen Rochko
* Verify link ownership with rel="me" * Add explanation about verification to UI * Perform link verifications * Add click-to-copy widget for verification HTML * Redesign edit profile page * Redesign forms * Improve responsive design of settings pages * Restore landing page sign-up form * Fix typo * Support <link> tags, add spec * Fix links not being verified on first discovery and passive updates
2018-08-14Move status counters to separate table, count replies (#8104)Eugen Rochko
* Move status counters to separate table, count replies * Migration to remove old counter columns from statuses table * Fix schema file
2018-08-09Public profile endorsements (accounts picked by profile owner) (#8146)Eugen Rochko
2018-07-09Add option to not consider word boundaries when processing keyword filtering ↵ThibG
(#7975) * Add option to not consider word boundaries when filtering phrases * Add a few tests for keyword/phrase filtering
2018-07-07Fix missing irreversible in filters API, expires_in param (#7976)Eugen Rochko
2018-06-29Keyword/phrase filtering (#7905)Eugen Rochko
* Add keyword filtering GET|POST /api/v1/filters GET|PUT|DELETE /api/v1/filters/:id - Irreversible filters can drop toots from home or notifications - Other filters can hide toots through the client app - Filters use a phrase valid in particular contexts, expiration * Make sure expired filters don't get applied client-side * Add missing API methods * Remove "regex filter" from column settings * Add tests * Add test for FeedManager * Add CustomFilter test * Add UI for managing filters * Add streaming API event to allow syncing filters * Fix tests
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-16Do not pre-emojify note HTML in accounts REST API (#7821)Eugen Rochko
Fix #7820
2018-05-29Add GET /api/v2/search which returns rich tag objects, adjust web UI (#7661)Eugen Rochko
2018-05-27Track trending tags (#7638)Eugen Rochko
* Track trending tags - Half-life of 1 day - Historical usage in daily buckets (last 7 days stored) - GET /api/v1/trends Fix #271 * Add trends to web UI * Don't render compose form on search route, adjust search results header * Disqualify tag from trends if it's in disallowed hashtags setting * Count distinct accounts using tag, ignore silenced accounts
2018-05-11Add REST API for Web Push Notifications subscriptions (#7445)Eugen Rochko
- POST /api/v1/push/subscription - PUT /api/v1/push/subscription - DELETE /api/v1/push/subscription - New OAuth scope: "push" (required for the above methods)
2018-05-07Bot nameplates (#7391)Eugen Rochko
* Store actor type in database * Add bot nameplate to web UI, add setting to preferences, API, AP Fix #7365 * Fix code style issues
2018-05-06Enable custom emojis in profiles (notes, field values, display names) (#7374)Eugen Rochko
Follow-up to #6124
2018-05-02Allow updating bio fields via PUT /api/v1/accounts/update_credentials (#7288)Eugen Rochko
Add raw bio fields to the source attribute on GET /api/v1/accounts/verify_credentials
2018-04-14Add bio fields (#6645)Eugen Rochko
* Add bio fields - Fix #3211 - Fix #232 - Fix #121 * Display bio fields in web UI * Fix output of links and missing fields * Federate bio fields over ActivityPub as PropertyValue * Improve how the fields are stored, add to Edit profile form * Add rel=me to links in fields Fix #121
2018-04-01[WIP] Enable custom emoji on account pages and in the sidebar (#6124)David Underwood
Federate custom emojis with accounts
2018-03-22Do not re-query mentions from serializers (#6858)Eugen Rochko
Fix performance regression from #6836
2018-03-19Serialize mentions in the order they are added (#6836)ThibG
Up until now, the order seemed to be in the *opposite* order, which caused the WebUI to populate mentions in reversed order when replying to toots local to one's instance.
2018-03-04Do not fetch environment variables to determine default locale (#6618)Akihiko Odaki
The default locale is now set by config.
2018-03-01Add contact_account and languages to instance API (#6574)Eugen Rochko
2018-01-04Fallback default thumbnail in instance status API (#6177)Yamagishi Kazutoshi
2017-12-14Fix #6022 - Prevent nested migrated accounts, or migrations to self (#6026)Eugen Rochko
2017-12-07Add embed_url to preview cards (#5775)Akihiko Odaki
2017-12-06Break out nested relationship API keys (#5887)aschmitz
* Break out nested relationship API keys This closes #5856 by restoring the existing behavior of the `muting` and `following` keys (returning booleans rather than truthy or false). It adds `showing_reblogs` and `muting_notifications` keys: * `showing_reblogs` returns true if: 1. You've requested to follow the user, with reblogs shown, or 2. You are following the user, with reblogs shown. * `muting_notifications` returns true if you have muted the user and their notifications as well. * Rubocop fix * Fix pulling reblog/mute status from relationships I could swear this had passed tests before, but apparently not. Works now. * More test fixes Really, you'd expect this to be more straightforward.
2017-11-25Display list column (#5750)Eugen Rochko
2017-11-18Profile redirect notes (#5746)Eugen Rochko
* Serialize moved accounts into REST and ActivityPub APIs * Parse federated moved accounts from ActivityPub * Add note about moved accounts to public profiles * Add moved account message to web UI * Fix code style issues
2017-11-18Lists (#5703)Eugen Rochko
* Add structure for lists * Add list timeline streaming API * Add list APIs, bind list-account relation to follow relation * Add API for adding/removing accounts from lists * Add pagination to lists API * Add pagination to list accounts API * Adjust scopes for new APIs - Creating and modifying lists merely requires "write" scope - Fetching information about lists merely requires "read" scope * Add test for wrong user context on list timeline * Clean up tests
2017-10-27Feature: Unlisted custom emojis (#5485)nullkal
2017-10-07In REST API, when URL can be missing, cast it to nil (#5259)Eugen Rochko
2017-10-05When processing custom emoji, ensure a non-animated version exists (#5230)Eugen Rochko
Use the non-animated version in web UI, but return both in API
2017-09-28Add ability to specify alternative text for media attachments (#5123)Eugen Rochko
* Fix #117 - Add ability to specify alternative text for media attachments - POST /api/v1/media accepts `description` straight away - PUT /api/v1/media/:id to update `description` (only for unattached ones) - Serialized as `name` of Document object in ActivityPub - Uploads form adjusted for better performance and description input * Add tests * Change undo button blend mode to difference
2017-09-24Make sure nil IDs to not get cast to empty string in REST API (#5068)Eugen Rochko
2017-09-23New API: GET /api/v1/custom_emojis to get a server's custom emojis (#5051)Eugen Rochko
2017-09-20Change IDs to strings rather than numbers in API JSON output (#5019)aschmitz
* Fix JavaScript interface with long IDs Somewhat predictably, the JS interface handled IDs as numbers, which in JS are IEEE double-precision floats. This loses some precision when working with numbers as large as those generated by the new ID scheme, so we instead handle them here as strings. This is relatively simple, and doesn't appear to have caused any problems, but should definitely be tested more thoroughly than the built-in tests. Several days of use appear to support this working properly. BREAKING CHANGE: The major(!) change here is that IDs are now returned as strings by the REST endpoints, rather than as integers. In practice, relatively few changes were required to make the existing JS UI work with this change, but it will likely hit API clients pretty hard: it's an entirely different type to consume. (The one API client I tested, Tusky, handles this with no problems, however.) Twitter ran into this issue when introducing Snowflake IDs, and decided to instead introduce an `id_str` field in JSON responses. I have opted to *not* do that, and instead force all IDs to 64-bit integers represented by strings in one go. (I believe Twitter exacerbated their problem by rolling out the changes three times: once for statuses, once for DMs, and once for user IDs, as well as by leaving an integer ID value in JSON. As they said, "If you’re using the `id` field with JSON in a Javascript-related language, there is a very high likelihood that the integers will be silently munged by Javascript interpreters. In most cases, this will result in behavior such as being unable to load or delete a specific direct message, because the ID you're sending to the API is different than the actual identifier associated with the message." [1]) However, given that this is a significant change for API users, alternatives or a transition time may be appropriate. 1: https://blog.twitter.com/developer/en_us/a/2011/direct-messages-going-snowflake-on-sep-30-2011.html * Additional fixes for stringified IDs in JSON These should be the last two. These were identified using eslint to try to identify any plain casts to JavaScript numbers. (Some such casts are legitimate, but these were not.) Adding the following to .eslintrc.yml will identify casts to numbers: ~~~ no-restricted-syntax: - warn - selector: UnaryExpression[operator='+'] > :not(Literal) message: Avoid the use of unary + - selector: CallExpression[callee.name='Number'] message: Casting with Number() may coerce string IDs to numbers ~~~ The remaining three casts appear legitimate: two casts to array indices, one in a server to turn an environment variable into a number. * Back out RelationshipsController Change This was made to make a test a bit less flakey, but has nothing to do with this branch. * Change internal streaming payloads to stringified IDs as well Per https://github.com/tootsuite/mastodon/pull/5019#issuecomment-330736452 we need these changes to send deleted status IDs as strings, not integers.
2017-09-19Introduce OStatus::TagManager (#5008)Akihiko Odaki
2017-09-19Custom emoji (#4988)Eugen Rochko
* Custom emoji - In OStatus: `<link rel="emoji" name="coolcat" href="http://..." />` - In ActivityPub: `{ type: "Emoji", name: ":coolcat:", href: "http://..." }` - In REST API: Status object includes `emojis` array (`shortcode`, `url`) - Domain blocks with reject media stop emojis - Emoji file up to 50KB - Web UI handles custom emojis - Static pages render custom emojis as `<img />` tags Side effects: - Undo #4500 optimization, as I needed to modify it to restore shortcode handling in emojify() - Formatter#plaintext should now make sure stripped out line-breaks and paragraphs are replaced with newlines * Fix emoji at the start not being converted