diff --git a/.gitignore b/.gitignore index 774893b35..a1e79e4be 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ /db /deps /*.ez -/uploads /test/uploads /.elixir_ls /test/fixtures/test_tmp.txt diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..67b9649e1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,112 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). + +## [unreleased] +### Added +- LDAP authentication +- External OAuth provider authentication +- A [job queue](https://git.pleroma.social/pleroma/pleroma_job_queue) for federation, emails, web push, etc. +- [Prometheus](https://prometheus.io/) metrics +- Support for Mastodon's remote interaction +- Mix Tasks: `mix pleroma.database remove_embedded_objects` +- Federation: Support for reports +- Configuration: `safe_dm_mentions` option +- Configuration: `link_name` option +- Configuration: `fetch_initial_posts` option +- Configuration: `notify_email` option +- Configuration: Media proxy `whitelist` option +- Pleroma API: User subscriptions +- Pleroma API: Healthcheck endpoint +- Admin API: Endpoints for listing/revoking invite tokens +- Admin API: Endpoints for making users follow/unfollow each other +- Mastodon API: [Scheduled statuses](https://docs.joinmastodon.org/api/rest/scheduled-statuses/) +- Mastodon API: `/api/v1/notifications/destroy_multiple` (glitch-soc extension) +- Mastodon API: `/api/v1/pleroma/accounts/:id/favourites` (API extension) +- Mastodon API: [Reports](https://docs.joinmastodon.org/api/rest/reports/) +- ActivityPub C2S: OAuth endpoints +- Metadata RelMe provider +- Emoji packs and emoji pack manager + +### Changed +- **Breaking:** Configuration: move from Pleroma.Mailer to Pleroma.Emails.Mailer +- Enforcement of OAuth scopes +- Add multiple use/time expiring invite token +- Restyled OAuth pages to fit with Pleroma's default theme +- Link/mention/hashtag detection is now handled by [auto_linker](https://git.pleroma.social/pleroma/auto_linker) +- NodeInfo: Return `safe_dm_mentions` feature flag +- Federation: Expand the audience of delete activities to all recipients of the deleted object +- Federation: Removed `inReplyToStatusId` from objects +- Configuration: Dedupe enabled by default +- Configuration: Added `extra_cookie_attrs` for setting non-standard cookie attributes. Defaults to ["SameSite=Lax"] so that remote follows work. +- Pleroma API: Support for emoji tags in `/api/pleroma/emoji` resulting in a breaking API change +- Timelines: Messages involving people you have blocked will be excluded from the timeline in all cases instead of just repeats. +- Mastodon API: Support for `exclude_types`, `limit` and `min_id` in `/api/v1/notifications` +- Mastodon API: Add `languages` and `registrations` to `/api/v1/instance` +- Mastodon API: Provide plaintext versions of cw/content in the Status entity +- Mastodon API: Add `pleroma.conversation_id`, `pleroma.in_reply_to_account_acct` fields to the Status entity +- Mastodon API: Add `pleroma.tags`, `pleroma.relationship{}`, `pleroma.is_moderator`, `pleroma.is_admin`, `pleroma.confirmation_pending`, `pleroma.hide_followers`, `pleroma.hide_follows`, `pleroma.hide_favorites` fields to the User entity +- Mastodon API: Add `pleroma.show_role`, `pleroma.no_rich_text` fields to the Source subentity +- Mastodon API: Add support for updating `no_rich_text`, `hide_followers`, `hide_follows`, `hide_favorites`, `show_role` in `PATCH /api/v1/update_credentials` +- Mastodon API: Add `pleroma.is_seen` to the Notification entity +- Mastodon API: Add `pleroma.local` to the Status entity +- Mastodon API: Add `preview` parameter to `POST /api/v1/statuses` +- Mastodon API: Add `with_muted` parameter to timeline endpoints +- Mastodon API: Actual reblog hiding instead of a dummy +- Mastodon API: Remove attachment limit in the Status entity +- Deps: Updated Cowboy to 2.6 +- Deps: Updated Ecto to 3.0.7 +- Don't ship finmoji by default, they can be installed as an emoji pack +- Mastodon API: Added support max_id & since_id for bookmark timeline endpoints. + +### Fixed +- Followers counter not being updated when a follower is blocked +- Deactivated users being able to request an access token +- Limit on request body in rich media/relme parsers being ignored resulting in a possible memory leak +- proper Twitter Card generation instead of a dummy +- NodeInfo: Include admins in `staffAccounts` +- ActivityPub: Crashing when requesting empty local user's outbox +- Federation: Handling of objects without `summary` property +- Federation: Add a language tag to activities as required by ActivityStreams 2.0 +- Federation: Do not federate avatar/banner if set to default allowing other servers/clients to use their defaults +- Federation: Cope with missing or explicitly nulled address lists +- Federation: Explicitly ensure activities addressed to `as:Public` become addressed to the followers collection +- Federation: Better cope with actors which do not declare a followers collection and use `as:Public` with these semantics +- Federation: Follow requests from remote users who have been blocked will be automatically rejected if appropriate +- MediaProxy: Parse name from content disposition headers even for non-whitelisted types +- MediaProxy: S3 link encoding +- Rich Media: Reject any data which cannot be explicitly encoded into JSON +- Pleroma API: Importing follows from Mastodon 2.8+ +- Twitter API: Exposing default scope, `no_rich_text` of the user to anyone +- Twitter API: Returning the `role` object in user entity despite `show_role = false` +- Mastodon API: `/api/v1/favourites` serving only public activities +- Mastodon API: Reblogs having `in_reply_to_id` - `null` even when they are replies +- Mastodon API: Streaming API broadcasting wrong activity id +- Mastodon API: 500 errors when requesting a card for a private conversation +- Mastodon API: Handling of `reblogs` in `/api/v1/accounts/:id/follow` +- Mastodon API: Correct `reblogged`, `favourited`, and `bookmarked` values in the reblog status JSON +- Mastodon API: Exposing default scope of the user to anyone + +## [0.9.9999] - 2019-04-05 +### Security +- Mastodon API: Fix content warnings skipping HTML sanitization + +## [0.9.999] - 2019-03-13 +Frontend changes only. +### Added +- Added floating action button for posting status on mobile +### Changed +- Changed user-settings icon to a pencil +### Fixed +- Keyboard shortcuts activating when typing a message +- Gaps when scrolling down on a timeline after showing new + +## [0.9.99] - 2019-03-08 +### Changed +- Update the frontend to the 0.9.99 tag +### Fixed +- Sign the date header in federation to fix Mastodon federation. + +## [0.9.9] - 2019-02-22 +This is our first stable release. diff --git a/COPYING b/COPYING index ceec519ae..eceb68efe 100644 --- a/COPYING +++ b/COPYING @@ -39,10 +39,3 @@ does not include the right to compile photos from Unsplash to replicate a similar or competing service. priv/static/images/city.jpg - ---- - -The files present under the priv/static/finmoji directory are copyright -Finland , and are distributed under the Creative -Commons Attribution-NonCommercial-NoDerivatives 4.0 International license, you -should have received a copy of the license file as CC-BY-NC-ND-4.0. diff --git a/README.md b/README.md index c45190fc3..987f973ea 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Pleroma -**Note**: This readme as well as complete documentation is also availible at +**Note**: This readme as well as complete documentation is also available at ## About Pleroma diff --git a/config/config.exs b/config/config.exs index 3462a37f7..1a9738cff 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,3 +1,41 @@ +# .i;;;;i. +# iYcviii;vXY: +# .YXi .i1c. +# .YC. . in7. +# .vc. ...... ;1c. +# i7, .. .;1; +# i7, .. ... .Y1i +# ,7v .6MMM@; .YX, +# .7;. ..IMMMMMM1 :t7. +# .;Y. ;$MMMMMM9. :tc. +# vY. .. .nMMM@MMU. ;1v. +# i7i ... .#MM@M@C. .....:71i +# it: .... $MMM@9;.,i;;;i,;tti +# :t7. ..... 0MMMWv.,iii:::,,;St. +# .nC. ..... IMMMQ..,::::::,.,czX. +# .ct: ....... .ZMMMI..,:::::::,,:76Y. +# c2: ......,i..Y$M@t..:::::::,,..inZY +# vov ......:ii..c$MBc..,,,,,,,,,,..iI9i +# i9Y ......iii:..7@MA,..,,,,,,,,,....;AA: +# iIS. ......:ii::..;@MI....,............;Ez. +# .I9. ......:i::::...8M1..................C0z. +# .z9; ......:i::::,.. .i:...................zWX. +# vbv ......,i::::,,. ................. :AQY +# c6Y. .,...,::::,,..:t0@@QY. ................ :8bi +# :6S. ..,,...,:::,,,..EMMMMMMI. ............... .;bZ, +# :6o, .,,,,..:::,,,..i#MMMMMM#v................. YW2. +# .n8i ..,,,,,,,::,,,,.. tMMMMM@C:.................. .1Wn +# 7Uc. .:::,,,,,::,,,,.. i1t;,..................... .UEi +# 7C...::::::::::::,,,,.. .................... vSi. +# ;1;...,,::::::,......... .................. Yz: +# v97,......... .voC. +# izAotX7777777777777777777777777777777777777777Y7n92: +# .;CoIIIIIUAA666666699999ZZZZZZZZZZZZZZZZZZZZ6ov. +# +# !!! ATTENTION !!! +# DO NOT EDIT THIS FILE! THIS FILE CONTAINS THE DEFAULT VALUES FOR THE CON- +# FIGURATION! EDIT YOUR SECRET FILE (either prod.secret.exs, dev.secret.exs). +# # This file is responsible for configuring your application # and its dependencies with the aid of the Mix.Config module. # @@ -62,9 +100,9 @@ shortcode_globs: ["/emoji/custom/**/*.png"], groups: [ # Put groups that have higher priority than defaults here. Example in `docs/config/custom_emoji.md` - Finmoji: "/finmoji/128px/*-128.png", - Custom: ["/emoji/*.png", "/emoji/custom/*.png"] - ] + Custom: ["/emoji/*.png", "/emoji/**/*.png"] + ], + default_manifest: "https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json" config :pleroma, :uri_schemes, valid_schemes: [ @@ -116,7 +154,10 @@ signing_salt: "CqaoopA2", render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)], pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2], - secure_cookie_flag: true + secure_cookie_flag: true, + extra_cookie_attrs: [ + "SameSite=Lax" + ] # Configures Elixir's Logger config :logger, :console, @@ -160,6 +201,7 @@ config :pleroma, :instance, name: "Pleroma", email: "example@example.com", + notify_email: "noreply@example.com", description: "A Pleroma instance, an alternative fediverse server", limit: 5_000, remote_limit: 100_000, @@ -179,9 +221,9 @@ allowed_post_formats: [ "text/plain", "text/html", - "text/markdown" + "text/markdown", + "text/bbcode" ], - finmoji_enabled: true, mrf_transparency: true, autofollowed_nicknames: [], max_pinned_statuses: 1, @@ -189,7 +231,8 @@ welcome_user_nickname: nil, welcome_message: nil, max_report_comment_size: 1000, - safe_dm_mentions: false + safe_dm_mentions: false, + healthcheck: false config :pleroma, :markup, # XXX - unfortunately, inline images must be enabled by default right now, because @@ -284,7 +327,8 @@ follow_redirect: true, pool: :media ] - ] + ], + whitelist: [] config :pleroma, :chat, enabled: true @@ -295,7 +339,9 @@ ip: {0, 0, 0, 0}, port: 9999 -config :pleroma, Pleroma.Web.Metadata, providers: [], unfurl_nsfw: false +config :pleroma, Pleroma.Web.Metadata, + providers: [Pleroma.Web.Metadata.Providers.RelMe], + unfurl_nsfw: false config :pleroma, :suggestions, enabled: false, @@ -413,7 +459,7 @@ config :pleroma, :auth, oauth_consumer_strategies: oauth_consumer_strategies -config :pleroma, Pleroma.Mailer, adapter: Swoosh.Adapters.Sendmail +config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics" diff --git a/config/dev.exs b/config/dev.exs index a7eb4b644..0432adce7 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -18,7 +18,7 @@ watchers: [], secure_cookie_flag: false -config :pleroma, Pleroma.Mailer, adapter: Swoosh.Adapters.Local +config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Local # ## SSL Support # diff --git a/config/test.exs b/config/test.exs index 894fa8d3d..f93bc5994 100644 --- a/config/test.exs +++ b/config/test.exs @@ -21,7 +21,11 @@ config :pleroma, Pleroma.Uploaders.Local, uploads: "test/uploads" -config :pleroma, Pleroma.Mailer, adapter: Swoosh.Adapters.Test +config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Test + +config :pleroma, :instance, + email: "admin@example.com", + notify_email: "noreply@example.com" # Configure your database config :pleroma, Pleroma.Repo, diff --git a/docs/api/differences_in_mastoapi_responses.md b/docs/api/differences_in_mastoapi_responses.md index 923d94db2..1350ace43 100644 --- a/docs/api/differences_in_mastoapi_responses.md +++ b/docs/api/differences_in_mastoapi_responses.md @@ -20,6 +20,7 @@ Has these additional fields under the `pleroma` object: - `local`: true if the post was made on the local instance. - `conversation_id`: the ID of the conversation the status is associated with (if any) +- `in_reply_to_account_acct`: the `acct` property of User entity for replied user (if any) - `content`: a map consisting of alternate representations of the `content` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain` - `spoiler_text`: a map consisting of alternate representations of the `spoiler_text` property with the key being it's mimetype. Currently the only alternate representation supported is `text/plain` @@ -37,9 +38,24 @@ Has these additional fields under the `pleroma` object: - `tags`: Lists an array of tags for the user - `relationship{}`: Includes fields as documented for Mastodon API https://docs.joinmastodon.org/api/entities/#relationship -- `is_moderator`: boolean, true if user is a moderator -- `is_admin`: boolean, true if user is an admin +- `is_moderator`: boolean, nullable, true if user is a moderator +- `is_admin`: boolean, nullable, true if user is an admin - `confirmation_pending`: boolean, true if a new user account is waiting on email confirmation to be activated +- `hide_followers`: boolean, true when the user has follower hiding enabled +- `hide_follows`: boolean, true when the user has follow hiding enabled + +### Source + +Has these additional fields under the `pleroma` object: + +- `show_role`: boolean, nullable, true when the user wants his role (e.g admin, moderator) to be shown +- `no_rich_text` - boolean, nullable, true when html tags are stripped from all statuses requested from the API + +## Account Search + +Behavior has changed: + +- `/api/v1/accounts/search`: Does not require authentication ## Notifications @@ -52,3 +68,15 @@ Has these additional fields under the `pleroma` object: Additional parameters can be added to the JSON body/Form data: - `preview`: boolean, if set to `true` the post won't be actually posted, but the status entitiy would still be rendered back. This could be useful for previewing rich text/custom emoji, for example. +- `content_type`: string, contain the MIME type of the status, it is transformed into HTML by the backend. You can get the list of the supported MIME types with the nodeinfo endpoint. + +## PATCH `/api/v1/update_credentials` + +Additional parameters can be added to the JSON body/Form data: + +- `no_rich_text` - if true, html tags are stripped from all statuses requested from the API +- `hide_followers` - if true, user's followers will be hidden +- `hide_follows` - if true, user's follows will be hidden +- `hide_favorites` - if true, user's favorites timeline will be hidden +- `show_role` - if true, user's role (e.g admin, moderator) will be exposed to anyone in the API +- `default_scope` - the scope returned under `privacy` key in Source subentity diff --git a/docs/api/pleroma_api.md b/docs/api/pleroma_api.md index dbe250300..190846de9 100644 --- a/docs/api/pleroma_api.md +++ b/docs/api/pleroma_api.md @@ -77,7 +77,7 @@ Request parameters can be passed via [query strings](https://en.wikipedia.org/wi * `token`: invite token required when the registrations aren't public. * Response: JSON. Returns a user object on success, otherwise returns `{"error": "error_msg"}` * Example response: -``` +```json { "background_image": null, "cover_photo": "https://pleroma.soykaf.com/images/banner.png", @@ -187,6 +187,62 @@ See [Admin-API](Admin-API.md) } ``` +## `/api/v1/pleroma/accounts/:id/favourites` +### Returns favorites timeline of any user +* Method `GET` +* Authentication: not required +* Params: + * `id`: the id of the account for whom to return results + * `limit`: optional, the number of records to retrieve + * `since_id`: optional, returns results that are more recent than the specified id + * `max_id`: optional, returns results that are older than the specified id +* Response: JSON, returns a list of Mastodon Status entities on success, otherwise returns `{"error": "error_msg"}` +* Example response: +```json +[ + { + "account": { + "id": "9hptFmUF3ztxYh3Svg", + "url": "https://pleroma.example.org/users/nick2", + "username": "nick2", + ... + }, + "application": {"name": "Web", "website": null}, + "bookmarked": false, + "card": null, + "content": "This is :moominmamma: note 0", + "created_at": "2019-04-15T15:42:15.000Z", + "emojis": [], + "favourited": false, + "favourites_count": 1, + "id": "9hptFmVJ02khbzYJaS", + "in_reply_to_account_id": null, + "in_reply_to_id": null, + "language": null, + "media_attachments": [], + "mentions": [], + "muted": false, + "pinned": false, + "pleroma": { + "content": {"text/plain": "This is :moominmamma: note 0"}, + "conversation_id": 13679, + "local": true, + "spoiler_text": {"text/plain": "2hu"} + }, + "reblog": null, + "reblogged": false, + "reblogs_count": 0, + "replies_count": 0, + "sensitive": false, + "spoiler_text": "2hu", + "tags": [{"name": "2hu", "url": "/tag/2hu"}], + "uri": "https://pleroma.example.org/objects/198ed2a1-7912-4482-b559-244a0369e984", + "url": "https://pleroma.example.org/notice/9hptFmVJ02khbzYJaS", + "visibility": "public" + } +] +``` + ## `/api/pleroma/notification_settings` ### Updates user notification settings * Method `PUT` @@ -197,3 +253,20 @@ See [Admin-API](Admin-API.md) * `remote`: BOOLEAN field, receives notifications from people on remote instances * `local`: BOOLEAN field, receives notifications from people on the local instance * Response: JSON. Returns `{"status": "success"}` if the update was successful, otherwise returns `{"error": "error_msg"}` + +## `/api/pleroma/healthcheck` +### Healthcheck endpoint with additional system data. +* Method `GET` +* Authentication: not required +* Params: none +* Response: JSON, statuses (200 - healthy, 503 unhealthy). +* Example response: +```json +{ + "pool_size": 0, # database connection pool + "active": 0, # active processes + "idle": 0, # idle processes + "memory_used": 0.00, # Memory used + "healthy": true # Instance state +} +``` diff --git a/docs/config.md b/docs/config.md index b5ea58746..7e31e6fb7 100644 --- a/docs/config.md +++ b/docs/config.md @@ -31,14 +31,14 @@ This filter replaces the filename (not the path) of an upload. For complete obfu * `text`: Text to replace filenames in links. If empty, `{random}.extension` will be used. -## Pleroma.Mailer +## Pleroma.Emails.Mailer * `adapter`: one of the mail adapters listed in [Swoosh readme](https://github.com/swoosh/swoosh#adapters), or `Swoosh.Adapters.Local` for in-memory mailbox. * `api_key` / `password` and / or other adapter-specific settings, per the above documentation. An example for Sendgrid adapter: ```exs -config :pleroma, Pleroma.Mailer, +config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendgrid, api_key: "YOUR_API_KEY" ``` @@ -46,7 +46,7 @@ config :pleroma, Pleroma.Mailer, An example for SMTP adapter: ```exs -config :pleroma, Pleroma.Mailer, +config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.SMTP, relay: "smtp.gmail.com", username: "YOUR_USERNAME@gmail.com", @@ -63,6 +63,7 @@ config :pleroma, Pleroma.Mailer, ## :instance * `name`: The instance’s name * `email`: Email used to reach an Administrator/Moderator of the instance +* `notify_email`: Email used for notifications. * `description`: The instance’s description, can be seen in nodeinfo and ``/api/v1/instance`` * `limit`: Posts character limit (CW/Subject included in the counter) * `remote_limit`: Hard character limit beyond which remote posts will be dropped. @@ -86,7 +87,6 @@ config :pleroma, Pleroma.Mailer, * `quarantined_instances`: List of ActivityPub instances where private(DMs, followers-only) activities will not be send. * `managed_config`: Whenether the config for pleroma-fe is configured in this config or in ``static/config.json`` * `allowed_post_formats`: MIME-type list of formats allowed to be posted (transformed into HTML) -* `finmoji_enabled`: Whenether to enable the finmojis in the custom emojis. * `mrf_transparency`: Make the content of your Message Rewrite Facility settings public (via nodeinfo). * `scope_copy`: Copy the scope (private/unlisted/public) in replies to posts by default. * `subject_line_behavior`: Allows changing the default behaviour of subject lines in replies. Valid values: @@ -103,6 +103,7 @@ config :pleroma, Pleroma.Mailer, * `welcome_user_nickname`: The nickname of the local user that sends the welcome message. * `max_report_comment_size`: The maximum size of the report comment (Default: `1000`) * `safe_dm_mentions`: If set to true, only mentions at the beginning of a post will be used to address people in direct messages. This is to prevent accidental mentioning of people when talking about them (e.g. "@friend hey i really don't like @enemy"). (Default: `false`) +* `healthcheck`: if set to true, system data will be shown on ``/api/pleroma/healthcheck``. ## :logger * `backends`: `:console` is used to send logs to stdout, `{ExSyslogger, :ex_syslogger}` to log to syslog, and `Quack.Logger` to log to Slack @@ -204,6 +205,7 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i * `enabled`: Enables proxying of remote media to the instance’s proxy * `base_url`: The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host/CDN fronts. * `proxy_opts`: All options defined in `Pleroma.ReverseProxy` documentation, defaults to `[max_body_length: (25*1_048_576)]`. +* `whitelist`: List of domains to bypass the mediaproxy ## :gopher * `enabled`: Enables the gopher interface @@ -221,6 +223,8 @@ This section is used to configure Pleroma-FE, unless ``:managed_config`` in ``:i - `scheme` - e.g `http`, `https` - `port` - `path` +* `extra_cookie_attrs` - a list of `Key=Value` strings to be added as non-standard cookie attributes. Defaults to `["SameSite=Lax"]`. See the [SameSite article](https://www.owasp.org/index.php/SameSite) on OWASP for more info. + **Important note**: if you modify anything inside these lists, default `config.exs` values will be overwritten, which may result in breakage, to make sure this does not happen please copy the default value for the list from `config.exs` and modify/add only what you need @@ -317,7 +321,7 @@ Pleroma has the following queues: * `federator_outgoing` - Outgoing federation * `federator_incoming` - Incoming federation -* `mailer` - Email sender, see [`Pleroma.Mailer`](#pleroma-mailer) +* `mailer` - Email sender, see [`Pleroma.Emails.Mailer`](#pleroma-emails-mailer) * `transmogrifier` - Transmogrifier * `web_push` - Web push notifications * `scheduled_activities` - Scheduled activities, see [`Pleroma.ScheduledActivities`](#pleromascheduledactivity) @@ -340,9 +344,10 @@ This config contains two queues: `federator_incoming` and `federator_outgoing`. * `max_retries`: The maximum number of times a federation job is retried ## Pleroma.Web.Metadata -* `providers`: a list of metadata providers to enable. Providers availible: +* `providers`: a list of metadata providers to enable. Providers available: * Pleroma.Web.Metadata.Providers.OpenGraph * Pleroma.Web.Metadata.Providers.TwitterCard + * Pleroma.Web.Metadata.Providers.RelMe - add links from user bio with rel=me into the `
` as `` * `unfurl_nsfw`: If set to `true` nsfw attachments will be shown in previews ## :rich_media @@ -427,7 +432,7 @@ Pleroma account will be created with the same name as the LDAP user name. Authentication / authorization settings. -* `auth_template`: authentication form template. By default it's `show.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/show.html.eex`. +* `auth_template`: authentication form template. By default it's `show.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/show.html.eex`. * `oauth_consumer_template`: OAuth consumer mode authentication form template. By default it's `consumer.html` which corresponds to `lib/pleroma/web/templates/o_auth/o_auth/consumer.html.eex`. * `oauth_consumer_strategies`: the list of enabled OAuth consumer strategies; by default it's set by OAUTH_CONSUMER_STRATEGIES environment variable. @@ -440,7 +445,9 @@ Note: each strategy is shipped as a separate dependency; in order to get the str e.g. `OAUTH_CONSUMER_STRATEGIES="twitter facebook google microsoft" mix deps.get`. The server should also be started with `OAUTH_CONSUMER_STRATEGIES="..." mix phx.server` in case you enable any strategies. -Note: each strategy requires separate setup (on external provider side and Pleroma side). Below are the guidelines on setting up most popular strategies. +Note: each strategy requires separate setup (on external provider side and Pleroma side). Below are the guidelines on setting up most popular strategies. + +Note: make sure that `"SameSite=Lax"` is set in `extra_cookie_attrs` when you have this feature enabled. OAuth consumer mode will not work with `"SameSite=Strict"` * For Twitter, [register an app](https://developer.twitter.com/en/apps), configure callback URL to https:///oauth/twitter/callback @@ -475,9 +482,14 @@ config :ueberauth, Ueberauth.Strategy.Google.OAuth, config :ueberauth, Ueberauth.Strategy.Microsoft.OAuth, client_id: System.get_env("MICROSOFT_CLIENT_ID"), client_secret: System.get_env("MICROSOFT_CLIENT_SECRET") - + config :ueberauth, Ueberauth, providers: [ microsoft: {Ueberauth.Strategy.Microsoft, [callback_params: []]} ] ``` + +## :emoji +* `shortcode_globs`: Location of custom emoji files. `*` can be used as a wildcard. Example `["/emoji/custom/**/*.png"]` +* `groups`: Emojis are ordered in groups (tags). This is an array of key-value pairs where the key is the groupname and the value the location or array of locations. `*` can be used as a wildcard. Example `[Custom: ["/emoji/*.png", "/emoji/custom/*.png"]]` +* `default_manifest`: Location of the JSON-manifest. This manifest contains information about the emoji-packs you can download. Currently only one manifest can be added (no arrays). diff --git a/docs/config/custom_emoji.md b/docs/config/custom_emoji.md index 419a7d0e2..f72c0edbc 100644 --- a/docs/config/custom_emoji.md +++ b/docs/config/custom_emoji.md @@ -1,15 +1,25 @@ # Custom Emoji +Before you add your own custom emoji, check if they are available in an existing pack. +See `Mix.Tasks.Pleroma.Emoji` for information about emoji packs. + To add custom emoji: -* Add the image file(s) to `priv/static/emoji/custom` -* In case of conflicts: add the desired shortcode with the path to `config/custom_emoji.txt`, comma-separated and one per line -* Force recompilation (``mix clean && mix compile``) +* Create the `STATIC-DIR/emoji/` directory if it doesn't exist + (`STATIC-DIR` is configurable, `instance/static/` by default) +* Create a directory with whatever name you want (custom is a good name to show the purpose of it). + This will create a local emoji pack. +* Put your `.png` emoji files in that directory. In case of conflicts, you can create an `emoji.txt` + file in that directory and specify a custom shortcode using the following format: + `shortcode, file-path, tag1, tag2, etc`. One emoji per line. Note that if you do so, + you'll have to list all other emojis in the pack too. +* Either restart pleroma or connect to the iex session pleroma's running and + run `Pleroma.Emoji.reload/0` in it. Example: -image files (in `/priv/static/emoji/custom`): `happy.png` and `sad.png` +image files (in `instance/static/emoji/custom`): `happy.png` and `sad.png` -content of `config/custom_emoji.txt`: +content of `emoji.txt`: ``` happy, /emoji/custom/happy.png, Tag1,Tag2 sad, /emoji/custom/sad.png, Tag1 @@ -18,9 +28,14 @@ foo, /emoji/custom/foo.png The files should be PNG (APNG is okay with `.png` for `image/png` Content-type) and under 50kb for compatibility with mastodon. +Default file extentions and locations for emojis are set in `config.exs`. To use different locations or file-extentions, add the `shortcode_globs` to your secrets file (`prod.secret.exs` or `dev.secret.exs`) and edit it. Note that not all fediverse-software will show emojis with other file extentions: +```elixir +config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png", "/emoji/custom/**/*.gif"] +``` + ## Emoji tags (groups) -Default tags are set in `config.exs`. +Default tags are set in `config.exs`. To set your own tags, copy the structure to your secrets file (`prod.secret.exs` or `dev.secret.exs`) and edit it. ```elixir config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"], diff --git a/docs/installation/arch_linux_en.md b/docs/installation/arch_linux_en.md index 4b3bbbbb0..2b040cfbc 100644 --- a/docs/installation/arch_linux_en.md +++ b/docs/installation/arch_linux_en.md @@ -7,7 +7,6 @@ This guide will assume that you have administrative rights, either as root or a * `postgresql` * `elixir` -* `erlang-unixodbc` * `git` * `base-devel` @@ -27,7 +26,7 @@ sudo pacman -Syu * Install some of the above mentioned programs: ```shell -sudo pacman -S git base-devel elixir erlang-unixodbc +sudo pacman -S git base-devel elixir ``` ### Install PostgreSQL diff --git a/docs/installation/gentoo_en.md b/docs/installation/gentoo_en.md new file mode 100644 index 000000000..fccaad378 --- /dev/null +++ b/docs/installation/gentoo_en.md @@ -0,0 +1,296 @@ +# Installing on Gentoo GNU/Linux +## Installation + +This guide will assume that you have administrative rights, either as root or a user with [sudo permissions](https://wiki.gentoo.org/wiki/Sudo). Lines that begin with `#` indicate that they should be run as the superuser. Lines using `$` should be run as the indicated user, e.g. `pleroma$` should be run as the `pleroma` user. + +### Configuring your hostname (optional) + +If you would like your prompt to permanently include your host/domain, change `/etc/conf.d/hostname` to your hostname. You can reboot or use the `hostname` command to make immediate changes. + +### Your make.conf, package.use, and USE flags + +The only specific USE flag you should need is the `uuid` flag for `dev-db/postgresql`. Add the following line to any new file in `/etc/portage/package.use`. If you would like a suggested name for the file, either `postgresql` or `pleroma` would do fine, depending on how you like to arrange your package.use flags. + +```text +dev-db/postgresql uuid +``` + +You could opt to add `USE="uuid"` to `/etc/portage/make.conf` if you'd rather set this as a global USE flags, but this flags does unrelated things in other packages, so keep that in mind if you elect to do so. + +Double check your compiler flags in `/etc/portage/make.conf`. If you require any special compilation flags or would like to set up remote builds, now is the time to do so. Be sure that your CFLAGS and MAKEOPTS make sense for the platform you are using. It is not recommended to use above `-O2` or risky optimization flags for a production server. + +### Installing a cron daemon + +Gentoo quite pointedly does not come with a cron daemon installed, and as such it is recommended you install one to automate certbot renewals and to allow other system administration tasks to be run automatically. Gentoo has [a whole wide world of cron options](https://wiki.gentoo.org/wiki/Cron) but if you just want A Cron That Works, `emerge --ask virtual/cron` will install the default cron implementation (probably cronie) which will work just fine. For the purpouses of this guide, we will be doing just that. + +### Required ebuilds + +* `dev-db/postgresql` +* `dev-lang/elixir` +* `dev-vcs/git` + +#### Optional ebuilds used in this guide + +* `www-servers/nginx` (preferred, example configs for other reverse proxies can be found in the repo) +* `app-crypt/certbot` (or any other ACME client for Let’s Encrypt certificates) +* `app-crypt/certbot-nginx` (nginx certbot plugin that allows use of the all-powerful `--nginx` flag on certbot) + +### Prepare the system + +* First ensure that you have the latest copy of the portage ebuilds if you have not synced them yet: + +```shell + # emaint sync -a +``` + +* Emerge all required the required and suggested software in one go: + +```shell + # emerge --ask dev-db/postgresql dev-lang/elixir dev-vcs/git www-servers/nginx app-crypt/certbot app-crypt/certbot-nginx +``` + +If you would not like to install the optional packages, remove them from this line. + +If you're running this from a low-powered virtual machine, it should work though it will take some time. There were no issues on a VPS with a single core and 1GB of RAM; if you are using an even more limited device and run into issues, you can try creating a swapfile or use a more powerful machine running Gentoo to [cross build](https://wiki.gentoo.org/wiki/Cross_build_environment). If you have a wait ahead of you, now would be a good time to take a break, strech a bit, refresh your beverage of choice and/or get a snack, and reply to Arch users' posts with "I use Gentoo btw" as we do. + +### Install PostgreSQL + +[Gentoo Wiki article](https://wiki.gentoo.org/wiki/PostgreSQL) as well as [PostgreSQL QuickStart](https://wiki.gentoo.org/wiki/PostgreSQL/QuickStart) might be worth a quick glance, as the way Gentoo handles postgres is slightly unusual, with built in capability to have two different databases running for testing and live or whatever other purpouse. While it is still straightforward to install, it does mean that the version numbers used in this guide might change for future updates, so keep an eye out for the output you get from `emerge` to ensure you are using the correct ones. + +* Install postgresql if you have not done so already: + +```shell + # emerge --ask dev-db/postgresql +``` + +Ensure that `/etc/conf.d/postgresql-11` has the encoding you want (it defaults to UTF8 which is probably what you want) and make any adjustments to the data directory if you find it necessary. Be sure to adjust the number at the end depending on what version of postgres you actually installed. + +* Initialize the database cluster + +The output from emerging postgresql should give you a command for initializing the postgres database. The default slot should be indicated in this command, ensure that it matches the command below. + +```shell + # emerge --config dev-db/postgresql:11 +``` + +* Start postgres and enable the system service + +```shell + # /etc/init.d/postgresql-11 start + # rc-update add postgresql-11 default + ``` + +### A note on licenses, the AGPL, and deployment procedures + +If you do not plan to make any modifications to your Pleroma instance, cloning directly from the main repo will get you what you need. However, if you plan on doing any contributions to upstream development, making changes or modifications to your instance, making custom themes, or want to play around--and let's be honest here, if you're using Gentoo that is most likely you--you will save yourself a lot of headache later if you take the time right now to fork the Pleroma repo and use that in the following section. + +Not only does this make it much easier to deploy changes you make, as you can commit and pull from upstream and all that good stuff from the comfort of your local machine then simply `git pull` on your instance server when you're ready to deploy, it also ensures you are compliant with the Affero General Public Licence that Pleroma is licenced under, which stipulates that all network services provided with modified AGPL code must publish their changes on a publicly available internet service and for free. It also makes it much easier to ask for help from and provide help to your fellow Pleroma admins if your public repo always reflects what you are running because it is part of your deployment procedure. + +### Install PleromaBE + +* Add a new system user for the Pleroma service and set up default directories: + +Remove `,wheel` if you do not want this user to be able to use `sudo`, however note that being able to `sudo` as the `pleroma` user will make finishing the insallation and common maintenence tasks somewhat easier: + +```shell + # useradd -m -G users,wheel -s /bin/bash pleroma +``` + +Optional: If you are using sudo, review your sudo setup to ensure it works for you. The `/etc/sudoers` file has a lot of options and examples to help you, and [the Gentoo sudo guide](https://wiki.gentoo.org/wiki/Sudo) has more information. Finishing this installation will be somewhat easier if you have a way to sudo from the `pleroma` user, but it might be best to not allow that user to sudo during normal operation, and as such there will be a reminder at the end of this guide to double check if you would like to lock down the `pleroma` user after initial setup. + +**Note**: To execute a single command as the Pleroma system user, use `sudo -Hu pleroma command`. You can also switch to a shell by using `sudo -Hu pleroma $SHELL`. If you don't have or want `sudo` or would like to use the system as the `pleroma` user for instance maintenance tasks, you can simply use `su - pleroma` to switch to the `pleroma` user. + +* Git clone the PleromaBE repository and make the Pleroma user the owner of the directory: + +It is highly recommended you use your own fork for the `https://path/to/repo` part below, however if you foolishly decide to forego using your own fork, the primary repo `https://git.pleroma.social/pleroma/pleroma` will work here. + +```shell + pleroma$ cd ~ + pleroma$ git clone https://path/to/repo +``` + +* Change to the new directory: + +```shell +pleroma$ cd ~/pleroma +``` + +* Install the dependencies for Pleroma and answer with `yes` if it asks you to install `Hex`: + +```shell +pleroma$ mix deps.get +``` + +* Generate the configuration: + +```shell +pleroma$ mix pleroma.instance gen +``` + + * Answer with `yes` if it asks you to install `rebar3`. + + * This part precompiles some parts of Pleroma, so it might take a few moments + + * After that it will ask you a few questions about your instance and generates a configuration file in `config/generated_config.exs`. + + * Spend some time with `generated_config.exs` to ensure that everything is in order. If you plan on using an S3-compatible service to store your local media, that can be done here. You will likely mostly be using `prod.secret.exs` for a production instance, however if you would like to set up a development environment, make a copy to `dev.secret.exs` and adjust settings as needed as well. + +```shell +pleroma$ mv config/generated_config.exs config/prod.secret.exs +``` + +* The previous command creates also the file `config/setup_db.psql`, with which you can create the database. Ensure that it is using the correct database name on the `CREATE DATABASE` and the `\c` lines, then run the postgres script: + +```shell +pleroma$ sudo -Hu postgres psql -f config/setup_db.psql +``` + +* Now run the database migration: + +```shell +pleroma$ MIX_ENV=prod mix ecto.migrate +``` + +* Now you can start Pleroma already + +```shell +pleroma$ MIX_ENV=prod mix phx.server +``` + +It probably won't work over the public internet quite yet, however, as we still need to set up a web servere to proxy to the pleroma application, as well as configure SSL. + +### Finalize installation + +Assuming you want to open your newly installed federated social network to, well, the federation, you should run nginx or some other webserver/proxy in front of Pleroma. It is also a good idea to set up Pleroma to run as a system service. + +#### Nginx + +* Install nginx, if not already done: + +```shell + # emerge --ask www-servers/nginx +``` + +* Create directories for available and enabled sites: + +```shell + # mkdir -p /etc/nginx/sites-{available,enabled} +``` + +* Append the following line at the end of the `http` block in `/etc/nginx/nginx.conf`: + +```Nginx +include sites-enabled/*; +``` + +* Setup your SSL cert, using your method of choice or certbot. If using certbot, install it if you haven't already: + +```shell + # emerge --ask app-crypt/certbot app-crypt/certbot-nginx +``` + +and then set it up: + +```shell + # mkdir -p /var/lib/letsencrypt/ + # certbot certonly --email -d --standalone +``` + +If that doesn't work the first time, add `--dry-run` to further attempts to avoid being ratelimited as you identify the issue, and do not remove it until the dry run succeeds. If that doesn’t work, make sure, that nginx is not already running. If it still doesn’t work, try setting up nginx first (change ssl “on” to “off” and try again). Often the answer to issues with certbot is to use the `--nginx` flag once you have nginx up and running. + +If you are using any additional subdomains, such as for a media proxy, you can re-run the same command with the subdomain in question. When it comes time to renew later, you will not need to run multiple times for each domain, one renew will handle it. + +--- + +* Copy the example nginx configuration and activate it: + +```shell + # cp /home/pleroma/pleroma/installation/pleroma.nginx /etc/nginx/sites-available/ + # ln -s /etc/nginx/sites-available/pleroma.nginx /etc/nginx/sites-enabled/pleroma.nginx +``` + +* Take some time to ensure that your nginx config is correct + +Replace all instances of `example.tld` with your instance's public URL. If for whatever reason you made changes to the port that your pleroma app runs on, be sure that is reflected in your configuration. + +Pay special attention to the line that begins with `ssl_ecdh_curve`. It is stongly advised to comment that line out so that OpenSSL will use its full capabilities, and it is also possible you are running OpenSSL 1.0.2 necessitating that you do this. + +* Enable and start nginx: + +```shell + # rc-update add nginx default + # /etc/init.d/nginx start +``` + +If you are using certbot, it is HIGHLY recommend you set up a cron job that renews your certificate, and that you install the suggested `certbot-nginx` plugin. If you don't do these things, you only have yourself to blame when your instance breaks suddenly because you forgot about it. + +First, ensure that the command you will be installing into your crontab works. + +```shell + # /usr/bin/certbot renew --nginx +``` + +Assuming not much time has passed since you got certbot working a few steps ago, you should get a message for all domains you installed certificates for saying `Cert not yet due for renewal`. + +Now, run crontab as a superuser with `crontab -e` or `sudo crontab -e` as appropriate, and add the following line to your cron: + +```cron +0 0 1 * * /usr/bin/certbot renew --nginx +``` + +This will run certbot on the first of the month at midnight. If you'd rather run more frequently, it's not a bad idea, feel free to go for it. + +#### Other webserver/proxies + +If you would like to use other webservers or proxies, there are example configurations for some popular alternatives in `/home/pleroma/pleroma/installation/`. You can, of course, check out [the Gentoo wiki](https://wiki.gentoo.org) for more information on installing and configuring said alternatives. + +#### Create the uploads folder + +Even if you are using S3, Pleroma needs someplace to store media posted on your instance. If you are using the `/home/pleroma/pleroma` root folder suggested by this guide, simply: + +```shell + pleroma$ mkdir -p ~/pleroma/uploads + ``` + +#### init.d service + +* Copy example service file + +```shell + # cp /home/pleroma/pleroma/installation/init.d/pleroma /etc/init.d/ +``` + +* Be sure to take a look at this service file and make sure that all paths fit your installation + +* Enable and start `pleroma`: + +```shell + # rc-update add pleroma default + # /etc/init.d/pleroma start +``` + +#### Create your first user + +If your instance is up and running, you can create your first user with administrative rights with the following task: + +```shell +pleroma$ MIX_ENV=prod mix pleroma.user new --admin +``` + +#### Privilege cleanup + +If you opted to allow sudo for the `pleroma` user but would like to remove the ability for greater security, now might be a good time to edit `/etc/sudoers` and/or change the groups the `pleroma` user belongs to. Be sure to restart the pleroma service afterwards to ensure it picks up on the changes. + +#### Further reading + +* [Admin tasks](Admin tasks) +* [Backup your instance](Backup-your-instance) +* [Configuration tips](General tips for customizing pleroma fe) +* [Hardening your instance](Hardening-your-instance) +* [How to activate mediaproxy](How-to-activate-mediaproxy) +* [Small Pleroma-FE customizations](Small customizations) +* [Updating your instance](Updating-your-instance) + +## Questions + +Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**. diff --git a/installation/pleroma.nginx b/installation/pleroma.nginx index 8709f2cb7..cc75d78b2 100644 --- a/installation/pleroma.nginx +++ b/installation/pleroma.nginx @@ -37,7 +37,7 @@ server { listen [::]:443 ssl http2; ssl_session_timeout 5m; - ssl_trusted_certificate /etc/letsencrypt/live/example.tld/fullchain.pem; + ssl_trusted_certificate /etc/letsencrypt/live/example.tld/chain.pem; ssl_certificate /etc/letsencrypt/live/example.tld/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.tld/privkey.pem; diff --git a/installation/pleroma.supervisord b/installation/pleroma.supervisord new file mode 100644 index 000000000..19efffd6e --- /dev/null +++ b/installation/pleroma.supervisord @@ -0,0 +1,21 @@ +; Assumes pleroma is installed in /home/pleroma/pleroma and running as the pleroma user +; Also assumes mix is in /usr/bin, this might differ on BSDs or niche Linux distros +; Logs into /home/pleroma/logs +[program:pleroma] +command=/usr/bin/mix phx.server +directory=/home/pleroma/pleroma +autostart=true +autorestart=true +user=pleroma +environment = + MIX_ENV=prod, + HOME=/home/pleroma, + USER=pleroma, + PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/pleroma/bin:%(ENV_PATH)s", + PWD=/home/pleroma/pleroma +stdout_logfile=/home/pleroma/logs/stdout.log +stdout_logfile_maxbytes=50MB +stdout_logfile_backups=10 +stderr_logfile=/home/pleroma/logs/stderr.log +stderr_logfile_maxbytes=50MB +stderr_logfile_backups=10 \ No newline at end of file diff --git a/lib/healthcheck.ex b/lib/healthcheck.ex new file mode 100644 index 000000000..646fb3b9d --- /dev/null +++ b/lib/healthcheck.ex @@ -0,0 +1,60 @@ +defmodule Pleroma.Healthcheck do + @moduledoc """ + Module collects metrics about app and assign healthy status. + """ + alias Pleroma.Healthcheck + alias Pleroma.Repo + + defstruct pool_size: 0, + active: 0, + idle: 0, + memory_used: 0, + healthy: true + + @type t :: %__MODULE__{ + pool_size: non_neg_integer(), + active: non_neg_integer(), + idle: non_neg_integer(), + memory_used: number(), + healthy: boolean() + } + + @spec system_info() :: t() + def system_info do + %Healthcheck{ + memory_used: Float.round(:erlang.memory(:total) / 1024 / 1024, 2) + } + |> assign_db_info() + |> check_health() + end + + defp assign_db_info(healthcheck) do + database = Application.get_env(:pleroma, Repo)[:database] + + query = + "select state, count(pid) from pg_stat_activity where datname = '#{database}' group by state;" + + result = Repo.query!(query) + pool_size = Application.get_env(:pleroma, Repo)[:pool_size] + + db_info = + Enum.reduce(result.rows, %{active: 0, idle: 0}, fn [state, cnt], states -> + if state == "active" do + Map.put(states, :active, states.active + cnt) + else + Map.put(states, :idle, states.idle + cnt) + end + end) + |> Map.put(:pool_size, pool_size) + + Map.merge(healthcheck, db_info) + end + + @spec check_health(Healthcheck.t()) :: Healthcheck.t() + def check_health(%{pool_size: pool_size, active: active} = check) + when active >= pool_size do + %{check | healthy: false} + end + + def check_health(check), do: check +end diff --git a/lib/mix/tasks/pleroma/database.ex b/lib/mix/tasks/pleroma/database.ex new file mode 100644 index 000000000..ab9a3a7ff --- /dev/null +++ b/lib/mix/tasks/pleroma/database.ex @@ -0,0 +1,51 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2018 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Mix.Tasks.Pleroma.Database do + alias Mix.Tasks.Pleroma.Common + require Logger + use Mix.Task + + @shortdoc "A collection of database related tasks" + @moduledoc """ + A collection of database related tasks + + ## Replace embedded objects with their references + + Replaces embedded objects with references to them in the `objects` table. Only needs to be ran once. The reason why this is not a migration is because it could significantly increase the database size after being ran, however after this `VACUUM FULL` will be able to reclaim about 20% (really depends on what is in the database, your mileage may vary) of the db size before the migration. + + mix pleroma.database remove_embedded_objects + + Options: + - `--vacuum` - run `VACUUM FULL` after the embedded objects are replaced with their references + """ + def run(["remove_embedded_objects" | args]) do + {options, [], []} = + OptionParser.parse( + args, + strict: [ + vacuum: :boolean + ] + ) + + Common.start_pleroma() + Logger.info("Removing embedded objects") + + Pleroma.Repo.query!( + "update activities set data = jsonb_set(data, '{object}'::text[], data->'object'->'id') where data->'object'->>'id' is not null;", + [], + timeout: :infinity + ) + + if Keyword.get(options, :vacuum) do + Logger.info("Runnning VACUUM FULL") + + Pleroma.Repo.query!( + "vacuum full;", + [], + timeout: :infinity + ) + end + end +end diff --git a/lib/mix/tasks/pleroma/emoji.ex b/lib/mix/tasks/pleroma/emoji.ex new file mode 100644 index 000000000..cced73226 --- /dev/null +++ b/lib/mix/tasks/pleroma/emoji.ex @@ -0,0 +1,293 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2018 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Mix.Tasks.Pleroma.Emoji do + use Mix.Task + + @shortdoc "Manages emoji packs" + @moduledoc """ + Manages emoji packs + + ## ls-packs + + mix pleroma.emoji ls-packs [OPTION...] + + Lists the emoji packs and metadata specified in the manifest. + + ### Options + + - `-m, --manifest PATH/URL` - path to a custom manifest, it can + either be an URL starting with `http`, in that case the + manifest will be fetched from that address, or a local path + + ## get-packs + + mix pleroma.emoji get-packs [OPTION...] PACKS + + Fetches, verifies and installs the specified PACKS from the + manifest into the `STATIC-DIR/emoji/PACK-NAME` + + ### Options + + - `-m, --manifest PATH/URL` - same as ls-packs + + ## gen-pack + + mix pleroma.emoji gen-pack PACK-URL + + Creates a new manifest entry and a file list from the specified + remote pack file. Currently, only .zip archives are recognized + as remote pack files and packs are therefore assumed to be zip + archives. This command is intended to run interactively and will + first ask you some basic questions about the pack, then download + the remote file and generate an SHA256 checksum for it, then + generate an emoji file list for you. + + The manifest entry will either be written to a newly created + `index.json` file or appended to the existing one, *replacing* + the old pack with the same name if it was in the file previously. + + The file list will be written to the file specified previously, + *replacing* that file. You _should_ check that the file list doesn't + contain anything you don't need in the pack, that is, anything that is + not an emoji (the whole pack is downloaded, but only emoji files + are extracted). + """ + + @default_manifest Pleroma.Config.get!([:emoji, :default_manifest]) + + def run(["ls-packs" | args]) do + Application.ensure_all_started(:hackney) + + {options, [], []} = parse_global_opts(args) + + manifest = + fetch_manifest(if options[:manifest], do: options[:manifest], else: @default_manifest) + + Enum.each(manifest, fn {name, info} -> + to_print = [ + {"Name", name}, + {"Homepage", info["homepage"]}, + {"Description", info["description"]}, + {"License", info["license"]}, + {"Source", info["src"]} + ] + + for {param, value} <- to_print do + IO.puts(IO.ANSI.format([:bright, param, :normal, ": ", value])) + end + + # A newline + IO.puts("") + end) + end + + def run(["get-packs" | args]) do + Application.ensure_all_started(:hackney) + + {options, pack_names, []} = parse_global_opts(args) + + manifest_url = if options[:manifest], do: options[:manifest], else: @default_manifest + + manifest = fetch_manifest(manifest_url) + + for pack_name <- pack_names do + if Map.has_key?(manifest, pack_name) do + pack = manifest[pack_name] + src_url = pack["src"] + + IO.puts( + IO.ANSI.format([ + "Downloading ", + :bright, + pack_name, + :normal, + " from ", + :underline, + src_url + ]) + ) + + binary_archive = Tesla.get!(src_url).body + archive_sha = :crypto.hash(:sha256, binary_archive) |> Base.encode16() + + sha_status_text = ["SHA256 of ", :bright, pack_name, :normal, " source file is ", :bright] + + if archive_sha == String.upcase(pack["src_sha256"]) do + IO.puts(IO.ANSI.format(sha_status_text ++ [:green, "OK"])) + else + IO.puts(IO.ANSI.format(sha_status_text ++ [:red, "BAD"])) + + raise "Bad SHA256 for #{pack_name}" + end + + # The url specified in files should be in the same directory + files_url = Path.join(Path.dirname(manifest_url), pack["files"]) + + IO.puts( + IO.ANSI.format([ + "Fetching the file list for ", + :bright, + pack_name, + :normal, + " from ", + :underline, + files_url + ]) + ) + + files = Tesla.get!(files_url).body |> Poison.decode!() + + IO.puts(IO.ANSI.format(["Unpacking ", :bright, pack_name])) + + pack_path = + Path.join([ + Pleroma.Config.get!([:instance, :static_dir]), + "emoji", + pack_name + ]) + + files_to_unzip = + Enum.map( + files, + fn {_, f} -> to_charlist(f) end + ) + + {:ok, _} = + :zip.unzip(binary_archive, + cwd: pack_path, + file_list: files_to_unzip + ) + + IO.puts(IO.ANSI.format(["Writing emoji.txt for ", :bright, pack_name])) + + emoji_txt_str = + Enum.map( + files, + fn {shortcode, path} -> + emojo_path = Path.join("/emoji/#{pack_name}", path) + "#{shortcode}, #{emojo_path}" + end + ) + |> Enum.join("\n") + + File.write!(Path.join(pack_path, "emoji.txt"), emoji_txt_str) + else + IO.puts(IO.ANSI.format([:bright, :red, "No pack named \"#{pack_name}\" found"])) + end + end + end + + def run(["gen-pack", src]) do + Application.ensure_all_started(:hackney) + + proposed_name = Path.basename(src) |> Path.rootname() + name = String.trim(IO.gets("Pack name [#{proposed_name}]: ")) + # If there's no name, use the default one + name = if String.length(name) > 0, do: name, else: proposed_name + + license = String.trim(IO.gets("License: ")) + homepage = String.trim(IO.gets("Homepage: ")) + description = String.trim(IO.gets("Description: ")) + + proposed_files_name = "#{name}.json" + files_name = String.trim(IO.gets("Save file list to [#{proposed_files_name}]: ")) + files_name = if String.length(files_name) > 0, do: files_name, else: proposed_files_name + + default_exts = [".png", ".gif"] + default_exts_str = Enum.join(default_exts, " ") + + exts = + String.trim( + IO.gets("Emoji file extensions (separated with spaces) [#{default_exts_str}]: ") + ) + + exts = + if String.length(exts) > 0 do + String.split(exts, " ") + |> Enum.filter(fn e -> e |> String.trim() |> String.length() > 0 end) + else + default_exts + end + + IO.puts("Downloading the pack and generating SHA256") + + binary_archive = Tesla.get!(src).body + archive_sha = :crypto.hash(:sha256, binary_archive) |> Base.encode16() + + IO.puts("SHA256 is #{archive_sha}") + + pack_json = %{ + name => %{ + license: license, + homepage: homepage, + description: description, + src: src, + src_sha256: archive_sha, + files: files_name + } + } + + tmp_pack_dir = Path.join(System.tmp_dir!(), "emoji-pack-#{name}") + + {:ok, _} = + :zip.unzip( + binary_archive, + cwd: tmp_pack_dir + ) + + emoji_map = Pleroma.Emoji.make_shortcode_to_file_map(tmp_pack_dir, exts) + + File.write!(files_name, Poison.encode!(emoji_map, pretty: true)) + + IO.puts(""" + + #{files_name} has been created and contains the list of all found emojis in the pack. + Please review the files in the remove those not needed. + """) + + if File.exists?("index.json") do + existing_data = File.read!("index.json") |> Poison.decode!() + + File.write!( + "index.json", + Poison.encode!( + Map.merge( + existing_data, + pack_json + ), + pretty: true + ) + ) + + IO.puts("index.json file has been update with the #{name} pack") + else + File.write!("index.json", Poison.encode!(pack_json, pretty: true)) + + IO.puts("index.json has been created with the #{name} pack") + end + end + + defp fetch_manifest(from) do + Poison.decode!( + if String.starts_with?(from, "http") do + Tesla.get!(from).body + else + File.read!(from) + end + ) + end + + defp parse_global_opts(args) do + OptionParser.parse( + args, + strict: [ + manifest: :string + ], + aliases: [ + m: :manifest + ] + ) + end +end diff --git a/lib/mix/tasks/pleroma/instance.ex b/lib/mix/tasks/pleroma/instance.ex index 8f8d86a11..6cee8d630 100644 --- a/lib/mix/tasks/pleroma/instance.ex +++ b/lib/mix/tasks/pleroma/instance.ex @@ -24,10 +24,12 @@ defmodule Mix.Tasks.Pleroma.Instance do - `--domain DOMAIN` - the domain of your instance - `--instance-name INSTANCE_NAME` - the name of your instance - `--admin-email ADMIN_EMAIL` - the email address of the instance admin + - `--notify-email NOTIFY_EMAIL` - email address for notifications - `--dbhost HOSTNAME` - the hostname of the PostgreSQL database to use - `--dbname DBNAME` - the name of the database to use - `--dbuser DBUSER` - the user (aka role) to use for the database connection - `--dbpass DBPASS` - the password to use for the database connection + - `--indexable Y/N` - Allow/disallow indexing site by search engines """ def run(["gen" | rest]) do @@ -41,10 +43,12 @@ def run(["gen" | rest]) do domain: :string, instance_name: :string, admin_email: :string, + notify_email: :string, dbhost: :string, dbname: :string, dbuser: :string, - dbpass: :string + dbpass: :string, + indexable: :string ], aliases: [ o: :output, @@ -61,7 +65,7 @@ def run(["gen" | rest]) do will_overwrite = Enum.filter(paths, &File.exists?/1) proceed? = Enum.empty?(will_overwrite) or Keyword.get(options, :force, false) - unless not proceed? do + if proceed? do [domain, port | _] = String.split( Common.get_option( @@ -81,6 +85,14 @@ def run(["gen" | rest]) do email = Common.get_option(options, :admin_email, "What is your admin email address?") + notify_email = + Common.get_option( + options, + :notify_email, + "What email address do you want to use for sending email notifications?", + email + ) + indexable = Common.get_option( options, @@ -122,6 +134,7 @@ def run(["gen" | rest]) do domain: domain, port: port, email: email, + notify_email: notify_email, name: name, dbhost: dbhost, dbname: dbname, diff --git a/lib/mix/tasks/pleroma/sample_config.eex b/lib/mix/tasks/pleroma/sample_config.eex index 1c935c0d8..52bd57cb7 100644 --- a/lib/mix/tasks/pleroma/sample_config.eex +++ b/lib/mix/tasks/pleroma/sample_config.eex @@ -13,6 +13,7 @@ config :pleroma, Pleroma.Web.Endpoint, config :pleroma, :instance, name: "<%= name %>", email: "<%= email %>", + notify_email: "<%= notify_email %>", limit: 5000, registrations_open: true, dedupe_media: false @@ -75,4 +76,3 @@ config :web_push_encryption, :vapid_details, # storage_url: "https://swift-endpoint.prodider.com/v1/AUTH_/", # object_url: "https://cdn-endpoint.provider.com/" # - diff --git a/lib/mix/tasks/pleroma/user.ex b/lib/mix/tasks/pleroma/user.ex index 441168df2..b396ff0de 100644 --- a/lib/mix/tasks/pleroma/user.ex +++ b/lib/mix/tasks/pleroma/user.ex @@ -162,7 +162,7 @@ def run(["new", nickname, email | rest]) do def run(["rm", nickname]) do Common.start_pleroma() - with %User{local: true} = user <- User.get_by_nickname(nickname) do + with %User{local: true} = user <- User.get_cached_by_nickname(nickname) do User.delete(user) Mix.shell().info("User #{nickname} deleted.") else @@ -174,7 +174,7 @@ def run(["rm", nickname]) do def run(["toggle_activated", nickname]) do Common.start_pleroma() - with %User{} = user <- User.get_by_nickname(nickname) do + with %User{} = user <- User.get_cached_by_nickname(nickname) do {:ok, user} = User.deactivate(user, !user.info.deactivated) Mix.shell().info( @@ -189,7 +189,7 @@ def run(["toggle_activated", nickname]) do def run(["reset_password", nickname]) do Common.start_pleroma() - with %User{local: true} = user <- User.get_by_nickname(nickname), + with %User{local: true} = user <- User.get_cached_by_nickname(nickname), {:ok, token} <- Pleroma.PasswordResetToken.create_token(user) do Mix.shell().info("Generated password reset token for #{user.nickname}") @@ -211,14 +211,14 @@ def run(["reset_password", nickname]) do def run(["unsubscribe", nickname]) do Common.start_pleroma() - with %User{} = user <- User.get_by_nickname(nickname) do + with %User{} = user <- User.get_cached_by_nickname(nickname) do Mix.shell().info("Deactivating #{user.nickname}") User.deactivate(user) {:ok, friends} = User.get_friends(user) Enum.each(friends, fn friend -> - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) Mix.shell().info("Unsubscribing #{friend.nickname} from #{user.nickname}") User.unfollow(user, friend) @@ -226,7 +226,7 @@ def run(["unsubscribe", nickname]) do :timer.sleep(500) - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) if Enum.empty?(user.following) do Mix.shell().info("Successfully unsubscribed all followers from #{user.nickname}") @@ -250,7 +250,7 @@ def run(["set", nickname | rest]) do ] ) - with %User{local: true} = user <- User.get_by_nickname(nickname) do + with %User{local: true} = user <- User.get_cached_by_nickname(nickname) do user = case Keyword.get(options, :moderator) do nil -> user @@ -277,7 +277,7 @@ def run(["set", nickname | rest]) do def run(["tag", nickname | tags]) do Common.start_pleroma() - with %User{} = user <- User.get_by_nickname(nickname) do + with %User{} = user <- User.get_cached_by_nickname(nickname) do user = user |> User.tag(tags) Mix.shell().info("Tags of #{user.nickname}: #{inspect(tags)}") @@ -290,7 +290,7 @@ def run(["tag", nickname | tags]) do def run(["untag", nickname | tags]) do Common.start_pleroma() - with %User{} = user <- User.get_by_nickname(nickname) do + with %User{} = user <- User.get_cached_by_nickname(nickname) do user = user |> User.untag(tags) Mix.shell().info("Tags of #{user.nickname}: #{inspect(tags)}") @@ -379,7 +379,7 @@ def run(["revoke_invite", token]) do def run(["delete_activities", nickname]) do Common.start_pleroma() - with %User{local: true} = user <- User.get_by_nickname(nickname) do + with %User{local: true} = user <- User.get_cached_by_nickname(nickname) do User.delete_user_activities(user) Mix.shell().info("User #{nickname} statuses deleted.") else diff --git a/lib/pleroma/PasswordResetToken.ex b/lib/pleroma/PasswordResetToken.ex index 7afbc8751..f31ea5bc5 100644 --- a/lib/pleroma/PasswordResetToken.ex +++ b/lib/pleroma/PasswordResetToken.ex @@ -39,7 +39,7 @@ def used_changeset(struct) do def reset_password(token, data) do with %{used: false} = token <- Repo.get_by(PasswordResetToken, %{token: token}), - %User{} = user <- User.get_by_id(token.user_id), + %User{} = user <- User.get_cached_by_id(token.user_id), {:ok, _user} <- User.reset_password(user, data), {:ok, token} <- Repo.update(used_changeset(token)) do {:ok, token} diff --git a/lib/pleroma/activity.ex b/lib/pleroma/activity.ex index ab8861b27..4a2ded518 100644 --- a/lib/pleroma/activity.ex +++ b/lib/pleroma/activity.ex @@ -10,6 +10,7 @@ defmodule Pleroma.Activity do alias Pleroma.Object alias Pleroma.Repo + import Ecto.Changeset import Ecto.Query @type t :: %__MODULE__{} @@ -79,6 +80,13 @@ def get_by_ap_id(ap_id) do ) end + def change(struct, params \\ %{}) do + struct + |> cast(params, [:data]) + |> validate_required([:data]) + |> unique_constraint(:ap_id, name: :activities_unique_apid_index) + end + def get_by_ap_id_with_object(ap_id) do Repo.one( from( @@ -196,28 +204,35 @@ def create_by_object_ap_id_with_object(ap_id) when is_binary(ap_id) do def create_by_object_ap_id_with_object(_), do: nil - def get_create_by_object_ap_id_with_object(ap_id) do + def get_create_by_object_ap_id_with_object(ap_id) when is_binary(ap_id) do ap_id |> create_by_object_ap_id_with_object() |> Repo.one() end + def get_create_by_object_ap_id_with_object(_), do: nil + + defp get_in_reply_to_activity_from_object(%Object{data: %{"inReplyTo" => ap_id}}) do + get_create_by_object_ap_id_with_object(ap_id) + end + + defp get_in_reply_to_activity_from_object(_), do: nil + + def get_in_reply_to_activity(%Activity{data: %{"object" => object}}) do + get_in_reply_to_activity_from_object(Object.normalize(object)) + end + def normalize(obj) when is_map(obj), do: get_by_ap_id_with_object(obj["id"]) def normalize(ap_id) when is_binary(ap_id), do: get_by_ap_id_with_object(ap_id) def normalize(_), do: nil - def get_in_reply_to_activity(%Activity{data: %{"object" => %{"inReplyTo" => ap_id}}}) do - get_create_by_object_ap_id(ap_id) - end - - def get_in_reply_to_activity(_), do: nil - def delete_by_ap_id(id) when is_binary(id) do by_object_ap_id(id) |> select([u], u) |> Repo.delete_all() |> elem(1) |> Enum.find(fn + %{data: %{"type" => "Create", "object" => ap_id}} when is_binary(ap_id) -> ap_id == id %{data: %{"type" => "Create", "object" => %{"id" => ap_id}}} -> ap_id == id _ -> nil end) @@ -245,50 +260,4 @@ def all_by_actor_and_id(actor, status_ids) do |> where([s], s.actor == ^actor) |> Repo.all() end - - def increase_replies_count(id) do - Activity - |> where(id: ^id) - |> update([a], - set: [ - data: - fragment( - """ - jsonb_set(?, '{object, repliesCount}', - (coalesce((?->'object'->>'repliesCount')::int, 0) + 1)::varchar::jsonb, true) - """, - a.data, - a.data - ) - ] - ) - |> Repo.update_all([]) - |> case do - {1, [activity]} -> activity - _ -> {:error, "Not found"} - end - end - - def decrease_replies_count(id) do - Activity - |> where(id: ^id) - |> update([a], - set: [ - data: - fragment( - """ - jsonb_set(?, '{object, repliesCount}', - (greatest(0, (?->'object'->>'repliesCount')::int - 1))::varchar::jsonb, true) - """, - a.data, - a.data - ) - ] - ) - |> Repo.update_all([]) - |> case do - {1, [activity]} -> activity - _ -> {:error, "Not found"} - end - end end diff --git a/lib/pleroma/bookmark.ex b/lib/pleroma/bookmark.ex new file mode 100644 index 000000000..7f8fd43b6 --- /dev/null +++ b/lib/pleroma/bookmark.ex @@ -0,0 +1,60 @@ +defmodule Pleroma.Bookmark do + use Ecto.Schema + + import Ecto.Changeset + import Ecto.Query + + alias Pleroma.Activity + alias Pleroma.Bookmark + alias Pleroma.FlakeId + alias Pleroma.Repo + alias Pleroma.User + + @type t :: %__MODULE__{} + + schema "bookmarks" do + belongs_to(:user, User, type: FlakeId) + belongs_to(:activity, Activity, type: FlakeId) + + timestamps() + end + + @spec create(FlakeId.t(), FlakeId.t()) :: {:ok, Bookmark.t()} | {:error, Changeset.t()} + def create(user_id, activity_id) do + attrs = %{ + user_id: user_id, + activity_id: activity_id + } + + %Bookmark{} + |> cast(attrs, [:user_id, :activity_id]) + |> validate_required([:user_id, :activity_id]) + |> unique_constraint(:activity_id, name: :bookmarks_user_id_activity_id_index) + |> Repo.insert() + end + + @spec for_user_query(FlakeId.t()) :: Ecto.Query.t() + def for_user_query(user_id) do + Bookmark + |> where(user_id: ^user_id) + |> join(:inner, [b], activity in assoc(b, :activity)) + |> preload([b, a], activity: a) + end + + def get(user_id, activity_id) do + Bookmark + |> where(user_id: ^user_id) + |> where(activity_id: ^activity_id) + |> Repo.one() + end + + @spec destroy(FlakeId.t(), FlakeId.t()) :: {:ok, Bookmark.t()} | {:error, Changeset.t()} + def destroy(user_id, activity_id) do + from(b in Bookmark, + where: b.user_id == ^user_id, + where: b.activity_id == ^activity_id + ) + |> Repo.one() + |> Repo.delete() + end +end diff --git a/lib/pleroma/emails/admin_email.ex b/lib/pleroma/emails/admin_email.ex index afefccec5..df0f72f96 100644 --- a/lib/pleroma/emails/admin_email.ex +++ b/lib/pleroma/emails/admin_email.ex @@ -2,7 +2,7 @@ # Copyright © 2017-2019 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only -defmodule Pleroma.AdminEmail do +defmodule Pleroma.Emails.AdminEmail do @moduledoc "Admin emails" import Swoosh.Email @@ -11,7 +11,10 @@ defmodule Pleroma.AdminEmail do defp instance_config, do: Pleroma.Config.get(:instance) defp instance_name, do: instance_config()[:name] - defp instance_email, do: instance_config()[:email] + + defp instance_notify_email do + Keyword.get(instance_config(), :notify_email, instance_config()[:email]) + end defp user_url(user) do Helpers.o_status_url(Pleroma.Web.Endpoint, :feed_redirect, user.nickname) @@ -59,7 +62,7 @@ def report(to, reporter, account, statuses, comment) do new() |> to({to.name, to.email}) - |> from({instance_name(), instance_email()}) + |> from({instance_name(), instance_notify_email()}) |> reply_to({reporter.name, reporter.email}) |> subject("#{instance_name()} Report") |> html_body(html_body) diff --git a/lib/pleroma/emails/mailer.ex b/lib/pleroma/emails/mailer.ex index b384e6fec..53f5a661c 100644 --- a/lib/pleroma/emails/mailer.ex +++ b/lib/pleroma/emails/mailer.ex @@ -2,7 +2,7 @@ # Copyright © 2017-2019 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only -defmodule Pleroma.Mailer do +defmodule Pleroma.Emails.Mailer do use Swoosh.Mailer, otp_app: :pleroma def deliver_async(email, config \\ []) do diff --git a/lib/pleroma/emails/user_email.ex b/lib/pleroma/emails/user_email.ex index a3a09e96c..8502a0d0c 100644 --- a/lib/pleroma/emails/user_email.ex +++ b/lib/pleroma/emails/user_email.ex @@ -2,7 +2,7 @@ # Copyright © 2017-2019 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only -defmodule Pleroma.UserEmail do +defmodule Pleroma.Emails.UserEmail do @moduledoc "User emails" import Swoosh.Email @@ -15,7 +15,8 @@ defp instance_config, do: Pleroma.Config.get(:instance) defp instance_name, do: instance_config()[:name] defp sender do - {instance_name(), instance_config()[:email]} + email = Keyword.get(instance_config(), :notify_email, instance_config()[:email]) + {instance_name(), email} end defp recipient(email, nil), do: email diff --git a/lib/pleroma/emoji.ex b/lib/pleroma/emoji.ex index 87c7f2cec..6390cce4c 100644 --- a/lib/pleroma/emoji.ex +++ b/lib/pleroma/emoji.ex @@ -6,7 +6,7 @@ defmodule Pleroma.Emoji do @moduledoc """ The emojis are loaded from: - * the built-in Finmojis (if enabled in configuration), + * emoji packs in INSTANCE-DIR/emoji * the files: `config/emoji.txt` and `config/custom_emoji.txt` * glob paths, nested folder is used as tag name for grouping e.g. priv/static/emoji/custom/nested_folder @@ -14,6 +14,8 @@ defmodule Pleroma.Emoji do """ use GenServer + require Logger + @type pattern :: Regex.t() | module() | String.t() @type patterns :: pattern() | [pattern()] @type group_patterns :: keyword(patterns()) @@ -79,95 +81,94 @@ def code_change(_old_vsn, state, _extra) do end defp load do - finmoji_enabled = Keyword.get(Application.get_env(:pleroma, :instance), :finmoji_enabled) + emoji_dir_path = + Path.join( + Pleroma.Config.get!([:instance, :static_dir]), + "emoji" + ) + + case File.ls(emoji_dir_path) do + {:error, :enoent} -> + # The custom emoji directory doesn't exist, + # don't do anything + nil + + {:error, e} -> + # There was some other error + Logger.error("Could not access the custom emoji directory #{emoji_dir_path}: #{e}") + + {:ok, packs} -> + # Print the packs we've found + Logger.info("Found emoji packs: #{Enum.join(packs, ", ")}") + + emojis = + Enum.flat_map( + packs, + fn pack -> load_pack(Path.join(emoji_dir_path, pack)) end + ) + + true = :ets.insert(@ets, emojis) + end + + # Compat thing for old custom emoji handling & default emoji, + # it should run even if there are no emoji packs shortcode_globs = Application.get_env(:pleroma, :emoji)[:shortcode_globs] || [] emojis = - (load_finmoji(finmoji_enabled) ++ - load_from_file("config/emoji.txt") ++ + (load_from_file("config/emoji.txt") ++ load_from_file("config/custom_emoji.txt") ++ load_from_globs(shortcode_globs)) |> Enum.reject(fn value -> value == nil end) true = :ets.insert(@ets, emojis) + :ok end - @finmoji [ - "a_trusted_friend", - "alandislands", - "association", - "auroraborealis", - "baby_in_a_box", - "bear", - "black_gold", - "christmasparty", - "crosscountryskiing", - "cupofcoffee", - "education", - "fashionista_finns", - "finnishlove", - "flag", - "forest", - "four_seasons_of_bbq", - "girlpower", - "handshake", - "happiness", - "headbanger", - "icebreaker", - "iceman", - "joulutorttu", - "kaamos", - "kalsarikannit_f", - "kalsarikannit_m", - "karjalanpiirakka", - "kicksled", - "kokko", - "lavatanssit", - "losthopes_f", - "losthopes_m", - "mattinykanen", - "meanwhileinfinland", - "moominmamma", - "nordicfamily", - "out_of_office", - "peacemaker", - "perkele", - "pesapallo", - "polarbear", - "pusa_hispida_saimensis", - "reindeer", - "sami", - "sauna_f", - "sauna_m", - "sauna_whisk", - "sisu", - "stuck", - "suomimainittu", - "superfood", - "swan", - "the_cap", - "the_conductor", - "the_king", - "the_voice", - "theoriginalsanta", - "tomoffinland", - "torillatavataan", - "unbreakable", - "waiting", - "white_nights", - "woollysocks" - ] + defp load_pack(pack_dir) do + pack_name = Path.basename(pack_dir) - defp load_finmoji(true) do - Enum.map(@finmoji, fn finmoji -> - file_name = "/finmoji/128px/#{finmoji}-128.png" - group = match_extra(@groups, file_name) - {finmoji, file_name, to_string(group)} - end) + emoji_txt = Path.join(pack_dir, "emoji.txt") + + if File.exists?(emoji_txt) do + load_from_file(emoji_txt) + else + Logger.info( + "No emoji.txt found for pack \"#{pack_name}\", assuming all .png files are emoji" + ) + + make_shortcode_to_file_map(pack_dir, [".png"]) + |> Enum.map(fn {shortcode, rel_file} -> + filename = Path.join("/emoji/#{pack_name}", rel_file) + + {shortcode, filename, [to_string(match_extra(@groups, filename))]} + end) + end end - defp load_finmoji(_), do: [] + def make_shortcode_to_file_map(pack_dir, exts) do + find_all_emoji(pack_dir, exts) + |> Enum.map(&Path.relative_to(&1, pack_dir)) + |> Enum.map(fn f -> {f |> Path.basename() |> Path.rootname(), f} end) + |> Enum.into(%{}) + end + + def find_all_emoji(dir, exts) do + Enum.reduce( + File.ls!(dir), + [], + fn f, acc -> + filepath = Path.join(dir, f) + + if File.dir?(filepath) do + acc ++ find_all_emoji(filepath, exts) + else + acc ++ [filepath] + end + end + ) + |> Enum.filter(fn f -> Path.extname(f) in exts end) + end defp load_from_file(file) do if File.exists?(file) do @@ -182,11 +183,11 @@ defp load_from_file_stream(stream) do |> Stream.map(&String.trim/1) |> Stream.map(fn line -> case String.split(line, ~r/,\s*/) do - [name, file, tags] -> - {name, file, tags} - [name, file] -> - {name, file, to_string(match_extra(@groups, file))} + {name, file, [to_string(match_extra(@groups, file))]} + + [name, file | tags] -> + {name, file, tags} _ -> nil @@ -209,7 +210,7 @@ defp load_from_globs(globs) do tag = match_extra(@groups, Path.join("/", Path.relative_to(path, static_path))) shortcode = Path.basename(path, Path.extname(path)) external_path = Path.join("/", Path.relative_to(path, static_path)) - {shortcode, external_path, to_string(tag)} + {shortcode, external_path, [to_string(tag)]} end) end diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex index 8ea9dbd38..dab8910c1 100644 --- a/lib/pleroma/formatter.ex +++ b/lib/pleroma/formatter.ex @@ -9,20 +9,31 @@ defmodule Pleroma.Formatter do alias Pleroma.Web.MediaProxy @safe_mention_regex ~r/^(\s*(?@.+?\s+)+)(?.*)/ + @link_regex ~r"((?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~%:/?#[\]@!\$&'\(\)\*\+,;=.]+)|[0-9a-z+\-\.]+:[0-9a-z$-_.+!*'(),]+"ui @markdown_characters_regex ~r/(`|\*|_|{|}|[|]|\(|\)|#|\+|-|\.|!)/ - @link_regex ~r{((?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~%:/?#[\]@!\$&'\(\)\*\+,;=.]+)|[0-9a-z+\-\.]+:[0-9a-z$-_.+!*'(),]+}ui - # credo:disable-for-previous-line Credo.Check.Readability.MaxLineLength @auto_linker_config hashtag: true, hashtag_handler: &Pleroma.Formatter.hashtag_handler/4, mention: true, mention_handler: &Pleroma.Formatter.mention_handler/4 + def escape_mention_handler("@" <> nickname = mention, buffer, _, _) do + case User.get_cached_by_nickname(nickname) do + %User{} -> + # escape markdown characters with `\\` + # (we don't want something like @user__name to be parsed by markdown) + String.replace(mention, @markdown_characters_regex, "\\\\\\1") + + _ -> + buffer + end + end + def mention_handler("@" <> nickname, buffer, opts, acc) do case User.get_cached_by_nickname(nickname) do %User{id: id} = user -> ap_id = get_ap_id(user) - nickname_text = get_nickname_text(nickname, opts) |> maybe_escape(opts) + nickname_text = get_nickname_text(nickname, opts) link = "@#{ @@ -70,6 +81,25 @@ def linkify(text, options \\ []) do end end + @doc """ + Escapes a special characters in mention names. + """ + def mentions_escape(text, options \\ []) do + options = + Keyword.merge(options, + mention: true, + url: false, + mention_handler: &Pleroma.Formatter.escape_mention_handler/4 + ) + + if options[:safe_mention] && Regex.named_captures(@safe_mention_regex, text) do + %{"mentions" => mentions, "rest" => rest} = Regex.named_captures(@safe_mention_regex, text) + AutoLinker.link(mentions, options) <> AutoLinker.link(rest, options) + else + AutoLinker.link(text, options) + end + end + def emojify(text) do emojify(text, Emoji.get_all()) end @@ -140,10 +170,4 @@ defp get_ap_id(%User{ap_id: ap_id}), do: ap_id defp get_nickname_text(nickname, %{mentions_format: :full}), do: User.full_nickname(nickname) defp get_nickname_text(nickname, _), do: User.local_nickname(nickname) - - defp maybe_escape(str, %{mentions_escape: true}) do - String.replace(str, @markdown_characters_regex, "\\\\\\1") - end - - defp maybe_escape(str, _), do: str end diff --git a/lib/pleroma/gopher/server.ex b/lib/pleroma/gopher/server.ex index 6a56a6f67..1d2e0785c 100644 --- a/lib/pleroma/gopher/server.ex +++ b/lib/pleroma/gopher/server.ex @@ -38,6 +38,7 @@ def init([ip, port]) do defmodule Pleroma.Gopher.Server.ProtocolHandler do alias Pleroma.Activity alias Pleroma.HTML + alias Pleroma.Object alias Pleroma.User alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.Visibility @@ -75,14 +76,14 @@ def render_activities(activities) do |> Enum.map(fn activity -> user = User.get_cached_by_ap_id(activity.data["actor"]) - object = activity.data["object"] + object = Object.normalize(activity) like_count = object["like_count"] || 0 announcement_count = object["announcement_count"] || 0 link("Post ##{activity.id} by #{user.nickname}", "/notices/#{activity.id}") <> info("#{like_count} likes, #{announcement_count} repeats") <> "i\tfake\t(NULL)\t0\r\n" <> - info(HTML.strip_tags(String.replace(activity.data["object"]["content"], "
", "\r"))) + info(HTML.strip_tags(String.replace(object["content"], "
", "\r"))) end) |> Enum.join("i\tfake\t(NULL)\t0\r\n") end diff --git a/lib/pleroma/html.ex b/lib/pleroma/html.ex index 7f1dbe28c..cf6c0ee0a 100644 --- a/lib/pleroma/html.ex +++ b/lib/pleroma/html.ex @@ -32,7 +32,8 @@ def get_cached_scrubbed_html_for_activity(content, scrubbers, activity, key \\ " key = "#{key}#{generate_scrubber_signature(scrubbers)}|#{activity.id}" Cachex.fetch!(:scrubber_cache, key, fn _key -> - ensure_scrubbed_html(content, scrubbers, activity.data["object"]["fake"] || false) + object = Pleroma.Object.normalize(activity) + ensure_scrubbed_html(content, scrubbers, object.data["fake"] || false) end) end @@ -105,7 +106,14 @@ defmodule Pleroma.HTML.Scrubber.TwitterText do # links Meta.allow_tag_with_uri_attributes("a", ["href", "data-user", "data-tag"], @valid_schemes) - Meta.allow_tag_with_these_attributes("a", ["name", "title", "class"]) + + Meta.allow_tag_with_this_attribute_values("a", "class", [ + "hashtag", + "u-url", + "mention", + "u-url mention", + "mention u-url" + ]) Meta.allow_tag_with_this_attribute_values("a", "rel", [ "tag", @@ -114,12 +122,15 @@ defmodule Pleroma.HTML.Scrubber.TwitterText do "noreferrer" ]) + Meta.allow_tag_with_these_attributes("a", ["name", "title"]) + # paragraphs and linebreaks Meta.allow_tag_with_these_attributes("br", []) Meta.allow_tag_with_these_attributes("p", []) # microformats - Meta.allow_tag_with_these_attributes("span", ["class"]) + Meta.allow_tag_with_this_attribute_values("span", "class", ["h-card"]) + Meta.allow_tag_with_these_attributes("span", []) # allow inline images for custom emoji @allow_inline_images Keyword.get(@markup, :allow_inline_images) @@ -154,7 +165,14 @@ defmodule Pleroma.HTML.Scrubber.Default do Meta.strip_comments() Meta.allow_tag_with_uri_attributes("a", ["href", "data-user", "data-tag"], @valid_schemes) - Meta.allow_tag_with_these_attributes("a", ["name", "title", "class"]) + + Meta.allow_tag_with_this_attribute_values("a", "class", [ + "hashtag", + "u-url", + "mention", + "u-url mention", + "mention u-url" + ]) Meta.allow_tag_with_this_attribute_values("a", "rel", [ "tag", @@ -163,6 +181,8 @@ defmodule Pleroma.HTML.Scrubber.Default do "noreferrer" ]) + Meta.allow_tag_with_these_attributes("a", ["name", "title"]) + Meta.allow_tag_with_these_attributes("abbr", ["title"]) Meta.allow_tag_with_these_attributes("b", []) @@ -176,11 +196,13 @@ defmodule Pleroma.HTML.Scrubber.Default do Meta.allow_tag_with_these_attributes("ol", []) Meta.allow_tag_with_these_attributes("p", []) Meta.allow_tag_with_these_attributes("pre", []) - Meta.allow_tag_with_these_attributes("span", ["class"]) Meta.allow_tag_with_these_attributes("strong", []) Meta.allow_tag_with_these_attributes("u", []) Meta.allow_tag_with_these_attributes("ul", []) + Meta.allow_tag_with_this_attribute_values("span", "class", ["h-card"]) + Meta.allow_tag_with_these_attributes("span", []) + @allow_inline_images Keyword.get(@markup, :allow_inline_images) if @allow_inline_images do diff --git a/lib/pleroma/list.ex b/lib/pleroma/list.ex index 110be8355..a5b1cad68 100644 --- a/lib/pleroma/list.ex +++ b/lib/pleroma/list.ex @@ -80,7 +80,7 @@ def get_lists_from_activity(%Activity{actor: ap_id}) do # Get lists to which the account belongs. def get_lists_account_belongs(%User{} = owner, account_id) do - user = User.get_by_id(account_id) + user = User.get_cached_by_id(account_id) query = from( diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex index 15789907a..dd274cf6b 100644 --- a/lib/pleroma/notification.ex +++ b/lib/pleroma/notification.ex @@ -98,6 +98,14 @@ def clear(user) do |> Repo.delete_all() end + def destroy_multiple(%{id: user_id} = _user, ids) do + from(n in Notification, + where: n.id in ^ids, + where: n.user_id == ^user_id + ) + |> Repo.delete_all() + end + def dismiss(%{id: user_id} = _user, id) do notification = Repo.get(Notification, id) @@ -173,8 +181,7 @@ def skip?(:local, %{local: false}, %{info: %{notification_settings: %{"remote" = def skip?(:muted, activity, user) do actor = activity.data["actor"] - User.mutes?(user, %{ap_id: actor}) or - CommonAPI.thread_muted?(user, activity) + User.mutes?(user, %{ap_id: actor}) or CommonAPI.thread_muted?(user, activity) end def skip?( @@ -189,7 +196,7 @@ def skip?( def skip?(:follows, activity, %{info: %{notification_settings: %{"follows" => false}}} = user) do actor = activity.data["actor"] - followed = User.get_by_ap_id(actor) + followed = User.get_cached_by_ap_id(actor) User.following?(user, followed) end diff --git a/lib/pleroma/object.ex b/lib/pleroma/object.ex index 013d62157..740d687a3 100644 --- a/lib/pleroma/object.ex +++ b/lib/pleroma/object.ex @@ -7,6 +7,7 @@ defmodule Pleroma.Object do alias Pleroma.Activity alias Pleroma.Object + alias Pleroma.Object.Fetcher alias Pleroma.ObjectTombstone alias Pleroma.Repo alias Pleroma.User @@ -40,41 +41,44 @@ def get_by_ap_id(ap_id) do Repo.one(from(object in Object, where: fragment("(?)->>'id' = ?", object.data, ^ap_id))) end + def normalize(_, fetch_remote \\ true) # If we pass an Activity to Object.normalize(), we can try to use the preloaded object. # Use this whenever possible, especially when walking graphs in an O(N) loop! - def normalize(%Activity{object: %Object{} = object}), do: object + def normalize(%Object{} = object, _), do: object + def normalize(%Activity{object: %Object{} = object}, _), do: object # A hack for fake activities - def normalize(%Activity{data: %{"object" => %{"fake" => true} = data}}) do + def normalize(%Activity{data: %{"object" => %{"fake" => true} = data}}, _) do %Object{id: "pleroma:fake_object_id", data: data} end # Catch and log Object.normalize() calls where the Activity's child object is not # preloaded. - def normalize(%Activity{data: %{"object" => %{"id" => ap_id}}}) do + def normalize(%Activity{data: %{"object" => %{"id" => ap_id}}}, fetch_remote) do Logger.debug( "Object.normalize() called without preloaded object (#{ap_id}). Consider preloading the object!" ) Logger.debug("Backtrace: #{inspect(Process.info(:erlang.self(), :current_stacktrace))}") - normalize(ap_id) + normalize(ap_id, fetch_remote) end - def normalize(%Activity{data: %{"object" => ap_id}}) do + def normalize(%Activity{data: %{"object" => ap_id}}, fetch_remote) do Logger.debug( "Object.normalize() called without preloaded object (#{ap_id}). Consider preloading the object!" ) Logger.debug("Backtrace: #{inspect(Process.info(:erlang.self(), :current_stacktrace))}") - normalize(ap_id) + normalize(ap_id, fetch_remote) end # Old way, try fetching the object through cache. - def normalize(%{"id" => ap_id}), do: normalize(ap_id) - def normalize(ap_id) when is_binary(ap_id), do: get_cached_by_ap_id(ap_id) - def normalize(_), do: nil + def normalize(%{"id" => ap_id}, fetch_remote), do: normalize(ap_id, fetch_remote) + def normalize(ap_id, false) when is_binary(ap_id), do: get_cached_by_ap_id(ap_id) + def normalize(ap_id, true) when is_binary(ap_id), do: Fetcher.fetch_object_from_id!(ap_id) + def normalize(_, _), do: nil # Owned objects can only be mutated by their owner def authorize_mutation(%Object{data: %{"actor" => actor}}, %User{ap_id: ap_id}), diff --git a/lib/pleroma/object/containment.ex b/lib/pleroma/object/containment.ex new file mode 100644 index 000000000..25bd911fb --- /dev/null +++ b/lib/pleroma/object/containment.ex @@ -0,0 +1,61 @@ +defmodule Pleroma.Object.Containment do + @moduledoc """ + # Object Containment + + This module contains some useful functions for containing objects to specific + origins and determining those origins. They previously lived in the + ActivityPub `Transmogrifier` module. + + Object containment is an important step in validating remote objects to prevent + spoofing, therefore removal of object containment functions is NOT recommended. + """ + def get_actor(%{"actor" => actor}) when is_binary(actor) do + actor + end + + def get_actor(%{"actor" => actor}) when is_list(actor) do + if is_binary(Enum.at(actor, 0)) do + Enum.at(actor, 0) + else + Enum.find(actor, fn %{"type" => type} -> type in ["Person", "Service", "Application"] end) + |> Map.get("id") + end + end + + def get_actor(%{"actor" => %{"id" => id}}) when is_bitstring(id) do + id + end + + def get_actor(%{"actor" => nil, "attributedTo" => actor}) when not is_nil(actor) do + get_actor(%{"actor" => actor}) + end + + @doc """ + Checks that an imported AP object's actor matches the domain it came from. + """ + def contain_origin(_id, %{"actor" => nil}), do: :error + + def contain_origin(id, %{"actor" => _actor} = params) do + id_uri = URI.parse(id) + actor_uri = URI.parse(get_actor(params)) + + if id_uri.host == actor_uri.host do + :ok + else + :error + end + end + + def contain_origin_from_id(_id, %{"id" => nil}), do: :error + + def contain_origin_from_id(id, %{"id" => other_id} = _params) do + id_uri = URI.parse(id) + other_uri = URI.parse(other_id) + + if id_uri.host == other_uri.host do + :ok + else + :error + end + end +end diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex new file mode 100644 index 000000000..8d4bcc95e --- /dev/null +++ b/lib/pleroma/object/fetcher.ex @@ -0,0 +1,75 @@ +defmodule Pleroma.Object.Fetcher do + alias Pleroma.Object + alias Pleroma.Object.Containment + alias Pleroma.Web.ActivityPub.Transmogrifier + alias Pleroma.Web.OStatus + + require Logger + + @httpoison Application.get_env(:pleroma, :httpoison) + + # TODO: + # This will create a Create activity, which we need internally at the moment. + def fetch_object_from_id(id) do + if object = Object.get_cached_by_ap_id(id) do + {:ok, object} + else + Logger.info("Fetching #{id} via AP") + + with {:ok, data} <- fetch_and_contain_remote_object_from_id(id), + nil <- Object.normalize(data, false), + params <- %{ + "type" => "Create", + "to" => data["to"], + "cc" => data["cc"], + "actor" => data["actor"] || data["attributedTo"], + "object" => data + }, + :ok <- Containment.contain_origin(id, params), + {:ok, activity} <- Transmogrifier.handle_incoming(params) do + {:ok, Object.normalize(activity, false)} + else + {:error, {:reject, nil}} -> + {:reject, nil} + + object = %Object{} -> + {:ok, object} + + _e -> + Logger.info("Couldn't get object via AP, trying out OStatus fetching...") + + case OStatus.fetch_activity_from_url(id) do + {:ok, [activity | _]} -> {:ok, Object.normalize(activity, false)} + e -> e + end + end + end + end + + def fetch_object_from_id!(id) do + with {:ok, object} <- fetch_object_from_id(id) do + object + else + _e -> + nil + end + end + + def fetch_and_contain_remote_object_from_id(id) do + Logger.info("Fetching object #{id} via AP") + + with true <- String.starts_with?(id, "http"), + {:ok, %{body: body, status: code}} when code in 200..299 <- + @httpoison.get( + id, + [{:Accept, "application/activity+json"}] + ), + {:ok, data} <- Jason.decode(body), + :ok <- Containment.contain_origin_from_id(id, data) do + {:ok, data} + else + e -> + {:error, e} + end + end +end diff --git a/lib/pleroma/pagination.ex b/lib/pleroma/pagination.ex index 7c864deef..f435e5c9c 100644 --- a/lib/pleroma/pagination.ex +++ b/lib/pleroma/pagination.ex @@ -36,6 +36,12 @@ defp cast_params(params) do limit: :integer } + params = + Enum.reduce(params, %{}, fn + {key, _value}, acc when is_atom(key) -> Map.drop(acc, [key]) + {key, value}, acc -> Map.put(acc, key, value) + end) + changeset = cast({%{}, param_types}, params, Map.keys(param_types)) changeset.changes end diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 6e2269aff..c5b1ddc5d 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -10,6 +10,7 @@ defmodule Pleroma.User do alias Comeonin.Pbkdf2 alias Pleroma.Activity + alias Pleroma.Bookmark alias Pleroma.Formatter alias Pleroma.Notification alias Pleroma.Object @@ -53,8 +54,8 @@ defmodule Pleroma.User do field(:search_rank, :float, virtual: true) field(:search_type, :integer, virtual: true) field(:tags, {:array, :string}, default: []) - field(:bookmarks, {:array, :string}, default: []) field(:last_refreshed_at, :naive_datetime_usec) + has_many(:bookmarks, Bookmark) has_many(:notifications, Notification) has_many(:registrations, Registration) embeds_one(:info, Pleroma.User.Info) @@ -269,6 +270,7 @@ defp autofollow_users(user) do def register(%Ecto.Changeset{} = changeset) do with {:ok, user} <- Repo.insert(changeset), {:ok, user} <- autofollow_users(user), + {:ok, user} <- set_cache(user), {:ok, _} <- Pleroma.User.WelcomeMessage.post_welcome_message_to_user(user), {:ok, _} <- try_send_confirmation_email(user) do {:ok, user} @@ -279,8 +281,10 @@ def try_send_confirmation_email(%User{} = user) do if user.info.confirmation_pending && Pleroma.Config.get([:instance, :account_activation_required]) do user - |> Pleroma.UserEmail.account_confirmation_email() - |> Pleroma.Mailer.deliver_async() + |> Pleroma.Emails.UserEmail.account_confirmation_email() + |> Pleroma.Emails.Mailer.deliver_async() + + {:ok, :enqueued} else {:ok, :noop} end @@ -451,10 +455,13 @@ def get_by_guessed_nickname(ap_id) do name = List.last(String.split(ap_id, "/")) nickname = "#{name}@#{domain}" - get_by_nickname(nickname) + get_cached_by_nickname(nickname) end - def set_cache(user) do + def set_cache({:ok, user}), do: set_cache(user) + def set_cache({:error, err}), do: {:error, err} + + def set_cache(%User{} = user) do Cachex.put(:user_cache, "ap_id:#{user.ap_id}", user) Cachex.put(:user_cache, "nickname:#{user.nickname}", user) Cachex.put(:user_cache, "user_info:#{user.id}", user_info(user)) @@ -542,6 +549,7 @@ def get_or_fetch_by_nickname(nickname) do with [_nick, _domain] <- String.split(nickname, "@"), {:ok, user} <- fetch_by_nickname(nickname) do if Pleroma.Config.get([:fetch_initial_posts, :enabled]) do + # TODO turn into job {:ok, _} = Task.start(__MODULE__, :fetch_initial_posts, [user]) end @@ -1000,7 +1008,7 @@ def block(blocker, %User{ap_id: ap_id} = blocked) do # helper to handle the block given only an actor's AP id def block(blocker, %{ap_id: ap_id}) do - block(blocker, User.get_by_ap_id(ap_id)) + block(blocker, get_cached_by_ap_id(ap_id)) end def unblock(blocker, %{ap_id: ap_id}) do @@ -1030,7 +1038,7 @@ def blocks?(user, %{ap_id: ap_id}) do end def subscribed_to?(user, %{ap_id: ap_id}) do - with %User{} = target <- User.get_by_ap_id(ap_id) do + with %User{} = target <- get_cached_by_ap_id(ap_id) do Enum.member?(target.info.subscribers, user.ap_id) end end @@ -1205,7 +1213,7 @@ def fetch_by_ap_id(ap_id) do end def get_or_fetch_by_ap_id(ap_id) do - user = get_by_ap_id(ap_id) + user = get_cached_by_ap_id(ap_id) if !is_nil(user) and !User.needs_update?(user) do user @@ -1228,7 +1236,7 @@ def get_or_fetch_by_ap_id(ap_id) do def get_or_create_instance_user do relay_uri = "#{Pleroma.Web.Endpoint.url()}/relay" - if user = get_by_ap_id(relay_uri) do + if user = get_cached_by_ap_id(relay_uri) do user else changes = @@ -1275,13 +1283,11 @@ defp blank?(""), do: nil defp blank?(n), do: n def insert_or_update_user(data) do - data = - data - |> Map.put(:name, blank?(data[:name]) || data[:nickname]) - - cs = User.remote_user_creation(data) - - Repo.insert(cs, on_conflict: :replace_all, conflict_target: :nickname) + data + |> Map.put(:name, blank?(data[:name]) || data[:nickname]) + |> remote_user_creation() + |> Repo.insert(on_conflict: :replace_all, conflict_target: :nickname) + |> set_cache() end def ap_enabled?(%User{local: true}), do: true @@ -1297,8 +1303,8 @@ def get_or_fetch(nickname), do: get_or_fetch_by_nickname(nickname) # this is because we have synchronous follow APIs and need to simulate them # with an async handshake def wait_and_refresh(_, %User{local: true} = a, %User{local: true} = b) do - with %User{} = a <- User.get_by_id(a.id), - %User{} = b <- User.get_by_id(b.id) do + with %User{} = a <- User.get_cached_by_id(a.id), + %User{} = b <- User.get_cached_by_id(b.id) do {:ok, a, b} else _e -> @@ -1308,8 +1314,8 @@ def wait_and_refresh(_, %User{local: true} = a, %User{local: true} = b) do def wait_and_refresh(timeout, %User{} = a, %User{} = b) do with :ok <- :timer.sleep(timeout), - %User{} = a <- User.get_by_id(a.id), - %User{} = b <- User.get_by_id(b.id) do + %User{} = a <- User.get_cached_by_id(a.id), + %User{} = b <- User.get_cached_by_id(b.id) do {:ok, a, b} else _e -> @@ -1348,7 +1354,7 @@ def tag(user_identifiers, tags) when is_list(user_identifiers) do end def tag(nickname, tags) when is_binary(nickname), - do: tag(User.get_by_nickname(nickname), tags) + do: tag(get_by_nickname(nickname), tags) def tag(%User{} = user, tags), do: update_tags(user, Enum.uniq((user.tags || []) ++ normalize_tags(tags))) @@ -1360,7 +1366,7 @@ def untag(user_identifiers, tags) when is_list(user_identifiers) do end def untag(nickname, tags) when is_binary(nickname), - do: untag(User.get_by_nickname(nickname), tags) + do: untag(get_by_nickname(nickname), tags) def untag(%User{} = user, tags), do: update_tags(user, (user.tags || []) -- normalize_tags(tags)) @@ -1374,22 +1380,6 @@ defp update_tags(%User{} = user, new_tags) do updated_user end - def bookmark(%User{} = user, status_id) do - bookmarks = Enum.uniq(user.bookmarks ++ [status_id]) - update_bookmarks(user, bookmarks) - end - - def unbookmark(%User{} = user, status_id) do - bookmarks = Enum.uniq(user.bookmarks -- [status_id]) - update_bookmarks(user, bookmarks) - end - - def update_bookmarks(%User{} = user, bookmarks) do - user - |> change(%{bookmarks: bookmarks}) - |> update_and_set_cache - end - defp normalize_tags(tags) do [tags] |> List.flatten() diff --git a/lib/pleroma/user/info.ex b/lib/pleroma/user/info.ex index 5afa7988c..a3658d57f 100644 --- a/lib/pleroma/user/info.ex +++ b/lib/pleroma/user/info.ex @@ -38,6 +38,7 @@ defmodule Pleroma.User.Info do field(:salmon, :string, default: nil) field(:hide_followers, :boolean, default: false) field(:hide_follows, :boolean, default: false) + field(:hide_favorites, :boolean, default: true) field(:pinned_activities, {:array, :string}, default: []) field(:flavour, :string, default: nil) @@ -202,6 +203,7 @@ def profile_update(info, params) do :banner, :hide_follows, :hide_followers, + :hide_favorites, :background, :show_role ]) @@ -225,14 +227,6 @@ def confirmation_changeset(info, params) do cast(info, params, [:confirmation_pending, :confirmation_token]) end - def mastodon_profile_update(info, params) do - info - |> cast(params, [ - :locked, - :banner - ]) - end - def mastodon_settings_update(info, settings) do params = %{settings: settings} diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index f217e7bac..604ffae7b 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -7,13 +7,14 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do alias Pleroma.Instances alias Pleroma.Notification alias Pleroma.Object + alias Pleroma.Object.Fetcher + alias Pleroma.Pagination alias Pleroma.Repo alias Pleroma.Upload alias Pleroma.User alias Pleroma.Web.ActivityPub.MRF alias Pleroma.Web.ActivityPub.Transmogrifier alias Pleroma.Web.Federator - alias Pleroma.Web.OStatus alias Pleroma.Web.WebFinger import Ecto.Query @@ -90,12 +91,10 @@ def decrease_note_count_if_public(actor, object) do end def increase_replies_count_if_reply(%{ - "object" => - %{"inReplyTo" => reply_ap_id, "inReplyToStatusId" => reply_status_id} = object, + "object" => %{"inReplyTo" => reply_ap_id} = object, "type" => "Create" }) do if is_public?(object) do - Activity.increase_replies_count(reply_status_id) Object.increase_replies_count(reply_ap_id) end end @@ -103,10 +102,9 @@ def increase_replies_count_if_reply(%{ def increase_replies_count_if_reply(_create_data), do: :noop def decrease_replies_count_if_reply(%Object{ - data: %{"inReplyTo" => reply_ap_id, "inReplyToStatusId" => reply_status_id} = object + data: %{"inReplyTo" => reply_ap_id} = object }) do if is_public?(object) do - Activity.decrease_replies_count(reply_status_id) Object.decrease_replies_count(reply_ap_id) end end @@ -121,7 +119,7 @@ def insert(map, local \\ true, fake \\ false) when is_map(map) do {:ok, map} <- MRF.filter(map), {recipients, _, _} = get_recipients(map), {:fake, false, map, recipients} <- {:fake, fake, map, recipients}, - {:ok, object} <- insert_full_object(map) do + {:ok, map, object} <- insert_full_object(map) do {:ok, activity} = Repo.insert(%Activity{ data: map, @@ -170,6 +168,7 @@ def stream_out(activity) do public = "https://www.w3.org/ns/activitystreams#Public" if activity.data["type"] in ["Create", "Announce", "Delete"] do + object = Object.normalize(activity) Pleroma.Web.Streamer.stream("user", activity) Pleroma.Web.Streamer.stream("list", activity) @@ -181,12 +180,12 @@ def stream_out(activity) do end if activity.data["type"] in ["Create"] do - activity.data["object"] + object.data |> Map.get("tag", []) |> Enum.filter(fn tag -> is_bitstring(tag) end) |> Enum.each(fn tag -> Pleroma.Web.Streamer.stream("hashtag:" <> tag, activity) end) - if activity.data["object"]["attachment"] != [] do + if object.data["attachment"] != [] do Pleroma.Web.Streamer.stream("public:media", activity) if activity.local do @@ -198,7 +197,7 @@ def stream_out(activity) do if !Enum.member?(activity.data["cc"] || [], public) && !Enum.member?( activity.data["to"], - User.get_by_ap_id(activity.data["actor"]).follower_address + User.get_cached_by_ap_id(activity.data["actor"]).follower_address ), do: Pleroma.Web.Streamer.stream("direct", activity) end @@ -449,8 +448,8 @@ def flag( :ok <- maybe_federate(activity) do Enum.each(User.all_superusers(), fn superuser -> superuser - |> Pleroma.AdminEmail.report(actor, account, statuses, content) - |> Pleroma.Mailer.deliver_async() + |> Pleroma.Emails.AdminEmail.report(actor, account, statuses, content) + |> Pleroma.Emails.Mailer.deliver_async() end) {:ok, activity} @@ -493,7 +492,7 @@ def fetch_public_activities(opts \\ %{}) do q |> restrict_unlisted() - |> Repo.all() + |> Pagination.fetch_paginated(opts) |> Enum.reverse() end @@ -572,37 +571,49 @@ defp restrict_since(query, %{"since_id" => since_id}) do defp restrict_since(query, _), do: query + defp restrict_tag_reject(_query, %{"tag_reject" => _tag_reject, "skip_preload" => true}) do + raise "Can't use the child object without preloading!" + end + defp restrict_tag_reject(query, %{"tag_reject" => tag_reject}) when is_list(tag_reject) and tag_reject != [] do from( - activity in query, - where: fragment(~s(\(not \(? #> '{"object","tag"}'\) \\?| ?\)), activity.data, ^tag_reject) + [_activity, object] in query, + where: fragment("not (?)->'tag' \\?| (?)", object.data, ^tag_reject) ) end defp restrict_tag_reject(query, _), do: query + defp restrict_tag_all(_query, %{"tag_all" => _tag_all, "skip_preload" => true}) do + raise "Can't use the child object without preloading!" + end + defp restrict_tag_all(query, %{"tag_all" => tag_all}) when is_list(tag_all) and tag_all != [] do from( - activity in query, - where: fragment(~s(\(? #> '{"object","tag"}'\) \\?& ?), activity.data, ^tag_all) + [_activity, object] in query, + where: fragment("(?)->'tag' \\?& (?)", object.data, ^tag_all) ) end defp restrict_tag_all(query, _), do: query + defp restrict_tag(_query, %{"tag" => _tag, "skip_preload" => true}) do + raise "Can't use the child object without preloading!" + end + defp restrict_tag(query, %{"tag" => tag}) when is_list(tag) do from( - activity in query, - where: fragment(~s(\(? #> '{"object","tag"}'\) \\?| ?), activity.data, ^tag) + [_activity, object] in query, + where: fragment("(?)->'tag' \\?| (?)", object.data, ^tag) ) end defp restrict_tag(query, %{"tag" => tag}) when is_binary(tag) do from( - activity in query, - where: fragment(~s(? <@ (? #> '{"object","tag"}'\)), ^tag, activity.data) + [_activity, object] in query, + where: fragment("(?)->'tag' \\? (?)", object.data, ^tag) ) end @@ -636,26 +647,12 @@ defp restrict_recipients(query, recipients, user) do ) end - defp restrict_limit(query, %{"limit" => limit}) do - from(activity in query, limit: ^limit) - end - - defp restrict_limit(query, _), do: query - defp restrict_local(query, %{"local_only" => true}) do from(activity in query, where: activity.local == true) end defp restrict_local(query, _), do: query - defp restrict_max(query, %{"max_id" => ""}), do: query - - defp restrict_max(query, %{"max_id" => max_id}) do - from(activity in query, where: activity.id < ^max_id) - end - - defp restrict_max(query, _), do: query - defp restrict_actor(query, %{"actor_id" => actor_id}) do from(activity in query, where: activity.actor == ^actor_id) end @@ -681,10 +678,14 @@ defp restrict_favorited_by(query, %{"favorited_by" => ap_id}) do defp restrict_favorited_by(query, _), do: query + defp restrict_media(_query, %{"only_media" => _val, "skip_preload" => true}) do + raise "Can't use the child object without preloading!" + end + defp restrict_media(query, %{"only_media" => val}) when val == "true" or val == "1" do from( - activity in query, - where: fragment(~s(not (? #> '{"object","attachment"}' = ?\)), activity.data, ^[]) + [_activity, object] in query, + where: fragment("not (?)->'attachment' = (?)", object.data, ^[]) ) end @@ -726,7 +727,14 @@ defp restrict_blocked(query, %{"blocking_user" => %User{info: info}}) do from( activity in query, where: fragment("not (? = ANY(?))", activity.actor, ^blocks), - where: fragment("not (?->'to' \\?| ?)", activity.data, ^blocks), + where: fragment("not (? && ?)", activity.recipients, ^blocks), + where: + fragment( + "not (?->>'type' = 'Announce' and ?->'to' \\?| ?)", + activity.data, + activity.data, + ^blocks + ), where: fragment("not (split_part(?, '/', 3) = ANY(?))", activity.actor, ^domain_blocks) ) end @@ -776,12 +784,7 @@ defp maybe_preload_objects(query, _) do end def fetch_activities_query(recipients, opts \\ %{}) do - base_query = - from( - activity in Activity, - limit: 20, - order_by: [fragment("? desc nulls last", activity.id)] - ) + base_query = from(activity in Activity) base_query |> maybe_preload_objects(opts) @@ -791,8 +794,6 @@ def fetch_activities_query(recipients, opts \\ %{}) do |> restrict_tag_all(opts) |> restrict_since(opts) |> restrict_local(opts) - |> restrict_limit(opts) - |> restrict_max(opts) |> restrict_actor(opts) |> restrict_type(opts) |> restrict_favorited_by(opts) @@ -808,14 +809,14 @@ def fetch_activities_query(recipients, opts \\ %{}) do def fetch_activities(recipients, opts \\ %{}) do fetch_activities_query(recipients, opts) - |> Repo.all() + |> Pagination.fetch_paginated(opts) |> Enum.reverse() end def fetch_activities_bounded(recipients_to, recipients_cc, opts \\ %{}) do fetch_activities_query([], opts) |> restrict_to_cc(recipients_to, recipients_cc) - |> Repo.all() + |> Pagination.fetch_paginated(opts) |> Enum.reverse() end @@ -880,7 +881,7 @@ def user_data_from_user_object(data) do end def fetch_and_prepare_user_from_ap_id(ap_id) do - with {:ok, data} <- fetch_and_contain_remote_object_from_id(ap_id) do + with {:ok, data} <- Fetcher.fetch_and_contain_remote_object_from_id(ap_id) do user_data_from_user_object(data) else e -> Logger.error("Could not decode user at fetch #{ap_id}, #{inspect(e)}") @@ -888,7 +889,7 @@ def fetch_and_prepare_user_from_ap_id(ap_id) do end def make_user_from_ap_id(ap_id) do - if _user = User.get_by_ap_id(ap_id) do + if _user = User.get_cached_by_ap_id(ap_id) do Transmogrifier.upgrade_user_from_ap_id(ap_id) else with {:ok, data} <- fetch_and_prepare_user_from_ap_id(ap_id) do @@ -990,60 +991,6 @@ def publish_one(%{inbox: inbox, json: json, actor: actor, id: id} = params) do end end - # TODO: - # This will create a Create activity, which we need internally at the moment. - def fetch_object_from_id(id) do - if object = Object.get_cached_by_ap_id(id) do - {:ok, object} - else - with {:ok, data} <- fetch_and_contain_remote_object_from_id(id), - nil <- Object.normalize(data), - params <- %{ - "type" => "Create", - "to" => data["to"], - "cc" => data["cc"], - "actor" => data["actor"] || data["attributedTo"], - "object" => data - }, - :ok <- Transmogrifier.contain_origin(id, params), - {:ok, activity} <- Transmogrifier.handle_incoming(params) do - {:ok, Object.normalize(activity)} - else - {:error, {:reject, nil}} -> - {:reject, nil} - - object = %Object{} -> - {:ok, object} - - _e -> - Logger.info("Couldn't get object via AP, trying out OStatus fetching...") - - case OStatus.fetch_activity_from_url(id) do - {:ok, [activity | _]} -> {:ok, Object.normalize(activity)} - e -> e - end - end - end - end - - def fetch_and_contain_remote_object_from_id(id) do - Logger.info("Fetching object #{id} via AP") - - with true <- String.starts_with?(id, "http"), - {:ok, %{body: body, status: code}} when code in 200..299 <- - @httpoison.get( - id, - [{:Accept, "application/activity+json"}] - ), - {:ok, data} <- Jason.decode(body), - :ok <- Transmogrifier.contain_origin_from_id(id, data) do - {:ok, data} - else - e -> - {:error, e} - end - end - # filter out broken threads def contain_broken_threads(%Activity{} = activity, %User{} = user) do entire_thread_visible_for_user?(activity, user) diff --git a/lib/pleroma/web/activity_pub/activity_pub_controller.ex b/lib/pleroma/web/activity_pub/activity_pub_controller.ex index 7091d6927..0b80566bf 100644 --- a/lib/pleroma/web/activity_pub/activity_pub_controller.ex +++ b/lib/pleroma/web/activity_pub/activity_pub_controller.ex @@ -7,6 +7,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do alias Pleroma.Activity alias Pleroma.Object + alias Pleroma.Object.Fetcher alias Pleroma.User alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.ObjectView @@ -153,9 +154,10 @@ def outbox(conn, %{"nickname" => nickname} = params) do end def inbox(%{assigns: %{valid_signature: true}} = conn, %{"nickname" => nickname} = params) do - with %User{} = user <- User.get_cached_by_nickname(nickname), - true <- Utils.recipient_in_message(user.ap_id, params), - params <- Utils.maybe_splice_recipient(user.ap_id, params) do + with %User{} = recipient <- User.get_cached_by_nickname(nickname), + %User{} = actor <- User.get_or_fetch_by_ap_id(params["actor"]), + true <- Utils.recipient_in_message(recipient, actor, params), + params <- Utils.maybe_splice_recipient(recipient.ap_id, params) do Federator.incoming_ap_doc(params) json(conn, "ok") end @@ -172,7 +174,7 @@ def inbox(conn, %{"type" => "Create"} = params) do "Signature missing or not from author, relayed Create message, fetching object from source" ) - ActivityPub.fetch_object_from_id(params["object"]["id"]) + Fetcher.fetch_object_from_id(params["object"]["id"]) json(conn, "ok") end diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index 49ea73204..b1e859d7c 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -8,8 +8,10 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do """ alias Pleroma.Activity alias Pleroma.Object + alias Pleroma.Object.Containment alias Pleroma.Repo alias Pleroma.User + alias Pleroma.User alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.Utils alias Pleroma.Web.ActivityPub.Visibility @@ -18,56 +20,6 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do require Logger - def get_actor(%{"actor" => actor}) when is_binary(actor) do - actor - end - - def get_actor(%{"actor" => actor}) when is_list(actor) do - if is_binary(Enum.at(actor, 0)) do - Enum.at(actor, 0) - else - Enum.find(actor, fn %{"type" => type} -> type in ["Person", "Service", "Application"] end) - |> Map.get("id") - end - end - - def get_actor(%{"actor" => %{"id" => id}}) when is_bitstring(id) do - id - end - - def get_actor(%{"actor" => nil, "attributedTo" => actor}) when not is_nil(actor) do - get_actor(%{"actor" => actor}) - end - - @doc """ - Checks that an imported AP object's actor matches the domain it came from. - """ - def contain_origin(_id, %{"actor" => nil}), do: :error - - def contain_origin(id, %{"actor" => _actor} = params) do - id_uri = URI.parse(id) - actor_uri = URI.parse(get_actor(params)) - - if id_uri.host == actor_uri.host do - :ok - else - :error - end - end - - def contain_origin_from_id(_id, %{"id" => nil}), do: :error - - def contain_origin_from_id(id, %{"id" => other_id} = _params) do - id_uri = URI.parse(id) - other_uri = URI.parse(other_id) - - if id_uri.host == other_uri.host do - :ok - else - :error - end - end - @doc """ Modifies an incoming AP object (mastodon format) to our internal format. """ @@ -188,7 +140,7 @@ def fix_addressing(object) do def fix_actor(%{"attributedTo" => actor} = object) do object - |> Map.put("actor", get_actor(%{"actor" => actor})) + |> Map.put("actor", Containment.get_actor(%{"actor" => actor})) end # Check for standardisation @@ -223,14 +175,13 @@ def fix_in_reply_to(%{"inReplyTo" => in_reply_to} = object) "" end - case fetch_obj_helper(in_reply_to_id) do + case get_obj_helper(in_reply_to_id) do {:ok, replied_object} -> - with %Activity{} = activity <- + with %Activity{} = _activity <- Activity.get_create_by_object_ap_id(replied_object.data["id"]) do object |> Map.put("inReplyTo", replied_object.data["id"]) |> Map.put("inReplyToAtomUri", object["inReplyToAtomUri"] || in_reply_to_id) - |> Map.put("inReplyToStatusId", activity.id) |> Map.put("conversation", replied_object.data["context"] || object["conversation"]) |> Map.put("context", replied_object.data["context"] || object["conversation"]) else @@ -449,7 +400,7 @@ def handle_incoming(%{"id" => id}) when not (is_binary(id) and length(id) > 8), # - emoji def handle_incoming(%{"type" => "Create", "object" => %{"type" => objtype} = object} = data) when objtype in ["Article", "Note", "Video", "Page"] do - actor = get_actor(data) + actor = Containment.get_actor(data) data = Map.put(data, "actor", actor) @@ -487,27 +438,53 @@ def handle_incoming( with %User{local: true} = followed <- User.get_cached_by_ap_id(followed), %User{} = follower <- User.get_or_fetch_by_ap_id(follower), {:ok, activity} <- ActivityPub.follow(follower, followed, id, false) do - if not User.locked?(followed) do + with deny_follow_blocked <- Pleroma.Config.get([:user, :deny_follow_blocked]), + {:user_blocked, false} <- + {:user_blocked, User.blocks?(followed, follower) && deny_follow_blocked}, + {:user_locked, false} <- {:user_locked, User.locked?(followed)}, + {:follow, {:ok, follower}} <- {:follow, User.follow(follower, followed)} do ActivityPub.accept(%{ to: [follower.ap_id], actor: followed, object: data, local: true }) + else + {:user_blocked, true} -> + {:ok, _} = Utils.update_follow_state(activity, "reject") - User.follow(follower, followed) + ActivityPub.reject(%{ + to: [follower.ap_id], + actor: followed, + object: data, + local: true + }) + + {:follow, {:error, _}} -> + {:ok, _} = Utils.update_follow_state(activity, "reject") + + ActivityPub.reject(%{ + to: [follower.ap_id], + actor: followed, + object: data, + local: true + }) + + {:user_locked, true} -> + :noop end {:ok, activity} else - _e -> :error + _e -> + :error end end def handle_incoming( %{"type" => "Accept", "object" => follow_object, "actor" => _actor, "id" => _id} = data ) do - with actor <- get_actor(data), + with actor <- Containment.get_actor(data), %User{} = followed <- User.get_or_fetch_by_ap_id(actor), {:ok, follow_activity} <- get_follow_activity(follow_object, followed), {:ok, follow_activity} <- Utils.update_follow_state(follow_activity, "accept"), @@ -533,7 +510,7 @@ def handle_incoming( def handle_incoming( %{"type" => "Reject", "object" => follow_object, "actor" => _actor, "id" => _id} = data ) do - with actor <- get_actor(data), + with actor <- Containment.get_actor(data), %User{} = followed <- User.get_or_fetch_by_ap_id(actor), {:ok, follow_activity} <- get_follow_activity(follow_object, followed), {:ok, follow_activity} <- Utils.update_follow_state(follow_activity, "reject"), @@ -557,9 +534,9 @@ def handle_incoming( def handle_incoming( %{"type" => "Like", "object" => object_id, "actor" => _actor, "id" => id} = data ) do - with actor <- get_actor(data), + with actor <- Containment.get_actor(data), %User{} = actor <- User.get_or_fetch_by_ap_id(actor), - {:ok, object} <- get_obj_helper(object_id) || fetch_obj_helper(object_id), + {:ok, object} <- get_obj_helper(object_id), {:ok, activity, _object} <- ActivityPub.like(actor, object, id, false) do {:ok, activity} else @@ -570,9 +547,9 @@ def handle_incoming( def handle_incoming( %{"type" => "Announce", "object" => object_id, "actor" => _actor, "id" => id} = data ) do - with actor <- get_actor(data), + with actor <- Containment.get_actor(data), %User{} = actor <- User.get_or_fetch_by_ap_id(actor), - {:ok, object} <- get_obj_helper(object_id) || fetch_obj_helper(object_id), + {:ok, object} <- get_obj_helper(object_id), public <- Visibility.is_public?(data), {:ok, activity, _object} <- ActivityPub.announce(actor, object, id, false, public) do {:ok, activity} @@ -586,7 +563,7 @@ def handle_incoming( data ) when object_type in ["Person", "Application", "Service", "Organization"] do - with %User{ap_id: ^actor_id} = actor <- User.get_by_ap_id(object["id"]) do + with %User{ap_id: ^actor_id} = actor <- User.get_cached_by_ap_id(object["id"]) do {:ok, new_user_data} = ActivityPub.user_data_from_user_object(object) banner = new_user_data[:info]["banner"] @@ -625,10 +602,10 @@ def handle_incoming( ) do object_id = Utils.get_ap_id(object_id) - with actor <- get_actor(data), + with actor <- Containment.get_actor(data), %User{} = actor <- User.get_or_fetch_by_ap_id(actor), - {:ok, object} <- get_obj_helper(object_id) || fetch_obj_helper(object_id), - :ok <- contain_origin(actor.ap_id, object.data), + {:ok, object} <- get_obj_helper(object_id), + :ok <- Containment.contain_origin(actor.ap_id, object.data), {:ok, activity} <- ActivityPub.delete(object, false) do {:ok, activity} else @@ -644,9 +621,9 @@ def handle_incoming( "id" => id } = data ) do - with actor <- get_actor(data), + with actor <- Containment.get_actor(data), %User{} = actor <- User.get_or_fetch_by_ap_id(actor), - {:ok, object} <- get_obj_helper(object_id) || fetch_obj_helper(object_id), + {:ok, object} <- get_obj_helper(object_id), {:ok, activity, _} <- ActivityPub.unannounce(actor, object, id, false) do {:ok, activity} else @@ -714,9 +691,9 @@ def handle_incoming( "id" => id } = data ) do - with actor <- get_actor(data), + with actor <- Containment.get_actor(data), %User{} = actor <- User.get_or_fetch_by_ap_id(actor), - {:ok, object} <- get_obj_helper(object_id) || fetch_obj_helper(object_id), + {:ok, object} <- get_obj_helper(object_id), {:ok, activity, _, _} <- ActivityPub.unlike(actor, object, id, false) do {:ok, activity} else @@ -726,9 +703,6 @@ def handle_incoming( def handle_incoming(_), do: :error - def fetch_obj_helper(id) when is_bitstring(id), do: ActivityPub.fetch_object_from_id(id) - def fetch_obj_helper(obj) when is_map(obj), do: ActivityPub.fetch_object_from_id(obj["id"]) - def get_obj_helper(id) do if object = Object.normalize(id), do: {:ok, object}, else: nil end @@ -765,9 +739,9 @@ def prepare_object(object) do # internal -> Mastodon # """ - def prepare_outgoing(%{"type" => "Create", "object" => object} = data) do + def prepare_outgoing(%{"type" => "Create", "object" => object_id} = data) do object = - object + Object.normalize(object_id).data |> prepare_object data = @@ -828,7 +802,7 @@ def prepare_outgoing(%{"type" => _type} = data) do def maybe_fix_object_url(data) do if is_binary(data["object"]) and not String.starts_with?(data["object"], "http") do - case fetch_obj_helper(data["object"]) do + case get_obj_helper(data["object"]) do {:ok, relative_object} -> if relative_object.data["external_url"] do _data = @@ -1016,7 +990,7 @@ def perform(:user_upgrade, user) do end def upgrade_user_from_ap_id(ap_id) do - with %User{local: false} = user <- User.get_by_ap_id(ap_id), + with %User{local: false} = user <- User.get_cached_by_ap_id(ap_id), {:ok, data} <- ActivityPub.fetch_and_prepare_user_from_ap_id(ap_id), already_ap <- User.ap_enabled?(user), {:ok, user} <- user |> User.upgrade_changeset(data) |> User.update_and_set_cache() do diff --git a/lib/pleroma/web/activity_pub/utils.ex b/lib/pleroma/web/activity_pub/utils.ex index 0b53f71c3..581b9d1ab 100644 --- a/lib/pleroma/web/activity_pub/utils.ex +++ b/lib/pleroma/web/activity_pub/utils.ex @@ -52,7 +52,7 @@ defp recipient_in_collection(ap_id, coll) when is_binary(coll), do: ap_id == col defp recipient_in_collection(ap_id, coll) when is_list(coll), do: ap_id in coll defp recipient_in_collection(_, _), do: false - def recipient_in_message(ap_id, params) do + def recipient_in_message(%User{ap_id: ap_id} = recipient, %User{} = actor, params) do cond do recipient_in_collection(ap_id, params["to"]) -> true @@ -71,6 +71,11 @@ def recipient_in_message(ap_id, params) do !params["to"] && !params["cc"] && !params["bto"] && !params["bcc"] -> true + # if the message is sent from somebody the user is following, then assume it + # is addressed to the recipient + User.following?(recipient, actor) -> + true + true -> false end @@ -229,14 +234,18 @@ def lazy_put_object_defaults(map, activity, _fake) do @doc """ Inserts a full object if it is contained in an activity. """ - def insert_full_object(%{"object" => %{"type" => type} = object_data}) + def insert_full_object(%{"object" => %{"type" => type} = object_data} = map) when is_map(object_data) and type in @supported_object_types do with {:ok, object} <- Object.create(object_data) do - {:ok, object} + map = + map + |> Map.put("object", object.data["id"]) + + {:ok, map, object} end end - def insert_full_object(_), do: {:ok, nil} + def insert_full_object(map), do: {:ok, map, nil} def update_object_in_activities(%{data: %{"id" => id}} = object) do # TODO diff --git a/lib/pleroma/web/activity_pub/visibility.ex b/lib/pleroma/web/activity_pub/visibility.ex index db52fe933..6dee61dd6 100644 --- a/lib/pleroma/web/activity_pub/visibility.ex +++ b/lib/pleroma/web/activity_pub/visibility.ex @@ -41,16 +41,21 @@ def visible_for_user?(activity, user) do # guard def entire_thread_visible_for_user?(nil, _user), do: false - # child - def entire_thread_visible_for_user?( - %Activity{data: %{"object" => %{"inReplyTo" => parent_id}}} = tail, - user - ) - when is_binary(parent_id) do - parent = Activity.get_in_reply_to_activity(tail) - visible_for_user?(tail, user) && entire_thread_visible_for_user?(parent, user) - end + # XXX: Probably even more inefficient than the previous implementation intended to be a placeholder untill https://git.pleroma.social/pleroma/pleroma/merge_requests/971 is in develop + # credo:disable-for-previous-line Credo.Check.Readability.MaxLineLength - # root - def entire_thread_visible_for_user?(tail, user), do: visible_for_user?(tail, user) + def entire_thread_visible_for_user?( + %Activity{} = tail, + # %Activity{data: %{"object" => %{"inReplyTo" => parent_id}}} = tail, + user + ) do + case Object.normalize(tail) do + %{data: %{"inReplyTo" => parent_id}} when is_binary(parent_id) -> + parent = Activity.get_in_reply_to_activity(tail) + visible_for_user?(tail, user) && entire_thread_visible_for_user?(parent, user) + + _ -> + visible_for_user?(tail, user) + end + end end diff --git a/lib/pleroma/web/admin_api/admin_api_controller.ex b/lib/pleroma/web/admin_api/admin_api_controller.ex index 70a5b5c5d..711f233a6 100644 --- a/lib/pleroma/web/admin_api/admin_api_controller.ex +++ b/lib/pleroma/web/admin_api/admin_api_controller.ex @@ -19,7 +19,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do action_fallback(:errors) def user_delete(conn, %{"nickname" => nickname}) do - User.get_by_nickname(nickname) + User.get_cached_by_nickname(nickname) |> User.delete() conn @@ -27,8 +27,8 @@ def user_delete(conn, %{"nickname" => nickname}) do end def user_follow(conn, %{"follower" => follower_nick, "followed" => followed_nick}) do - with %User{} = follower <- User.get_by_nickname(follower_nick), - %User{} = followed <- User.get_by_nickname(followed_nick) do + with %User{} = follower <- User.get_cached_by_nickname(follower_nick), + %User{} = followed <- User.get_cached_by_nickname(followed_nick) do User.follow(follower, followed) end @@ -37,8 +37,8 @@ def user_follow(conn, %{"follower" => follower_nick, "followed" => followed_nick end def user_unfollow(conn, %{"follower" => follower_nick, "followed" => followed_nick}) do - with %User{} = follower <- User.get_by_nickname(follower_nick), - %User{} = followed <- User.get_by_nickname(followed_nick) do + with %User{} = follower <- User.get_cached_by_nickname(follower_nick), + %User{} = followed <- User.get_cached_by_nickname(followed_nick) do User.unfollow(follower, followed) end @@ -67,7 +67,7 @@ def user_create( end def user_show(conn, %{"nickname" => nickname}) do - with %User{} = user <- User.get_by_nickname(nickname) do + with %User{} = user <- User.get_cached_by_nickname(nickname) do conn |> json(AccountView.render("show.json", %{user: user})) else @@ -76,7 +76,7 @@ def user_show(conn, %{"nickname" => nickname}) do end def user_toggle_activation(conn, %{"nickname" => nickname}) do - user = User.get_by_nickname(nickname) + user = User.get_cached_by_nickname(nickname) {:ok, updated_user} = User.deactivate(user, !user.info.deactivated) @@ -131,7 +131,7 @@ defp maybe_parse_filters(filters) do def right_add(conn, %{"permission_group" => permission_group, "nickname" => nickname}) when permission_group in ["moderator", "admin"] do - user = User.get_by_nickname(nickname) + user = User.get_cached_by_nickname(nickname) info = %{} @@ -156,7 +156,7 @@ def right_add(conn, _) do end def right_get(conn, %{"nickname" => nickname}) do - user = User.get_by_nickname(nickname) + user = User.get_cached_by_nickname(nickname) conn |> json(%{ @@ -178,7 +178,7 @@ def right_delete( |> put_status(403) |> json(%{error: "You can't revoke your own admin status."}) else - user = User.get_by_nickname(nickname) + user = User.get_cached_by_nickname(nickname) info = %{} @@ -204,7 +204,7 @@ def right_delete(conn, _) do def set_activation_status(conn, %{"nickname" => nickname, "status" => status}) do with {:ok, status} <- Ecto.Type.cast(:boolean, status), - %User{} = user <- User.get_by_nickname(nickname), + %User{} = user <- User.get_cached_by_nickname(nickname), {:ok, _} <- User.deactivate(user, !status), do: json_response(conn, :no_content, "") end @@ -238,8 +238,13 @@ def email_invite(%{assigns: %{user: user}} = conn, %{"email" => email} = params) !Pleroma.Config.get([:instance, :registrations_open]), {:ok, invite_token} <- UserInviteToken.create_invite(), email <- - Pleroma.UserEmail.user_invitation_email(user, invite_token, email, params["name"]), - {:ok, _} <- Pleroma.Mailer.deliver(email) do + Pleroma.Emails.UserEmail.user_invitation_email( + user, + invite_token, + email, + params["name"] + ), + {:ok, _} <- Pleroma.Emails.Mailer.deliver(email) do json_response(conn, :no_content, "") end end @@ -272,7 +277,7 @@ def revoke_invite(conn, %{"token" => token}) do @doc "Get a password reset token (base64 string) for given nickname" def get_password_reset(conn, %{"nickname" => nickname}) do - (%User{local: true} = user) = User.get_by_nickname(nickname) + (%User{local: true} = user) = User.get_cached_by_nickname(nickname) {:ok, token} = Pleroma.PasswordResetToken.create_token(user) conn diff --git a/lib/pleroma/web/auth/authenticator.ex b/lib/pleroma/web/auth/authenticator.ex index 89d88af32..b02f595dc 100644 --- a/lib/pleroma/web/auth/authenticator.ex +++ b/lib/pleroma/web/auth/authenticator.ex @@ -13,21 +13,21 @@ def implementation do ) end - @callback get_user(Plug.Conn.t(), Map.t()) :: {:ok, User.t()} | {:error, any()} - def get_user(plug, params), do: implementation().get_user(plug, params) + @callback get_user(Plug.Conn.t()) :: {:ok, User.t()} | {:error, any()} + def get_user(plug), do: implementation().get_user(plug) - @callback create_from_registration(Plug.Conn.t(), Map.t(), Registration.t()) :: + @callback create_from_registration(Plug.Conn.t(), Registration.t()) :: {:ok, User.t()} | {:error, any()} - def create_from_registration(plug, params, registration), - do: implementation().create_from_registration(plug, params, registration) + def create_from_registration(plug, registration), + do: implementation().create_from_registration(plug, registration) - @callback get_registration(Plug.Conn.t(), Map.t()) :: + @callback get_registration(Plug.Conn.t()) :: {:ok, Registration.t()} | {:error, any()} - def get_registration(plug, params), - do: implementation().get_registration(plug, params) + def get_registration(plug), do: implementation().get_registration(plug) @callback handle_error(Plug.Conn.t(), any()) :: any() - def handle_error(plug, error), do: implementation().handle_error(plug, error) + def handle_error(plug, error), + do: implementation().handle_error(plug, error) @callback auth_template() :: String.t() | nil def auth_template do diff --git a/lib/pleroma/web/auth/ldap_authenticator.ex b/lib/pleroma/web/auth/ldap_authenticator.ex index 8b6d5a77f..363c99597 100644 --- a/lib/pleroma/web/auth/ldap_authenticator.ex +++ b/lib/pleroma/web/auth/ldap_authenticator.ex @@ -13,14 +13,16 @@ defmodule Pleroma.Web.Auth.LDAPAuthenticator do @connection_timeout 10_000 @search_timeout 10_000 - defdelegate get_registration(conn, params), to: @base + defdelegate get_registration(conn), to: @base + defdelegate create_from_registration(conn, registration), to: @base + defdelegate handle_error(conn, error), to: @base + defdelegate auth_template, to: @base + defdelegate oauth_consumer_template, to: @base - defdelegate create_from_registration(conn, params, registration), to: @base - - def get_user(%Plug.Conn{} = conn, params) do + def get_user(%Plug.Conn{} = conn) do if Pleroma.Config.get([:ldap, :enabled]) do {name, password} = - case params do + case conn.params do %{"authorization" => %{"name" => name, "password" => password}} -> {name, password} @@ -34,25 +36,17 @@ def get_user(%Plug.Conn{} = conn, params) do {:error, {:ldap_connection_error, _}} -> # When LDAP is unavailable, try default authenticator - @base.get_user(conn, params) + @base.get_user(conn) error -> error end else # Fall back to default authenticator - @base.get_user(conn, params) + @base.get_user(conn) end end - def handle_error(%Plug.Conn{} = _conn, error) do - error - end - - def auth_template, do: nil - - def oauth_consumer_template, do: nil - defp ldap_user(name, password) do ldap = Pleroma.Config.get(:ldap, []) host = Keyword.get(ldap, :host, "localhost") diff --git a/lib/pleroma/web/auth/pleroma_authenticator.ex b/lib/pleroma/web/auth/pleroma_authenticator.ex index c826adb4c..d647f1e05 100644 --- a/lib/pleroma/web/auth/pleroma_authenticator.ex +++ b/lib/pleroma/web/auth/pleroma_authenticator.ex @@ -10,9 +10,9 @@ defmodule Pleroma.Web.Auth.PleromaAuthenticator do @behaviour Pleroma.Web.Auth.Authenticator - def get_user(%Plug.Conn{} = _conn, params) do + def get_user(%Plug.Conn{} = conn) do {name, password} = - case params do + case conn.params do %{"authorization" => %{"name" => name, "password" => password}} -> {name, password} @@ -29,10 +29,9 @@ def get_user(%Plug.Conn{} = _conn, params) do end end - def get_registration( - %Plug.Conn{assigns: %{ueberauth_auth: %{provider: provider, uid: uid} = auth}}, - _params - ) do + def get_registration(%Plug.Conn{ + assigns: %{ueberauth_auth: %{provider: provider, uid: uid} = auth} + }) do registration = Registration.get_by_provider_uid(provider, uid) if registration do @@ -40,7 +39,8 @@ def get_registration( else info = auth.info - Registration.changeset(%Registration{}, %{ + %Registration{} + |> Registration.changeset(%{ provider: to_string(provider), uid: to_string(uid), info: %{ @@ -54,13 +54,16 @@ def get_registration( end end - def get_registration(%Plug.Conn{} = _conn, _params), do: {:error, :missing_credentials} + def get_registration(%Plug.Conn{} = _conn), do: {:error, :missing_credentials} - def create_from_registration(_conn, params, registration) do - nickname = value([params["nickname"], Registration.nickname(registration)]) - email = value([params["email"], Registration.email(registration)]) - name = value([params["name"], Registration.name(registration)]) || nickname - bio = value([params["bio"], Registration.description(registration)]) + def create_from_registration( + %Plug.Conn{params: %{"authorization" => registration_attrs}}, + registration + ) do + nickname = value([registration_attrs["nickname"], Registration.nickname(registration)]) + email = value([registration_attrs["email"], Registration.email(registration)]) + name = value([registration_attrs["name"], Registration.name(registration)]) || nickname + bio = value([registration_attrs["bio"], Registration.description(registration)]) random_password = :crypto.strong_rand_bytes(64) |> Base.encode64() diff --git a/lib/pleroma/web/channels/user_socket.ex b/lib/pleroma/web/channels/user_socket.ex index 6503979a1..8e2759e3b 100644 --- a/lib/pleroma/web/channels/user_socket.ex +++ b/lib/pleroma/web/channels/user_socket.ex @@ -24,7 +24,7 @@ defmodule Pleroma.Web.UserSocket do def connect(%{"token" => token}, socket) do with true <- Pleroma.Config.get([:chat, :enabled]), {:ok, user_id} <- Phoenix.Token.verify(socket, "user socket", token, max_age: 84_600), - %User{} = user <- Pleroma.User.get_by_id(user_id) do + %User{} = user <- Pleroma.User.get_cached_by_id(user_id) do {:ok, assign(socket, :user_name, user.nickname)} else _e -> :error diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index 74babdf14..ecd183110 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -4,6 +4,7 @@ defmodule Pleroma.Web.CommonAPI do alias Pleroma.Activity + alias Pleroma.Bookmark alias Pleroma.Formatter alias Pleroma.Object alias Pleroma.ThreadMute @@ -125,7 +126,10 @@ def get_visibility(%{"in_reply_to_status_id" => status_id}) when not is_nil(stat "public" in_reply_to -> - Pleroma.Web.MastodonAPI.StatusView.get_visibility(in_reply_to.data["object"]) + # XXX: these heuristics should be moved out of MastodonAPI. + with %Object{} = object <- Object.normalize(in_reply_to) do + Pleroma.Web.MastodonAPI.StatusView.get_visibility(object) + end end end @@ -214,8 +218,10 @@ def pin(id_or_ap_id, %{ap_id: user_ap_id} = user) do with %Activity{ actor: ^user_ap_id, data: %{ - "type" => "Create", - "object" => %{ + "type" => "Create" + }, + object: %Object{ + data: %{ "to" => object_to, "type" => "Note" } @@ -277,9 +283,18 @@ def thread_muted?(user, activity) do end end + def bookmarked?(user, activity) do + with %Bookmark{} <- Bookmark.get(user.id, activity.id) do + true + else + _ -> + false + end + end + def report(user, data) do with {:account_id, %{"account_id" => account_id}} <- {:account_id, data}, - {:account, %User{} = account} <- {:account, User.get_by_id(account_id)}, + {:account, %User{} = account} <- {:account, User.get_cached_by_id(account_id)}, {:ok, {content_html, _, _}} <- make_report_content_html(data["comment"]), {:ok, statuses} <- get_report_statuses(account, data), {:ok, activity} <- diff --git a/lib/pleroma/web/common_api/utils.ex b/lib/pleroma/web/common_api/utils.ex index 7b9f0ea06..1dfe50b40 100644 --- a/lib/pleroma/web/common_api/utils.ex +++ b/lib/pleroma/web/common_api/utils.ex @@ -182,6 +182,18 @@ def format_input(text, "text/plain", options) do end).() end + @doc """ + Formatting text as BBCode. + """ + def format_input(text, "text/bbcode", options) do + text + |> String.replace(~r/\r/, "") + |> Formatter.html_escape("text/plain") + |> BBCode.to_html() + |> (fn {:ok, html} -> html end).() + |> Formatter.linkify(options) + end + @doc """ Formatting text to html. """ @@ -195,11 +207,10 @@ def format_input(text, "text/html", options) do Formatting text to markdown. """ def format_input(text, "text/markdown", options) do - options = Keyword.put(options, :mentions_escape, true) - text + |> Formatter.mentions_escape(options) + |> Earmark.as_html!() |> Formatter.linkify(options) - |> (fn {text, mentions, tags} -> {Earmark.as_html!(text), mentions, tags} end).() |> Formatter.html_escape("text/html") end @@ -209,7 +220,7 @@ def make_note_data( context, content_html, attachments, - inReplyTo, + in_reply_to, tags, cw \\ nil, cc \\ [] @@ -226,10 +237,11 @@ def make_note_data( "tag" => tags |> Enum.map(fn {_, tag} -> tag end) |> Enum.uniq() } - if inReplyTo do + if in_reply_to do + in_reply_to_object = Object.normalize(in_reply_to) + object - |> Map.put("inReplyTo", inReplyTo.data["object"]["id"]) - |> Map.put("inReplyToStatusId", inReplyTo.id) + |> Map.put("inReplyTo", in_reply_to_object.data["id"]) else object end @@ -284,7 +296,7 @@ defp shortname(name) do end def confirm_current_password(user, password) do - with %User{local: true} = db_user <- User.get_by_id(user.id), + with %User{local: true} = db_user <- User.get_cached_by_id(user.id), true <- Pbkdf2.checkpw(password, db_user.password_hash) do {:ok, db_user} else diff --git a/lib/pleroma/web/endpoint.ex b/lib/pleroma/web/endpoint.ex index 1633477c3..7f939991d 100644 --- a/lib/pleroma/web/endpoint.ex +++ b/lib/pleroma/web/endpoint.ex @@ -58,14 +58,9 @@ defmodule Pleroma.Web.Endpoint do do: "__Host-pleroma_key", else: "pleroma_key" - same_site = - if Pleroma.Config.oauth_consumer_enabled?() do - # Note: "SameSite=Strict" prevents sign in with external OAuth provider - # (there would be no cookies during callback request from OAuth provider) - "SameSite=Lax" - else - "SameSite=Strict" - end + extra = + Pleroma.Config.get([__MODULE__, :extra_cookie_attrs]) + |> Enum.join(";") # The session will be stored in the cookie and signed, # this means its contents can be read but not tampered with. @@ -77,7 +72,7 @@ defmodule Pleroma.Web.Endpoint do signing_salt: {Pleroma.Config, :get, [[__MODULE__, :signing_salt], "CqaoopA2"]}, http_only: true, secure: secure_cookies, - extra: same_site + extra: extra ) # Note: the plug and its configuration is compile-time this can't be upstreamed yet diff --git a/lib/pleroma/web/federator/federator.ex b/lib/pleroma/web/federator/federator.ex index c47328e13..29e178ba9 100644 --- a/lib/pleroma/web/federator/federator.ex +++ b/lib/pleroma/web/federator/federator.ex @@ -4,6 +4,7 @@ defmodule Pleroma.Web.Federator do alias Pleroma.Activity + alias Pleroma.Object.Containment alias Pleroma.User alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.Relay @@ -136,7 +137,7 @@ def perform(:incoming_ap_doc, params) do # actor shouldn't be acting on objects outside their own AP server. with {:ok, _user} <- ap_enabled_actor(params["actor"]), nil <- Activity.normalize(params["id"]), - :ok <- Transmogrifier.contain_origin_from_id(params["actor"], params), + :ok <- Containment.contain_origin_from_id(params["actor"], params), {:ok, activity} <- Transmogrifier.handle_incoming(params) do {:ok, activity} else @@ -185,7 +186,7 @@ def perform(type, _) do end def ap_enabled_actor(id) do - user = User.get_by_ap_id(id) + user = User.get_cached_by_ap_id(id) if User.ap_enabled?(user) do {:ok, user} diff --git a/lib/pleroma/web/mastodon_api/mastodon_api.ex b/lib/pleroma/web/mastodon_api/mastodon_api.ex index 382f07e6b..3a3ec7c2a 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api.ex @@ -7,6 +7,31 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPI do alias Pleroma.Pagination alias Pleroma.ScheduledActivity alias Pleroma.User + alias Pleroma.Web.CommonAPI + + def follow(follower, followed, params \\ %{}) do + options = cast_params(params) + reblogs = options[:reblogs] + + result = + if not User.following?(follower, followed) do + CommonAPI.follow(follower, followed) + else + {:ok, follower, followed, nil} + end + + with {:ok, follower, followed, _} <- result do + reblogs + |> case do + false -> CommonAPI.hide_reblogs(follower, followed) + _ -> CommonAPI.show_reblogs(follower, followed) + end + |> case do + {:ok, follower} -> {:ok, follower} + _ -> {:ok, follower} + end + end + end def get_followers(user, params \\ %{}) do user @@ -37,7 +62,8 @@ def get_scheduled_activities(user, params \\ %{}) do defp cast_params(params) do param_types = %{ - exclude_types: {:array, :string} + exclude_types: {:array, :string}, + reblogs: :boolean } changeset = cast({%{}, param_types}, params, Map.keys(param_types)) diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index ed082abdf..811a45c79 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -4,13 +4,15 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do use Pleroma.Web, :controller - alias Ecto.Changeset alias Pleroma.Activity + alias Pleroma.Bookmark alias Pleroma.Config alias Pleroma.Filter alias Pleroma.Notification alias Pleroma.Object + alias Pleroma.Object.Fetcher + alias Pleroma.Pagination alias Pleroma.Repo alias Pleroma.ScheduledActivity alias Pleroma.Stats @@ -34,7 +36,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do alias Pleroma.Web.OAuth.Authorization alias Pleroma.Web.OAuth.Token - import Pleroma.Web.ControllerHelper, only: [oauth_scopes: 2] + alias Pleroma.Web.ControllerHelper import Ecto.Query require Logger @@ -45,7 +47,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do action_fallback(:errors) def create_app(conn, params) do - scopes = oauth_scopes(params, ["read"]) + scopes = ControllerHelper.oauth_scopes(params, ["read"]) app_attrs = params @@ -95,8 +97,13 @@ def update_credentials(%{assigns: %{user: user}} = conn, params) do end) info_params = - %{} - |> add_if_present(params, "locked", :locked, fn value -> {:ok, value == "true"} end) + [:no_rich_text, :locked, :hide_followers, :hide_follows, :hide_favorites, :show_role] + |> Enum.reduce(%{}, fn key, acc -> + add_if_present(acc, params, to_string(key), key, fn value -> + {:ok, ControllerHelper.truthy_param?(value)} + end) + end) + |> add_if_present(params, "default_scope", :default_scope) |> add_if_present(params, "header", :banner, fn value -> with %Plug.Upload{} <- value, {:ok, object} <- ActivityPub.upload(value, type: :banner) do @@ -106,7 +113,7 @@ def update_credentials(%{assigns: %{user: user}} = conn, params) do end end) - info_cng = User.Info.mastodon_profile_update(user.info, info_params) + info_cng = User.Info.profile_update(user.info, info_params) with changeset <- User.update_changeset(user, user_params), changeset <- Ecto.Changeset.put_embed(changeset, :info, info_cng), @@ -189,7 +196,7 @@ defp mastodonized_emoji do "static_url" => url, "visible_in_picker" => true, "url" => url, - "tags" => String.split(tags, ",") + "tags" => tags } end) end @@ -202,15 +209,29 @@ def custom_emojis(conn, _params) do defp add_link_headers(conn, method, activities, param \\ nil, params \\ %{}) do params = conn.params - |> Map.drop(["since_id", "max_id"]) + |> Map.drop(["since_id", "max_id", "min_id"]) |> Map.merge(params) last = List.last(activities) - first = List.first(activities) if last do - min = last.id - max = first.id + max_id = last.id + + limit = + params + |> Map.get("limit", "20") + |> String.to_integer() + + min_id = + if length(activities) <= limit do + activities + |> List.first() + |> Map.get(:id) + else + activities + |> Enum.at(limit * -1) + |> Map.get(:id) + end {next_url, prev_url} = if param do @@ -219,13 +240,13 @@ defp add_link_headers(conn, method, activities, param \\ nil, params \\ %{}) do Pleroma.Web.Endpoint, method, param, - Map.merge(params, %{max_id: min}) + Map.merge(params, %{max_id: max_id}) ), mastodon_api_url( Pleroma.Web.Endpoint, method, param, - Map.merge(params, %{since_id: max}) + Map.merge(params, %{min_id: min_id}) ) } else @@ -233,12 +254,12 @@ defp add_link_headers(conn, method, activities, param \\ nil, params \\ %{}) do mastodon_api_url( Pleroma.Web.Endpoint, method, - Map.merge(params, %{max_id: min}) + Map.merge(params, %{max_id: max_id}) ), mastodon_api_url( Pleroma.Web.Endpoint, method, - Map.merge(params, %{since_id: max}) + Map.merge(params, %{min_id: min_id}) ) } end @@ -264,6 +285,8 @@ def home_timeline(%{assigns: %{user: user}} = conn, params) do |> ActivityPub.contain_timeline(user) |> Enum.reverse() + user = Repo.preload(user, bookmarks: :activity) + conn |> add_link_headers(:home_timeline, activities) |> put_view(StatusView) @@ -282,6 +305,8 @@ def public_timeline(%{assigns: %{user: user}} = conn, params) do |> ActivityPub.fetch_public_activities() |> Enum.reverse() + user = Repo.preload(user, bookmarks: :activity) + conn |> add_link_headers(:public_timeline, activities, false, %{"local" => local_only}) |> put_view(StatusView) @@ -289,7 +314,8 @@ def public_timeline(%{assigns: %{user: user}} = conn, params) do end def user_statuses(%{assigns: %{user: reading_user}} = conn, params) do - with %User{} = user <- User.get_by_id(params["id"]) do + with %User{} = user <- User.get_cached_by_id(params["id"]), + reading_user <- Repo.preload(reading_user, :bookmarks) do activities = ActivityPub.fetch_user_activities(user, reading_user, params) conn @@ -314,7 +340,9 @@ def dm_timeline(%{assigns: %{user: user}} = conn, params) do activities = [user.ap_id] |> ActivityPub.fetch_activities_query(params) - |> Repo.all() + |> Pagination.fetch_paginated(params) + + user = Repo.preload(user, bookmarks: :activity) conn |> add_link_headers(:dm_timeline, activities) @@ -323,8 +351,10 @@ def dm_timeline(%{assigns: %{user: user}} = conn, params) do end def get_status(%{assigns: %{user: user}} = conn, %{"id" => id}) do - with %Activity{} = activity <- Activity.get_by_id(id), + with %Activity{} = activity <- Activity.get_by_id_with_object(id), true <- Visibility.visible_for_user?(activity, user) do + user = Repo.preload(user, bookmarks: :activity) + conn |> put_view(StatusView) |> try_render("status.json", %{activity: activity, for: user}) @@ -472,7 +502,10 @@ def delete_status(%{assigns: %{user: user}} = conn, %{"id" => id}) do end def reblog_status(%{assigns: %{user: user}} = conn, %{"id" => ap_id_or_id}) do - with {:ok, announce, _activity} <- CommonAPI.repeat(ap_id_or_id, user) do + with {:ok, announce, _activity} <- CommonAPI.repeat(ap_id_or_id, user), + %Activity{} = announce <- Activity.normalize(announce.data) do + user = Repo.preload(user, bookmarks: :activity) + conn |> put_view(StatusView) |> try_render("status.json", %{activity: announce, for: user, as: :activity}) @@ -481,7 +514,9 @@ def reblog_status(%{assigns: %{user: user}} = conn, %{"id" => ap_id_or_id}) do def unreblog_status(%{assigns: %{user: user}} = conn, %{"id" => ap_id_or_id}) do with {:ok, _unannounce, %{data: %{"id" => id}}} <- CommonAPI.unrepeat(ap_id_or_id, user), - %Activity{} = activity <- Activity.get_create_by_object_ap_id(id) do + %Activity{} = activity <- Activity.get_create_by_object_ap_id_with_object(id) do + user = Repo.preload(user, bookmarks: :activity) + conn |> put_view(StatusView) |> try_render("status.json", %{activity: activity, for: user, as: :activity}) @@ -528,10 +563,12 @@ def unpin_status(%{assigns: %{user: user}} = conn, %{"id" => ap_id_or_id}) do end def bookmark_status(%{assigns: %{user: user}} = conn, %{"id" => id}) do - with %Activity{} = activity <- Activity.get_by_id(id), - %User{} = user <- User.get_by_nickname(user.nickname), + with %Activity{} = activity <- Activity.get_by_id_with_object(id), + %User{} = user <- User.get_cached_by_nickname(user.nickname), true <- Visibility.visible_for_user?(activity, user), - {:ok, user} <- User.bookmark(user, activity.data["object"]["id"]) do + {:ok, _bookmark} <- Bookmark.create(user.id, activity.id) do + user = Repo.preload(user, bookmarks: :activity) + conn |> put_view(StatusView) |> try_render("status.json", %{activity: activity, for: user, as: :activity}) @@ -539,10 +576,12 @@ def bookmark_status(%{assigns: %{user: user}} = conn, %{"id" => id}) do end def unbookmark_status(%{assigns: %{user: user}} = conn, %{"id" => id}) do - with %Activity{} = activity <- Activity.get_by_id(id), - %User{} = user <- User.get_by_nickname(user.nickname), + with %Activity{} = activity <- Activity.get_by_id_with_object(id), + %User{} = user <- User.get_cached_by_nickname(user.nickname), true <- Visibility.visible_for_user?(activity, user), - {:ok, user} <- User.unbookmark(user, activity.data["object"]["id"]) do + {:ok, _bookmark} <- Bookmark.destroy(user.id, activity.id) do + user = Repo.preload(user, bookmarks: :activity) + conn |> put_view(StatusView) |> try_render("status.json", %{activity: activity, for: user, as: :activity}) @@ -612,6 +651,11 @@ def dismiss_notification(%{assigns: %{user: user}} = conn, %{"id" => id} = _para end end + def destroy_multiple(%{assigns: %{user: user}} = conn, %{"ids" => ids} = _params) do + Notification.destroy_multiple(user, ids) + json(conn, %{}) + end + def relationships(%{assigns: %{user: user}} = conn, %{"id" => id}) do id = List.wrap(id) q = from(u in User, where: u.id in ^id) @@ -661,7 +705,8 @@ def upload(%{assigns: %{user: user}} = conn, %{"file" => file} = data) do end def favourited_by(conn, %{"id" => id}) do - with %Activity{data: %{"object" => %{"likes" => likes}}} <- Activity.get_by_id(id) do + with %Activity{data: %{"object" => object}} <- Repo.get(Activity, id), + %Object{data: %{"likes" => likes}} <- Object.normalize(object) do q = from(u in User, where: u.ap_id in ^likes) users = Repo.all(q) @@ -674,7 +719,8 @@ def favourited_by(conn, %{"id" => id}) do end def reblogged_by(conn, %{"id" => id}) do - with %Activity{data: %{"object" => %{"announcements" => announces}}} <- Activity.get_by_id(id) do + with %Activity{data: %{"object" => object}} <- Repo.get(Activity, id), + %Object{data: %{"announcements" => announces}} <- Object.normalize(object) do q = from(u in User, where: u.ap_id in ^announces) users = Repo.all(q) @@ -725,7 +771,7 @@ def hashtag_timeline(%{assigns: %{user: user}} = conn, params) do end def followers(%{assigns: %{user: for_user}} = conn, %{"id" => id} = params) do - with %User{} = user <- User.get_by_id(id), + with %User{} = user <- User.get_cached_by_id(id), followers <- MastodonAPI.get_followers(user, params) do followers = cond do @@ -742,7 +788,7 @@ def followers(%{assigns: %{user: for_user}} = conn, %{"id" => id} = params) do end def following(%{assigns: %{user: for_user}} = conn, %{"id" => id} = params) do - with %User{} = user <- User.get_by_id(id), + with %User{} = user <- User.get_cached_by_id(id), followers <- MastodonAPI.get_friends(user, params) do followers = cond do @@ -767,7 +813,7 @@ def follow_requests(%{assigns: %{user: followed}} = conn, _params) do end def authorize_follow_request(%{assigns: %{user: followed}} = conn, %{"id" => id}) do - with %User{} = follower <- User.get_by_id(id), + with %User{} = follower <- User.get_cached_by_id(id), {:ok, follower} <- CommonAPI.accept_follow_request(follower, followed) do conn |> put_view(AccountView) @@ -781,7 +827,7 @@ def authorize_follow_request(%{assigns: %{user: followed}} = conn, %{"id" => id} end def reject_follow_request(%{assigns: %{user: followed}} = conn, %{"id" => id}) do - with %User{} = follower <- User.get_by_id(id), + with %User{} = follower <- User.get_cached_by_id(id), {:ok, follower} <- CommonAPI.reject_follow_request(follower, followed) do conn |> put_view(AccountView) @@ -795,25 +841,15 @@ def reject_follow_request(%{assigns: %{user: followed}} = conn, %{"id" => id}) d end def follow(%{assigns: %{user: follower}} = conn, %{"id" => id}) do - with %User{} = followed <- User.get_by_id(id), - false <- User.following?(follower, followed), - {:ok, follower, followed, _} <- CommonAPI.follow(follower, followed) do + with {_, %User{} = followed} <- {:followed, User.get_cached_by_id(id)}, + {_, true} <- {:followed, follower.id != followed.id}, + {:ok, follower} <- MastodonAPI.follow(follower, followed, conn.params) do conn |> put_view(AccountView) |> render("relationship.json", %{user: follower, target: followed}) else - true -> - followed = User.get_cached_by_id(id) - - {:ok, follower} = - case conn.params["reblogs"] do - true -> CommonAPI.show_reblogs(follower, followed) - false -> CommonAPI.hide_reblogs(follower, followed) - end - - conn - |> put_view(AccountView) - |> render("relationship.json", %{user: follower, target: followed}) + {:followed, _} -> + {:error, :not_found} {:error, message} -> conn @@ -823,12 +859,16 @@ def follow(%{assigns: %{user: follower}} = conn, %{"id" => id}) do end def follow(%{assigns: %{user: follower}} = conn, %{"uri" => uri}) do - with %User{} = followed <- User.get_by_nickname(uri), + with {_, %User{} = followed} <- {:followed, User.get_cached_by_nickname(uri)}, + {_, true} <- {:followed, follower.id != followed.id}, {:ok, follower, followed, _} <- CommonAPI.follow(follower, followed) do conn |> put_view(AccountView) |> render("account.json", %{user: followed, for: follower}) else + {:followed, _} -> + {:error, :not_found} + {:error, message} -> conn |> put_resp_content_type("application/json") @@ -837,16 +877,23 @@ def follow(%{assigns: %{user: follower}} = conn, %{"uri" => uri}) do end def unfollow(%{assigns: %{user: follower}} = conn, %{"id" => id}) do - with %User{} = followed <- User.get_by_id(id), + with {_, %User{} = followed} <- {:followed, User.get_cached_by_id(id)}, + {_, true} <- {:followed, follower.id != followed.id}, {:ok, follower} <- CommonAPI.unfollow(follower, followed) do conn |> put_view(AccountView) |> render("relationship.json", %{user: follower, target: followed}) + else + {:followed, _} -> + {:error, :not_found} + + error -> + error end end def mute(%{assigns: %{user: muter}} = conn, %{"id" => id}) do - with %User{} = muted <- User.get_by_id(id), + with %User{} = muted <- User.get_cached_by_id(id), {:ok, muter} <- User.mute(muter, muted) do conn |> put_view(AccountView) @@ -860,7 +907,7 @@ def mute(%{assigns: %{user: muter}} = conn, %{"id" => id}) do end def unmute(%{assigns: %{user: muter}} = conn, %{"id" => id}) do - with %User{} = muted <- User.get_by_id(id), + with %User{} = muted <- User.get_cached_by_id(id), {:ok, muter} <- User.unmute(muter, muted) do conn |> put_view(AccountView) @@ -881,7 +928,7 @@ def mutes(%{assigns: %{user: user}} = conn, _) do end def block(%{assigns: %{user: blocker}} = conn, %{"id" => id}) do - with %User{} = blocked <- User.get_by_id(id), + with %User{} = blocked <- User.get_cached_by_id(id), {:ok, blocker} <- User.block(blocker, blocked), {:ok, _activity} <- ActivityPub.block(blocker, blocked) do conn @@ -896,7 +943,7 @@ def block(%{assigns: %{user: blocker}} = conn, %{"id" => id}) do end def unblock(%{assigns: %{user: blocker}} = conn, %{"id" => id}) do - with %User{} = blocked <- User.get_by_id(id), + with %User{} = blocked <- User.get_cached_by_id(id), {:ok, blocker} <- User.unblock(blocker, blocked), {:ok, _activity} <- ActivityPub.unblock(blocker, blocked) do conn @@ -962,7 +1009,7 @@ def unsubscribe(%{assigns: %{user: user}} = conn, %{"id" => id}) do def status_search(user, query) do fetched = if Regex.match?(~r/https?:/, query) do - with {:ok, object} <- ActivityPub.fetch_object_from_id(query), + with {:ok, object} <- Fetcher.fetch_object_from_id(query), %Activity{} = activity <- Activity.get_create_by_object_ap_id(object.data["id"]), true <- Visibility.visible_for_user?(activity, user) do [activity] @@ -973,13 +1020,13 @@ def status_search(user, query) do q = from( - a in Activity, + [a, o] in Activity.with_preloaded_object(Activity), where: fragment("?->>'type' = 'Create'", a.data), where: "https://www.w3.org/ns/activitystreams#Public" in a.recipients, where: fragment( - "to_tsvector('english', ?->'object'->>'content') @@ plainto_tsquery('english', ?)", - a.data, + "to_tsvector('english', ?->>'content') @@ plainto_tsquery('english', ?)", + o.data, ^query ), limit: 20, @@ -1055,21 +1102,65 @@ def favourites(%{assigns: %{user: user}} = conn, params) do ActivityPub.fetch_activities([], params) |> Enum.reverse() + user = Repo.preload(user, bookmarks: :activity) + conn |> add_link_headers(:favourites, activities) |> put_view(StatusView) |> render("index.json", %{activities: activities, for: user, as: :activity}) end - def bookmarks(%{assigns: %{user: user}} = conn, _) do - user = User.get_by_id(user.id) + def user_favourites(%{assigns: %{user: for_user}} = conn, %{"id" => id} = params) do + with %User{} = user <- User.get_by_id(id), + false <- user.info.hide_favorites do + params = + params + |> Map.put("type", "Create") + |> Map.put("favorited_by", user.ap_id) + |> Map.put("blocking_user", for_user) + + recipients = + if for_user do + ["https://www.w3.org/ns/activitystreams#Public"] ++ + [for_user.ap_id | for_user.following] + else + ["https://www.w3.org/ns/activitystreams#Public"] + end + + activities = + recipients + |> ActivityPub.fetch_activities(params) + |> Enum.reverse() + + conn + |> add_link_headers(:favourites, activities) + |> put_view(StatusView) + |> render("index.json", %{activities: activities, for: for_user, as: :activity}) + else + nil -> + {:error, :not_found} + + true -> + conn + |> put_status(403) + |> json(%{error: "Can't get favorites"}) + end + end + + def bookmarks(%{assigns: %{user: user}} = conn, params) do + user = User.get_cached_by_id(user.id) + user = Repo.preload(user, bookmarks: :activity) + + bookmarks = + Bookmark.for_user_query(user.id) + |> Pagination.fetch_paginated(params) activities = - user.bookmarks - |> Enum.map(fn id -> Activity.get_create_by_object_ap_id(id) end) - |> Enum.reverse() + bookmarks + |> Enum.map(fn b -> b.activity end) conn + |> add_link_headers(:bookmarks, bookmarks) |> put_view(StatusView) |> render("index.json", %{activities: activities, for: user, as: :activity}) end @@ -1119,7 +1210,7 @@ def add_to_list(%{assigns: %{user: user}} = conn, %{"id" => id, "account_ids" => accounts |> Enum.each(fn account_id -> with %Pleroma.List{} = list <- Pleroma.List.get(id, user), - %User{} = followed <- User.get_by_id(account_id) do + %User{} = followed <- User.get_cached_by_id(account_id) do Pleroma.List.follow(list, followed) end end) @@ -1131,7 +1222,7 @@ def remove_from_list(%{assigns: %{user: user}} = conn, %{"id" => id, "account_id accounts |> Enum.each(fn account_id -> with %Pleroma.List{} = list <- Pleroma.List.get(id, user), - %User{} = followed <- Pleroma.User.get_by_id(account_id) do + %User{} = followed <- Pleroma.User.get_cached_by_id(account_id) do Pleroma.List.unfollow(list, followed) end end) @@ -1175,6 +1266,8 @@ def list_timeline(%{assigns: %{user: user}} = conn, %{"list_id" => id} = params) |> ActivityPub.fetch_activities_bounded(following, params) |> Enum.reverse() + user = Repo.preload(user, bookmarks: :activity) + conn |> put_view(StatusView) |> render("index.json", %{activities: activities, for: user, as: :activity}) @@ -1424,7 +1517,7 @@ def logout(conn, _) do def relationship_noop(%{assigns: %{user: user}} = conn, %{"id" => id}) do Logger.debug("Unimplemented, returning unmodified relationship") - with %User{} = target <- User.get_by_id(id) do + with %User{} = target <- User.get_cached_by_id(id) do conn |> put_view(AccountView) |> render("relationship.json", %{user: user, target: target}) diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex index af56c4149..779b9a382 100644 --- a/lib/pleroma/web/mastodon_api/views/account_view.ex +++ b/lib/pleroma/web/mastodon_api/views/account_view.ex @@ -68,7 +68,7 @@ def render("relationships.json", %{user: user, targets: targets}) do defp do_render("account.json", %{user: user} = opts) do image = User.avatar_url(user) |> MediaProxy.url() header = User.banner_url(user) |> MediaProxy.url() - user_info = User.user_info(user) + user_info = User.get_cached_user_info(user) bot = (user.info.source_data["type"] || "Person") in ["Application", "Service"] emojis = @@ -113,21 +113,23 @@ defp do_render("account.json", %{user: user} = opts) do bot: bot, source: %{ note: "", - privacy: user_info.default_scope, - sensitive: false + sensitive: false, + pleroma: %{} }, # Pleroma extension - pleroma: - %{ - confirmation_pending: user_info.confirmation_pending, - tags: user.tags, - is_moderator: user.info.is_moderator, - is_admin: user.info.is_admin, - relationship: relationship - } - |> with_notification_settings(user, opts[:for]) + pleroma: %{ + confirmation_pending: user_info.confirmation_pending, + tags: user.tags, + hide_followers: user.info.hide_followers, + hide_follows: user.info.hide_follows, + hide_favorites: user.info.hide_favorites, + relationship: relationship + } } + |> maybe_put_role(user, opts[:for]) + |> maybe_put_settings(user, opts[:for], user_info) + |> maybe_put_notification_settings(user, opts[:for]) end defp username_from_nickname(string) when is_binary(string) do @@ -136,9 +138,37 @@ defp username_from_nickname(string) when is_binary(string) do defp username_from_nickname(_), do: nil - defp with_notification_settings(data, %User{id: user_id} = user, %User{id: user_id}) do - Map.put(data, :notification_settings, user.info.notification_settings) + defp maybe_put_settings( + data, + %User{id: user_id} = user, + %User{id: user_id}, + user_info + ) do + data + |> Kernel.put_in([:source, :privacy], user_info.default_scope) + |> Kernel.put_in([:source, :pleroma, :show_role], user.info.show_role) + |> Kernel.put_in([:source, :pleroma, :no_rich_text], user.info.no_rich_text) end - defp with_notification_settings(data, _, _), do: data + defp maybe_put_settings(data, _, _, _), do: data + + defp maybe_put_role(data, %User{info: %{show_role: true}} = user, _) do + data + |> Kernel.put_in([:pleroma, :is_admin], user.info.is_admin) + |> Kernel.put_in([:pleroma, :is_moderator], user.info.is_moderator) + end + + defp maybe_put_role(data, %User{id: user_id} = user, %User{id: user_id}) do + data + |> Kernel.put_in([:pleroma, :is_admin], user.info.is_admin) + |> Kernel.put_in([:pleroma, :is_moderator], user.info.is_moderator) + end + + defp maybe_put_role(data, _, _), do: data + + defp maybe_put_notification_settings(data, %User{id: user_id} = user, %User{id: user_id}) do + Kernel.put_in(data, [:pleroma, :notification_settings], user.info.notification_settings) + end + + defp maybe_put_notification_settings(data, _, _), do: data end diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index d4a8e4fff..62d064d71 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -7,6 +7,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do alias Pleroma.Activity alias Pleroma.HTML + alias Pleroma.Object alias Pleroma.Repo alias Pleroma.User alias Pleroma.Web.CommonAPI @@ -19,8 +20,9 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do defp get_replied_to_activities(activities) do activities |> Enum.map(fn - %{data: %{"type" => "Create", "object" => %{"inReplyTo" => in_reply_to}}} -> - in_reply_to != "" && in_reply_to + %{data: %{"type" => "Create", "object" => object}} -> + object = Object.normalize(object) + object.data["inReplyTo"] != "" && object.data["inReplyTo"] _ -> nil @@ -29,7 +31,8 @@ defp get_replied_to_activities(activities) do |> Activity.create_by_object_ap_id() |> Repo.all() |> Enum.reduce(%{}, fn activity, acc -> - Map.put(acc, activity.data["object"]["id"], activity) + object = Object.normalize(activity) + Map.put(acc, object.data["id"], activity) end) end @@ -54,6 +57,11 @@ defp get_context_id(%{data: %{"context" => context}}) when is_binary(context), defp get_context_id(_), do: nil + defp reblogged?(activity, user) do + object = Object.normalize(activity) || %{} + present?(user && user.ap_id in (object.data["announcements"] || [])) + end + def render("index.json", opts) do replied_to_activities = get_replied_to_activities(opts.activities) @@ -72,8 +80,13 @@ def render( user = get_user(activity.data["actor"]) created_at = Utils.to_masto_date(activity.data["published"]) - reblogged = Activity.get_create_by_object_ap_id(object) - reblogged = render("status.json", Map.put(opts, :activity, reblogged)) + reblogged_activity = Activity.get_create_by_object_ap_id(object) + reblogged = render("status.json", Map.put(opts, :activity, reblogged_activity)) + + activity_object = Object.normalize(activity) + favorited = opts[:for] && opts[:for].ap_id in (activity_object.data["likes"] || []) + + bookmarked = opts[:for] && CommonAPI.bookmarked?(opts[:for], reblogged_activity) mentions = activity.recipients @@ -94,9 +107,9 @@ def render( reblogs_count: 0, replies_count: 0, favourites_count: 0, - reblogged: false, - favourited: false, - bookmarked: false, + reblogged: reblogged?(reblogged_activity, opts[:for]), + favourited: present?(favorited), + bookmarked: present?(bookmarked), muted: false, pinned: pinned?(activity, user), sensitive: false, @@ -117,14 +130,16 @@ def render( } end - def render("status.json", %{activity: %{data: %{"object" => object}} = activity} = opts) do + def render("status.json", %{activity: %{data: %{"object" => _object}} = activity} = opts) do + object = Object.normalize(activity) + user = get_user(activity.data["actor"]) - like_count = object["like_count"] || 0 - announcement_count = object["announcement_count"] || 0 + like_count = object.data["like_count"] || 0 + announcement_count = object.data["announcement_count"] || 0 - tags = object["tag"] || [] - sensitive = object["sensitive"] || Enum.member?(tags, "nsfw") + tags = object.data["tag"] || [] + sensitive = object.data["sensitive"] || Enum.member?(tags, "nsfw") mentions = activity.recipients @@ -132,16 +147,17 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity} |> Enum.filter(& &1) |> Enum.map(fn user -> AccountView.render("mention.json", %{user: user}) end) - repeated = opts[:for] && opts[:for].ap_id in (object["announcements"] || []) - favorited = opts[:for] && opts[:for].ap_id in (object["likes"] || []) - bookmarked = opts[:for] && object["id"] in opts[:for].bookmarks + favorited = opts[:for] && opts[:for].ap_id in (object.data["likes"] || []) - attachment_data = object["attachment"] || [] + bookmarked = opts[:for] && CommonAPI.bookmarked?(opts[:for], activity) + + attachment_data = object.data["attachment"] || [] attachments = render_many(attachment_data, StatusView, "attachment.json", as: :attachment) - created_at = Utils.to_masto_date(object["published"]) + created_at = Utils.to_masto_date(object.data["published"]) reply_to = get_reply_to(activity, opts) + reply_to_user = reply_to && get_user(reply_to.data["actor"]) content = @@ -163,7 +179,7 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity} "mastoapi:content" ) - summary = object["summary"] || "" + summary = object.data["summary"] || "" summary_html = summary @@ -186,12 +202,12 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity} if user.local do Pleroma.Web.Router.Helpers.o_status_url(Pleroma.Web.Endpoint, :notice, activity) else - object["external_url"] || object["id"] + object.data["external_url"] || object.data["id"] end %{ id: to_string(activity.id), - uri: object["id"], + uri: object.data["id"], url: url, account: AccountView.render("account.json", %{user: user}), in_reply_to_id: reply_to && to_string(reply_to.id), @@ -201,9 +217,9 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity} content: content_html, created_at: created_at, reblogs_count: announcement_count, - replies_count: object["repliesCount"] || 0, + replies_count: object.data["repliesCount"] || 0, favourites_count: like_count, - reblogged: present?(repeated), + reblogged: reblogged?(activity, opts[:for]), favourited: present?(favorited), bookmarked: present?(bookmarked), muted: CommonAPI.thread_muted?(user, activity) || User.mutes?(opts[:for], user), @@ -219,10 +235,11 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity} website: nil }, language: nil, - emojis: build_emojis(activity.data["object"]["emoji"]), + emojis: build_emojis(object.data["emoji"]), pleroma: %{ local: activity.local, conversation_id: get_context_id(activity), + in_reply_to_account_acct: reply_to_user && reply_to_user.nickname, content: %{"text/plain" => content_plaintext}, spoiler_text: %{"text/plain" => summary_plaintext} } @@ -301,13 +318,19 @@ def render("attachment.json", %{attachment: attachment}) do end def get_reply_to(activity, %{replied_to_activities: replied_to_activities}) do - _id = activity.data["object"]["inReplyTo"] - replied_to_activities[activity.data["object"]["inReplyTo"]] + object = Object.normalize(activity) + + with nil <- replied_to_activities[object.data["inReplyTo"]] do + # If user didn't participate in the thread + Activity.get_in_reply_to_activity(activity) + end end - def get_reply_to(%{data: %{"object" => object}}, _) do - if object["inReplyTo"] && object["inReplyTo"] != "" do - Activity.get_create_by_object_ap_id(object["inReplyTo"]) + def get_reply_to(%{data: %{"object" => _object}} = activity, _) do + object = Object.normalize(activity) + + if object.data["inReplyTo"] && object.data["inReplyTo"] != "" do + Activity.get_create_by_object_ap_id(object.data["inReplyTo"]) else nil end @@ -315,8 +338,8 @@ def get_reply_to(%{data: %{"object" => object}}, _) do def get_visibility(object) do public = "https://www.w3.org/ns/activitystreams#Public" - to = object["to"] || [] - cc = object["cc"] || [] + to = object.data["to"] || [] + cc = object.data["cc"] || [] cond do public in to -> @@ -337,25 +360,25 @@ def get_visibility(object) do end end - def render_content(%{"type" => "Video"} = object) do - with name when not is_nil(name) and name != "" <- object["name"] do - "

#{name}

#{object["content"]}" + def render_content(%{data: %{"type" => "Video"}} = object) do + with name when not is_nil(name) and name != "" <- object.data["name"] do + "

#{name}

#{object.data["content"]}" else - _ -> object["content"] || "" + _ -> object.data["content"] || "" end end - def render_content(%{"type" => object_type} = object) + def render_content(%{data: %{"type" => object_type}} = object) when object_type in ["Article", "Page"] do - with summary when not is_nil(summary) and summary != "" <- object["name"], - url when is_bitstring(url) <- object["url"] do - "

#{summary}

#{object["content"]}" + with summary when not is_nil(summary) and summary != "" <- object.data["name"], + url when is_bitstring(url) <- object.data["url"] do + "

#{summary}

#{object.data["content"]}" else - _ -> object["content"] || "" + _ -> object.data["content"] || "" end end - def render_content(object), do: object["content"] || "" + def render_content(object), do: object.data["content"] || "" @doc """ Builds a dictionary tags. diff --git a/lib/pleroma/web/mastodon_api/websocket_handler.ex b/lib/pleroma/web/mastodon_api/websocket_handler.ex index 1b3721e2b..abfa26754 100644 --- a/lib/pleroma/web/mastodon_api/websocket_handler.ex +++ b/lib/pleroma/web/mastodon_api/websocket_handler.ex @@ -90,7 +90,7 @@ defp allow_request(stream, nil) when stream in @anonymous_streams do # Authenticated streams. defp allow_request(stream, {"access_token", access_token}) when stream in @streams do with %Token{user_id: user_id} <- Repo.get_by(Token, token: access_token), - user = %User{} <- User.get_by_id(user_id) do + user = %User{} <- User.get_cached_by_id(user_id) do {:ok, user} else _ -> {:error, 403} diff --git a/lib/pleroma/web/media_proxy/media_proxy.ex b/lib/pleroma/web/media_proxy/media_proxy.ex index 3bd2affe9..5762e767b 100644 --- a/lib/pleroma/web/media_proxy/media_proxy.ex +++ b/lib/pleroma/web/media_proxy/media_proxy.ex @@ -13,32 +13,44 @@ def url("/" <> _ = url), do: url def url(url) do config = Application.get_env(:pleroma, :media_proxy, []) + domain = URI.parse(url).host - if !Keyword.get(config, :enabled, false) or String.starts_with?(url, Pleroma.Web.base_url()) do - url - else - secret = Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:secret_key_base] - - # Must preserve `%2F` for compatibility with S3 - # https://git.pleroma.social/pleroma/pleroma/issues/580 - replacement = get_replacement(url, ":2F:") - - # The URL is url-decoded and encoded again to ensure it is correctly encoded and not twice. - base64 = + cond do + !Keyword.get(config, :enabled, false) or String.starts_with?(url, Pleroma.Web.base_url()) -> url - |> String.replace("%2F", replacement) - |> URI.decode() - |> URI.encode() - |> String.replace(replacement, "%2F") - |> Base.url_encode64(@base64_opts) - sig = :crypto.hmac(:sha, secret, base64) - sig64 = sig |> Base.url_encode64(@base64_opts) + Enum.any?(Pleroma.Config.get([:media_proxy, :whitelist]), fn pattern -> + String.equivalent?(domain, pattern) + end) -> + url - build_url(sig64, base64, filename(url)) + true -> + encode_url(url) end end + def encode_url(url) do + secret = Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:secret_key_base] + + # Must preserve `%2F` for compatibility with S3 + # https://git.pleroma.social/pleroma/pleroma/issues/580 + replacement = get_replacement(url, ":2F:") + + # The URL is url-decoded and encoded again to ensure it is correctly encoded and not twice. + base64 = + url + |> String.replace("%2F", replacement) + |> URI.decode() + |> URI.encode() + |> String.replace(replacement, "%2F") + |> Base.url_encode64(@base64_opts) + + sig = :crypto.hmac(:sha, secret, base64) + sig64 = sig |> Base.url_encode64(@base64_opts) + + build_url(sig64, base64, filename(url)) + end + def decode_url(sig, url) do secret = Application.get_env(:pleroma, Pleroma.Web.Endpoint)[:secret_key_base] sig = Base.url_decode64!(sig, @base64_opts) diff --git a/lib/pleroma/web/metadata/rel_me.ex b/lib/pleroma/web/metadata/rel_me.ex new file mode 100644 index 000000000..03af899c4 --- /dev/null +++ b/lib/pleroma/web/metadata/rel_me.ex @@ -0,0 +1,13 @@ +defmodule Pleroma.Web.Metadata.Providers.RelMe do + alias Pleroma.Web.Metadata.Providers.Provider + @behaviour Provider + + @impl Provider + def build_tags(%{user: user}) do + (Floki.attribute(user.bio, "link[rel~=me]", "href") ++ + Floki.attribute(user.bio, "a[rel~=me]", "href")) + |> Enum.map(fn link -> + {:link, [rel: "me", href: link], []} + end) + end +end diff --git a/lib/pleroma/web/oauth/fallback_controller.ex b/lib/pleroma/web/oauth/fallback_controller.ex index afaa00242..e3984f009 100644 --- a/lib/pleroma/web/oauth/fallback_controller.ex +++ b/lib/pleroma/web/oauth/fallback_controller.ex @@ -24,6 +24,6 @@ def call(conn, _error) do conn |> put_status(:unauthorized) |> put_flash(:error, "Invalid Username/Password") - |> OAuthController.authorize(conn.params["authorization"]) + |> OAuthController.authorize(conn.params) end end diff --git a/lib/pleroma/web/oauth/oauth_controller.ex b/lib/pleroma/web/oauth/oauth_controller.ex index bee7084ad..688eaca11 100644 --- a/lib/pleroma/web/oauth/oauth_controller.ex +++ b/lib/pleroma/web/oauth/oauth_controller.ex @@ -23,6 +23,12 @@ defmodule Pleroma.Web.OAuth.OAuthController do action_fallback(Pleroma.Web.OAuth.FallbackController) + # Note: this definition is only called from error-handling methods with `conn.params` as 2nd arg + def authorize(conn, %{"authorization" => _} = params) do + {auth_attrs, params} = Map.pop(params, "authorization") + authorize(conn, Map.merge(params, auth_attrs)) + end + def authorize(%{assigns: %{token: %Token{} = token}} = conn, params) do if ControllerHelper.truthy_param?(params["force_login"]) do do_authorize(conn, params) @@ -49,6 +55,7 @@ defp do_authorize(conn, params) do available_scopes = (app && app.scopes) || [] scopes = oauth_scopes(params, nil) || available_scopes + # Note: `params` might differ from `conn.params`; use `@params` not `@conn.params` in template render(conn, Authenticator.auth_template(), %{ response_type: params["response_type"], client_id: params["client_id"], @@ -62,18 +69,20 @@ defp do_authorize(conn, params) do def create_authorization( conn, - %{"authorization" => auth_params} = params, + %{"authorization" => _} = params, opts \\ [] ) do with {:ok, auth} <- do_create_authorization(conn, params, opts[:user]) do - after_create_authorization(conn, auth, auth_params) + after_create_authorization(conn, auth, params) else error -> - handle_create_authorization_error(conn, error, auth_params) + handle_create_authorization_error(conn, error, params) end end - def after_create_authorization(conn, auth, %{"redirect_uri" => redirect_uri} = auth_params) do + def after_create_authorization(conn, auth, %{ + "authorization" => %{"redirect_uri" => redirect_uri} = auth_attrs + }) do redirect_uri = redirect_uri(conn, redirect_uri) if redirect_uri == "urn:ietf:wg:oauth:2.0:oob" do @@ -86,8 +95,8 @@ def after_create_authorization(conn, auth, %{"redirect_uri" => redirect_uri} = a url_params = %{:code => auth.token} url_params = - if auth_params["state"] do - Map.put(url_params, :state, auth_params["state"]) + if auth_attrs["state"] do + Map.put(url_params, :state, auth_attrs["state"]) else url_params end @@ -98,26 +107,34 @@ def after_create_authorization(conn, auth, %{"redirect_uri" => redirect_uri} = a end end - defp handle_create_authorization_error(conn, {scopes_issue, _}, auth_params) + defp handle_create_authorization_error( + conn, + {scopes_issue, _}, + %{"authorization" => _} = params + ) when scopes_issue in [:unsupported_scopes, :missing_scopes] do # Per https://github.com/tootsuite/mastodon/blob/ # 51e154f5e87968d6bb115e053689767ab33e80cd/app/controllers/api/base_controller.rb#L39 conn |> put_flash(:error, "This action is outside the authorized scopes") |> put_status(:unauthorized) - |> authorize(auth_params) + |> authorize(params) end - defp handle_create_authorization_error(conn, {:auth_active, false}, auth_params) do + defp handle_create_authorization_error( + conn, + {:auth_active, false}, + %{"authorization" => _} = params + ) do # Per https://github.com/tootsuite/mastodon/blob/ # 51e154f5e87968d6bb115e053689767ab33e80cd/app/controllers/api/base_controller.rb#L76 conn |> put_flash(:error, "Your login is missing a confirmed e-mail address") |> put_status(:forbidden) - |> authorize(auth_params) + |> authorize(params) end - defp handle_create_authorization_error(conn, error, _auth_params) do + defp handle_create_authorization_error(conn, error, %{"authorization" => _}) do Authenticator.handle_error(conn, error) end @@ -126,7 +143,7 @@ def token_exchange(conn, %{"grant_type" => "authorization_code"} = params) do fixed_token = fix_padding(params["code"]), %Authorization{} = auth <- Repo.get_by(Authorization, token: fixed_token, app_id: app.id), - %User{} = user <- User.get_by_id(auth.user_id), + %User{} = user <- User.get_cached_by_id(auth.user_id), {:ok, token} <- Token.exchange_token(app, auth), {:ok, inserted_at} <- DateTime.from_naive(token.inserted_at, "Etc/UTC") do response = %{ @@ -151,7 +168,7 @@ def token_exchange( conn, %{"grant_type" => "password"} = params ) do - with {_, {:ok, %User{} = user}} <- {:get_user, Authenticator.get_user(conn, params)}, + with {_, {:ok, %User{} = user}} <- {:get_user, Authenticator.get_user(conn)}, %App{} = app <- get_app_from_request(conn, params), {:auth_active, true} <- {:auth_active, User.auth_active?(user)}, {:user_active, true} <- {:user_active, !user.info.deactivated}, @@ -214,19 +231,19 @@ def token_revoke(conn, %{"token" => token} = params) do end @doc "Prepares OAuth request to provider for Ueberauth" - def prepare_request(conn, %{"provider" => provider} = params) do + def prepare_request(conn, %{"provider" => provider, "authorization" => auth_attrs}) do scope = - oauth_scopes(params, []) + oauth_scopes(auth_attrs, []) |> Enum.join(" ") state = - params + auth_attrs |> Map.delete("scopes") |> Map.put("scope", scope) |> Poison.encode!() params = - params + auth_attrs |> Map.drop(~w(scope scopes client_id redirect_uri)) |> Map.put("state", state) @@ -260,26 +277,26 @@ def callback(%{assigns: %{ueberauth_failure: failure}} = conn, params) do def callback(conn, params) do params = callback_params(params) - with {:ok, registration} <- Authenticator.get_registration(conn, params) do + with {:ok, registration} <- Authenticator.get_registration(conn) do user = Repo.preload(registration, :user).user - auth_params = Map.take(params, ~w(client_id redirect_uri scope scopes state)) + auth_attrs = Map.take(params, ~w(client_id redirect_uri scope scopes state)) if user do create_authorization( conn, - %{"authorization" => auth_params}, + %{"authorization" => auth_attrs}, user: user ) else registration_params = - Map.merge(auth_params, %{ + Map.merge(auth_attrs, %{ "nickname" => Registration.nickname(registration), "email" => Registration.email(registration) }) conn |> put_session(:registration_id, registration.id) - |> registration_details(registration_params) + |> registration_details(%{"authorization" => registration_params}) end else _ -> @@ -293,53 +310,44 @@ defp callback_params(%{"state" => state} = params) do Map.merge(params, Poison.decode!(state)) end - def registration_details(conn, params) do + def registration_details(conn, %{"authorization" => auth_attrs}) do render(conn, "register.html", %{ - client_id: params["client_id"], - redirect_uri: params["redirect_uri"], - state: params["state"], - scopes: oauth_scopes(params, []), - nickname: params["nickname"], - email: params["email"] + client_id: auth_attrs["client_id"], + redirect_uri: auth_attrs["redirect_uri"], + state: auth_attrs["state"], + scopes: oauth_scopes(auth_attrs, []), + nickname: auth_attrs["nickname"], + email: auth_attrs["email"] }) end - def register(conn, %{"op" => "connect"} = params) do - authorization_params = Map.put(params, "name", params["auth_name"]) - create_authorization_params = %{"authorization" => authorization_params} - + def register(conn, %{"authorization" => _, "op" => "connect"} = params) do with registration_id when not is_nil(registration_id) <- get_session_registration_id(conn), %Registration{} = registration <- Repo.get(Registration, registration_id), {_, {:ok, auth}} <- - {:create_authorization, do_create_authorization(conn, create_authorization_params)}, + {:create_authorization, do_create_authorization(conn, params)}, %User{} = user <- Repo.preload(auth, :user).user, {:ok, _updated_registration} <- Registration.bind_to_user(registration, user) do conn |> put_session_registration_id(nil) - |> after_create_authorization(auth, authorization_params) + |> after_create_authorization(auth, params) else {:create_authorization, error} -> - {:register, handle_create_authorization_error(conn, error, create_authorization_params)} + {:register, handle_create_authorization_error(conn, error, params)} _ -> {:register, :generic_error} end end - def register(conn, %{"op" => "register"} = params) do + def register(conn, %{"authorization" => _, "op" => "register"} = params) do with registration_id when not is_nil(registration_id) <- get_session_registration_id(conn), %Registration{} = registration <- Repo.get(Registration, registration_id), - {:ok, user} <- Authenticator.create_from_registration(conn, params, registration) do + {:ok, user} <- Authenticator.create_from_registration(conn, registration) do conn |> put_session_registration_id(nil) |> create_authorization( - %{ - "authorization" => %{ - "client_id" => params["client_id"], - "redirect_uri" => params["redirect_uri"], - "scopes" => oauth_scopes(params, nil) - } - }, + params, user: user ) else @@ -374,15 +382,15 @@ defp do_create_authorization( %{ "client_id" => client_id, "redirect_uri" => redirect_uri - } = auth_params - } = params, + } = auth_attrs + }, user \\ nil ) do with {_, {:ok, %User{} = user}} <- - {:get_user, (user && {:ok, user}) || Authenticator.get_user(conn, params)}, + {:get_user, (user && {:ok, user}) || Authenticator.get_user(conn)}, %App{} = app <- Repo.get_by(App, client_id: client_id), true <- redirect_uri in String.split(app.redirect_uris), - scopes <- oauth_scopes(auth_params, []), + scopes <- oauth_scopes(auth_attrs, []), {:unsupported_scopes, []} <- {:unsupported_scopes, scopes -- app.scopes}, # Note: `scope` param is intentionally not optional in this context {:missing_scopes, false} <- {:missing_scopes, scopes == []}, diff --git a/lib/pleroma/web/oauth/token.ex b/lib/pleroma/web/oauth/token.ex index 2b5ad9b94..399140003 100644 --- a/lib/pleroma/web/oauth/token.ex +++ b/lib/pleroma/web/oauth/token.ex @@ -27,7 +27,7 @@ defmodule Pleroma.Web.OAuth.Token do def exchange_token(app, auth) do with {:ok, auth} <- Authorization.use_token(auth), true <- auth.app_id == app.id do - create_token(app, User.get_by_id(auth.user_id), auth.scopes) + create_token(app, User.get_cached_by_id(auth.user_id), auth.scopes) end end diff --git a/lib/pleroma/web/ostatus/activity_representer.ex b/lib/pleroma/web/ostatus/activity_representer.ex index 1a1b74bb0..166691a09 100644 --- a/lib/pleroma/web/ostatus/activity_representer.ex +++ b/lib/pleroma/web/ostatus/activity_representer.ex @@ -54,23 +54,16 @@ defp get_mentions(to) do end) end - defp get_links(%{local: true, data: data}) do + defp get_links(%{local: true}, %{"id" => object_id}) do h = fn str -> [to_charlist(str)] end [ - {:link, [type: ['application/atom+xml'], href: h.(data["object"]["id"]), rel: 'self'], []}, - {:link, [type: ['text/html'], href: h.(data["object"]["id"]), rel: 'alternate'], []} + {:link, [type: ['application/atom+xml'], href: h.(object_id), rel: 'self'], []}, + {:link, [type: ['text/html'], href: h.(object_id), rel: 'alternate'], []} ] end - defp get_links(%{ - local: false, - data: %{ - "object" => %{ - "external_url" => external_url - } - } - }) do + defp get_links(%{local: false}, %{"external_url" => external_url}) do h = fn str -> [to_charlist(str)] end [ @@ -78,7 +71,7 @@ defp get_links(%{ ] end - defp get_links(_activity), do: [] + defp get_links(_activity, _object_data), do: [] defp get_emoji_links(emojis) do Enum.map(emojis, fn {emoji, file} -> @@ -88,14 +81,16 @@ defp get_emoji_links(emojis) do def to_simple_form(activity, user, with_author \\ false) - def to_simple_form(%{data: %{"object" => %{"type" => "Note"}}} = activity, user, with_author) do + def to_simple_form(%{data: %{"type" => "Create"}} = activity, user, with_author) do h = fn str -> [to_charlist(str)] end - updated_at = activity.data["object"]["published"] - inserted_at = activity.data["object"]["published"] + object = Object.normalize(activity) + + updated_at = object.data["published"] + inserted_at = object.data["published"] attachments = - Enum.map(activity.data["object"]["attachment"] || [], fn attachment -> + Enum.map(object.data["attachment"] || [], fn attachment -> url = hd(attachment["url"]) {:link, @@ -108,7 +103,7 @@ def to_simple_form(%{data: %{"object" => %{"type" => "Note"}}} = activity, user, mentions = activity.recipients |> get_mentions categories = - (activity.data["object"]["tag"] || []) + (object.data["tag"] || []) |> Enum.map(fn tag -> if is_binary(tag) do {:category, [term: to_charlist(tag)], []} @@ -118,11 +113,11 @@ def to_simple_form(%{data: %{"object" => %{"type" => "Note"}}} = activity, user, end) |> Enum.filter(& &1) - emoji_links = get_emoji_links(activity.data["object"]["emoji"] || %{}) + emoji_links = get_emoji_links(object.data["emoji"] || %{}) summary = - if activity.data["object"]["summary"] do - [{:summary, [], h.(activity.data["object"]["summary"])}] + if object.data["summary"] do + [{:summary, [], h.(object.data["summary"])}] else [] end @@ -131,10 +126,9 @@ def to_simple_form(%{data: %{"object" => %{"type" => "Note"}}} = activity, user, {:"activity:object-type", ['http://activitystrea.ms/schema/1.0/note']}, {:"activity:verb", ['http://activitystrea.ms/schema/1.0/post']}, # For notes, federate the object id. - {:id, h.(activity.data["object"]["id"])}, + {:id, h.(object.data["id"])}, {:title, ['New note by #{user.nickname}']}, - {:content, [type: 'html'], - h.(activity.data["object"]["content"] |> String.replace(~r/[\n\r]/, ""))}, + {:content, [type: 'html'], h.(object.data["content"] |> String.replace(~r/[\n\r]/, ""))}, {:published, h.(inserted_at)}, {:updated, h.(updated_at)}, {:"ostatus:conversation", [ref: h.(activity.data["context"])], @@ -142,7 +136,7 @@ def to_simple_form(%{data: %{"object" => %{"type" => "Note"}}} = activity, user, {:link, [ref: h.(activity.data["context"]), rel: 'ostatus:conversation'], []} ] ++ summary ++ - get_links(activity) ++ + get_links(activity, object.data) ++ categories ++ attachments ++ in_reply_to ++ author ++ mentions ++ emoji_links end diff --git a/lib/pleroma/web/ostatus/handlers/note_handler.ex b/lib/pleroma/web/ostatus/handlers/note_handler.ex index db995ec77..ec6e5cfaf 100644 --- a/lib/pleroma/web/ostatus/handlers/note_handler.ex +++ b/lib/pleroma/web/ostatus/handlers/note_handler.ex @@ -113,8 +113,9 @@ def handle_note(entry, doc \\ nil) do cw <- OStatus.get_cw(entry), in_reply_to <- XML.string_from_xpath("//thr:in-reply-to[1]/@ref", entry), in_reply_to_activity <- fetch_replied_to_activity(entry, in_reply_to), - in_reply_to <- - (in_reply_to_activity && in_reply_to_activity.data["object"]["id"]) || in_reply_to, + in_reply_to_object <- + (in_reply_to_activity && Object.normalize(in_reply_to_activity)) || nil, + in_reply_to <- (in_reply_to_object && in_reply_to_object.data["id"]) || in_reply_to, attachments <- OStatus.get_attachments(entry), context <- get_context(entry, in_reply_to), tags <- OStatus.get_tags(entry), diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex index 9a34d7ad5..4744c6d83 100644 --- a/lib/pleroma/web/ostatus/ostatus.ex +++ b/lib/pleroma/web/ostatus/ostatus.ex @@ -294,7 +294,7 @@ def make_user(uri, update \\ false) do } with false <- update, - %User{} = user <- User.get_by_ap_id(data.ap_id) do + %User{} = user <- User.get_cached_by_ap_id(data.ap_id) do {:ok, user} else _e -> User.insert_or_update_user(data) diff --git a/lib/pleroma/web/push/impl.ex b/lib/pleroma/web/push/impl.ex index 2233480c5..35d3ff07c 100644 --- a/lib/pleroma/web/push/impl.ex +++ b/lib/pleroma/web/push/impl.ex @@ -21,8 +21,10 @@ defmodule Pleroma.Web.Push.Impl do @doc "Performs sending notifications for user subscriptions" @spec perform(Notification.t()) :: list(any) | :error def perform( - %{activity: %{data: %{"type" => activity_type}, id: activity_id}, user_id: user_id} = - notif + %{ + activity: %{data: %{"type" => activity_type}, id: activity_id} = activity, + user_id: user_id + } = notif ) when activity_type in @types do actor = User.get_cached_by_ap_id(notif.activity.data["actor"]) @@ -30,13 +32,14 @@ def perform( type = Activity.mastodon_notification_type(notif.activity) gcm_api_key = Application.get_env(:web_push_encryption, :gcm_api_key) avatar_url = User.avatar_url(actor) + object = Object.normalize(activity) for subscription <- fetch_subsriptions(user_id), get_in(subscription.data, ["alerts", type]) do %{ title: format_title(notif), access_token: subscription.token.token, - body: format_body(notif, actor), + body: format_body(notif, actor, object), notification_id: notif.id, notification_type: type, icon: avatar_url, @@ -95,25 +98,25 @@ def build_sub(subscription) do end def format_body( - %{activity: %{data: %{"type" => "Create", "object" => %{"content" => content}}}}, - actor + %{activity: %{data: %{"type" => "Create"}}}, + actor, + %{data: %{"content" => content}} ) do "@#{actor.nickname}: #{Utils.scrub_html_and_truncate(content, 80)}" end def format_body( - %{activity: %{data: %{"type" => "Announce", "object" => activity_id}}}, - actor + %{activity: %{data: %{"type" => "Announce"}}}, + actor, + %{data: %{"content" => content}} ) do - %Activity{data: %{"object" => %{"id" => object_id}}} = Activity.get_by_ap_id(activity_id) - %Object{data: %{"content" => content}} = Object.get_by_ap_id(object_id) - "@#{actor.nickname} repeated: #{Utils.scrub_html_and_truncate(content, 80)}" end def format_body( %{activity: %{data: %{"type" => type}}}, - actor + actor, + _object ) when type in ["Follow", "Like"] do case type do diff --git a/lib/pleroma/web/rel_me.ex b/lib/pleroma/web/rel_me.ex index eaca41132..26eb614a6 100644 --- a/lib/pleroma/web/rel_me.ex +++ b/lib/pleroma/web/rel_me.ex @@ -6,7 +6,8 @@ defmodule Pleroma.Web.RelMe do @hackney_options [ pool: :media, recv_timeout: 2_000, - max_body: 2_000_000 + max_body: 2_000_000, + with_body: true ] if Mix.env() == :test do diff --git a/lib/pleroma/web/rich_media/parser.ex b/lib/pleroma/web/rich_media/parser.ex index 4bd271d8e..62e8fa610 100644 --- a/lib/pleroma/web/rich_media/parser.ex +++ b/lib/pleroma/web/rich_media/parser.ex @@ -12,7 +12,8 @@ defmodule Pleroma.Web.RichMedia.Parser do @hackney_options [ pool: :media, recv_timeout: 2_000, - max_body: 2_000_000 + max_body: 2_000_000, + with_body: true ] def parse(nil), do: {:error, "No URL provided"} diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index 172f337db..ff4f08af5 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -135,6 +135,7 @@ defmodule Pleroma.Web.Router do post("/password_reset", UtilController, :password_reset) get("/emoji", UtilController, :emoji) get("/captcha", UtilController, :captcha) + get("/healthcheck", UtilController, :healthcheck) end scope "/api/pleroma", Pleroma.Web do @@ -242,7 +243,6 @@ defmodule Pleroma.Web.Router do get("/accounts/verify_credentials", MastodonAPIController, :verify_credentials) get("/accounts/relationships", MastodonAPIController, :relationships) - get("/accounts/search", MastodonAPIController, :account_search) get("/accounts/:id/lists", MastodonAPIController, :account_lists) get("/accounts/:id/identity_proofs", MastodonAPIController, :empty_array) @@ -261,6 +261,7 @@ defmodule Pleroma.Web.Router do post("/notifications/dismiss", MastodonAPIController, :dismiss_notification) get("/notifications", MastodonAPIController, :notifications) get("/notifications/:id", MastodonAPIController, :get_notification) + delete("/notifications/destroy_multiple", MastodonAPIController, :destroy_multiple) get("/scheduled_statuses", MastodonAPIController, :scheduled_statuses) get("/scheduled_statuses/:id", MastodonAPIController, :show_scheduled_status) @@ -376,6 +377,8 @@ defmodule Pleroma.Web.Router do get("/trends", MastodonAPIController, :empty_array) + get("/accounts/search", MastodonAPIController, :account_search) + scope [] do pipe_through(:oauth_read_or_unauthenticated) @@ -392,6 +395,8 @@ defmodule Pleroma.Web.Router do get("/accounts/:id", MastodonAPIController, :user) get("/search", MastodonAPIController, :search) + + get("/pleroma/accounts/:id/favourites", MastodonAPIController, :user_favourites) end end diff --git a/lib/pleroma/web/streamer.ex b/lib/pleroma/web/streamer.ex index a82109f92..72eaf2084 100644 --- a/lib/pleroma/web/streamer.ex +++ b/lib/pleroma/web/streamer.ex @@ -81,7 +81,7 @@ def handle_cast(%{action: :stream, topic: "list", item: item}, topics) do _ -> Pleroma.List.get_lists_from_activity(item) |> Enum.filter(fn list -> - owner = User.get_by_id(list.user_id) + owner = User.get_cached_by_id(list.user_id) Visibility.visible_for_user?(item, owner) end) diff --git a/lib/pleroma/web/templates/layout/app.html.eex b/lib/pleroma/web/templates/layout/app.html.eex index 7d2d609d1..a26b2c3c4 100644 --- a/lib/pleroma/web/templates/layout/app.html.eex +++ b/lib/pleroma/web/templates/layout/app.html.eex @@ -208,6 +208,17 @@ content: ""; } } + .form-row { + display: flex; + } + .form-row > label { + text-align: left; + line-height: 47px; + flex: 1; + } + .form-row > input { + flex: 2; + } diff --git a/lib/pleroma/web/templates/o_auth/o_auth/_scopes.html.eex b/lib/pleroma/web/templates/o_auth/o_auth/_scopes.html.eex index 4b8fb5dae..e6cfe108b 100644 --- a/lib/pleroma/web/templates/o_auth/o_auth/_scopes.html.eex +++ b/lib/pleroma/web/templates/o_auth/o_auth/_scopes.html.eex @@ -5,7 +5,7 @@ <%= for scope <- @available_scopes do %> <%# Note: using hidden input with `unchecked_value` in order to distinguish user's empty selection from `scope` param being omitted %>
- <%= checkbox @form, :"scope_#{scope}", value: scope in @scopes && scope, checked_value: scope, unchecked_value: "", name: assigns[:scope_param] || "scope[]" %> + <%= checkbox @form, :"scope_#{scope}", value: scope in @scopes && scope, checked_value: scope, unchecked_value: "", name: "authorization[scope][]" %> <%= label @form, :"scope_#{scope}", String.capitalize(scope) %>
<% end %> diff --git a/lib/pleroma/web/templates/o_auth/o_auth/consumer.html.eex b/lib/pleroma/web/templates/o_auth/o_auth/consumer.html.eex index 85f62ca64..4bcda7300 100644 --- a/lib/pleroma/web/templates/o_auth/o_auth/consumer.html.eex +++ b/lib/pleroma/web/templates/o_auth/o_auth/consumer.html.eex @@ -1,6 +1,6 @@

Sign in with external provider

-<%= form_for @conn, o_auth_path(@conn, :prepare_request), [method: "get"], fn f -> %> +<%= form_for @conn, o_auth_path(@conn, :prepare_request), [as: "authorization", method: "get"], fn f -> %> <%= render @view_module, "_scopes.html", Map.put(assigns, :form, f) %> <%= hidden_input f, :client_id, value: @client_id %> diff --git a/lib/pleroma/web/templates/o_auth/o_auth/register.html.eex b/lib/pleroma/web/templates/o_auth/o_auth/register.html.eex index 126390391..facedc8db 100644 --- a/lib/pleroma/web/templates/o_auth/o_auth/register.html.eex +++ b/lib/pleroma/web/templates/o_auth/o_auth/register.html.eex @@ -8,8 +8,7 @@

Registration Details

If you'd like to register a new account, please provide the details below.

- -<%= form_for @conn, o_auth_path(@conn, :register), [], fn f -> %> +<%= form_for @conn, o_auth_path(@conn, :register), [as: "authorization"], fn f -> %>
<%= label f, :nickname, "Nickname" %> @@ -25,8 +24,8 @@

Alternatively, sign in to connect to existing account.

- <%= label f, :auth_name, "Name or email" %> - <%= text_input f, :auth_name %> + <%= label f, :name, "Name or email" %> + <%= text_input f, :name %>
<%= label f, :password, "Password" %> diff --git a/lib/pleroma/web/templates/o_auth/o_auth/show.html.eex b/lib/pleroma/web/templates/o_auth/o_auth/show.html.eex index 45f2b5cc0..8b69c3033 100644 --- a/lib/pleroma/web/templates/o_auth/o_auth/show.html.eex +++ b/lib/pleroma/web/templates/o_auth/o_auth/show.html.eex @@ -50,6 +50,8 @@
<% end %> +<%= render @view_module, "_scopes.html", Map.merge(assigns, %{form: f}) %> + <%= hidden_input f, :client_id, value: @client_id %> <%= hidden_input f, :response_type, value: @response_type %> <%= hidden_input f, :redirect_uri, value: @redirect_uri %> diff --git a/lib/pleroma/web/templates/twitter_api/util/password_reset.html.eex b/lib/pleroma/web/templates/twitter_api/util/password_reset.html.eex index 3c7960998..a3facf017 100644 --- a/lib/pleroma/web/templates/twitter_api/util/password_reset.html.eex +++ b/lib/pleroma/web/templates/twitter_api/util/password_reset.html.eex @@ -1,12 +1,13 @@

Password Reset for <%= @user.nickname %>

<%= form_for @conn, util_path(@conn, :password_reset), [as: "data"], fn f -> %> -<%= label f, :password, "Password" %> -<%= password_input f, :password %> -
- -<%= label f, :password_confirmation, "Confirmation" %> -<%= password_input f, :password_confirmation %> -
-<%= hidden_input f, :token, value: @token.token %> -<%= submit "Reset" %> +
+ <%= label f, :password, "Password" %> + <%= password_input f, :password %> +
+
+ <%= label f, :password_confirmation, "Confirmation" %> + <%= password_input f, :password_confirmation %> +
+ <%= hidden_input f, :token, value: @token.token %> + <%= submit "Reset" %> <% end %> diff --git a/lib/pleroma/web/twitter_api/controllers/util_controller.ex b/lib/pleroma/web/twitter_api/controllers/util_controller.ex index d066d35f5..1122e6c5d 100644 --- a/lib/pleroma/web/twitter_api/controllers/util_controller.ex +++ b/lib/pleroma/web/twitter_api/controllers/util_controller.ex @@ -22,7 +22,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do def show_password_reset(conn, %{"token" => token}) do with %{used: false} = token <- Repo.get_by(PasswordResetToken, %{token: token}), - %User{} = user <- User.get_by_id(token.user_id) do + %User{} = user <- User.get_cached_by_id(token.user_id) do render(conn, "password_reset.html", %{ token: token, user: user @@ -75,7 +75,7 @@ def remote_subscribe(conn, %{"user" => %{"nickname" => nick, "profile" => profil def remote_follow(%{assigns: %{user: user}} = conn, %{"acct" => acct}) do if is_status?(acct) do - {:ok, object} = ActivityPub.fetch_object_from_id(acct) + {:ok, object} = Pleroma.Object.Fetcher.fetch_object_from_id(acct) %Activity{id: activity_id} = Activity.get_create_by_object_ap_id(object.data["id"]) redirect(conn, to: "/notice/#{activity_id}") else @@ -101,7 +101,7 @@ def remote_follow(%{assigns: %{user: user}} = conn, %{"acct" => acct}) do end defp is_status?(acct) do - case ActivityPub.fetch_and_contain_remote_object_from_id(acct) do + case Pleroma.Object.Fetcher.fetch_and_contain_remote_object_from_id(acct) do {:ok, %{"type" => type}} when type in ["Article", "Note", "Video", "Page", "Question"] -> true @@ -113,13 +113,13 @@ defp is_status?(acct) do def do_remote_follow(conn, %{ "authorization" => %{"name" => username, "password" => password, "id" => id} }) do - followee = User.get_by_id(id) + followee = User.get_cached_by_id(id) avatar = User.avatar_url(followee) name = followee.nickname with %User{} = user <- User.get_cached_by_nickname(username), true <- Pbkdf2.checkpw(password, user.password_hash), - %User{} = _followed <- User.get_by_id(id), + %User{} = _followed <- User.get_cached_by_id(id), {:ok, follower} <- User.follow(user, followee), {:ok, _activity} <- ActivityPub.follow(follower, followee) do conn @@ -141,7 +141,7 @@ def do_remote_follow(conn, %{ end def do_remote_follow(%{assigns: %{user: user}} = conn, %{"user" => %{"id" => id}}) do - with %User{} = followee <- User.get_by_id(id), + with %User{} = followee <- User.get_cached_by_id(id), {:ok, follower} <- User.follow(user, followee), {:ok, _activity} <- ActivityPub.follow(follower, followee) do conn @@ -286,7 +286,7 @@ def emoji(conn, _params) do emoji = Emoji.get_all() |> Enum.map(fn {short_code, path, tags} -> - {short_code, %{image_url: path, tags: String.split(tags, ",")}} + {short_code, %{image_url: path, tags: tags}} end) |> Enum.into(%{}) @@ -304,7 +304,12 @@ def follow_import(conn, %{"list" => %Plug.Upload{} = listfile}) do end def follow_import(%{assigns: %{user: follower}} = conn, %{"list" => list}) do - with followed_identifiers <- String.split(list), + with lines <- String.split(list, "\n"), + followed_identifiers <- + Enum.map(lines, fn line -> + String.split(line, ",") |> List.first() + end) + |> List.delete("Account address"), {:ok, _} = Task.start(fn -> User.follow_import(follower, followed_identifiers) end) do json(conn, "job started") end @@ -358,4 +363,22 @@ def delete_account(%{assigns: %{user: user}} = conn, params) do def captcha(conn, _params) do json(conn, Pleroma.Captcha.new()) end + + def healthcheck(conn, _params) do + info = + if Pleroma.Config.get([:instance, :healthcheck]) do + Pleroma.Healthcheck.system_info() + else + %{} + end + + conn = + if info[:healthy] do + conn + else + Plug.Conn.put_status(conn, :service_unavailable) + end + + json(conn, info) + end end diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex index 9e9a46cf1..adeac6f3c 100644 --- a/lib/pleroma/web/twitter_api/twitter_api.ex +++ b/lib/pleroma/web/twitter_api/twitter_api.ex @@ -4,10 +4,10 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do alias Pleroma.Activity - alias Pleroma.Mailer + alias Pleroma.Emails.Mailer + alias Pleroma.Emails.UserEmail alias Pleroma.Repo alias Pleroma.User - alias Pleroma.UserEmail alias Pleroma.UserInviteToken alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.CommonAPI @@ -240,7 +240,7 @@ def get_user(user \\ nil, params) do end %{"screen_name" => nickname} -> - case User.get_by_nickname(nickname) do + case User.get_cached_by_nickname(nickname) do nil -> {:error, "No user with such screen_name"} target -> {:ok, target} end @@ -266,6 +266,7 @@ defp parse_int(string, default) when is_binary(string) do defp parse_int(_, default), do: default + # TODO: unify the search query with MastoAPI one and do only pagination here def search(_user, %{"q" => query} = params) do limit = parse_int(params["rpp"], 20) page = parse_int(params["page"], 1) @@ -273,13 +274,13 @@ def search(_user, %{"q" => query} = params) do q = from( - a in Activity, + [a, o] in Activity.with_preloaded_object(Activity), where: fragment("?->>'type' = 'Create'", a.data), where: "https://www.w3.org/ns/activitystreams#Public" in a.recipients, where: fragment( - "to_tsvector('english', ?->'object'->>'content') @@ plainto_tsquery('english', ?)", - a.data, + "to_tsvector('english', ?->>'content') @@ plainto_tsquery('english', ?)", + o.data, ^query ), limit: ^limit, diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex index a7ec9949c..79ed9dad2 100644 --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@ -434,7 +434,7 @@ def password_reset(conn, params) do end def confirm_email(conn, %{"user_id" => uid, "token" => token}) do - with %User{} = user <- User.get_by_id(uid), + with %User{} = user <- User.get_cached_by_id(uid), true <- user.local, true <- user.info.confirmation_pending, true <- user.info.confirmation_token == token, @@ -587,7 +587,7 @@ def friend_requests(conn, params) do def approve_friend_request(conn, %{"user_id" => uid} = _params) do with followed <- conn.assigns[:user], - %User{} = follower <- User.get_by_id(uid), + %User{} = follower <- User.get_cached_by_id(uid), {:ok, follower} <- CommonAPI.accept_follow_request(follower, followed) do conn |> put_view(UserView) @@ -599,7 +599,7 @@ def approve_friend_request(conn, %{"user_id" => uid} = _params) do def deny_friend_request(conn, %{"user_id" => uid} = _params) do with followed <- conn.assigns[:user], - %User{} = follower <- User.get_by_id(uid), + %User{} = follower <- User.get_cached_by_id(uid), {:ok, follower} <- CommonAPI.reject_follow_request(follower, followed) do conn |> put_view(UserView) @@ -632,7 +632,7 @@ def raw_empty_array(conn, _params) do defp build_info_cng(user, params) do info_params = - ["no_rich_text", "locked", "hide_followers", "hide_follows", "show_role"] + ["no_rich_text", "locked", "hide_followers", "hide_follows", "hide_favorites", "show_role"] |> Enum.reduce(%{}, fn key, res -> if value = params[key] do Map.put(res, key, value == "true") diff --git a/lib/pleroma/web/twitter_api/views/activity_view.ex b/lib/pleroma/web/twitter_api/views/activity_view.ex index 433322eb8..c64152da8 100644 --- a/lib/pleroma/web/twitter_api/views/activity_view.ex +++ b/lib/pleroma/web/twitter_api/views/activity_view.ex @@ -224,15 +224,17 @@ def render("activity.json", %{activity: %{data: %{"type" => "Like"}} = activity} def render( "activity.json", - %{activity: %{data: %{"type" => "Create", "object" => object}} = activity} = opts + %{activity: %{data: %{"type" => "Create", "object" => object_id}} = activity} = opts ) do user = get_user(activity.data["actor"], opts) - created_at = object["published"] |> Utils.date_to_asctime() - like_count = object["like_count"] || 0 - announcement_count = object["announcement_count"] || 0 - favorited = opts[:for] && opts[:for].ap_id in (object["likes"] || []) - repeated = opts[:for] && opts[:for].ap_id in (object["announcements"] || []) + object = Object.normalize(object_id) + + created_at = object.data["published"] |> Utils.date_to_asctime() + like_count = object.data["like_count"] || 0 + announcement_count = object.data["announcement_count"] || 0 + favorited = opts[:for] && opts[:for].ap_id in (object.data["likes"] || []) + repeated = opts[:for] && opts[:for].ap_id in (object.data["announcements"] || []) pinned = activity.id in user.info.pinned_activities attentions = @@ -245,12 +247,12 @@ def render( conversation_id = get_context_id(activity, opts) - tags = activity.data["object"]["tag"] || [] - possibly_sensitive = activity.data["object"]["sensitive"] || Enum.member?(tags, "nsfw") + tags = object.data["tag"] || [] + possibly_sensitive = object.data["sensitive"] || Enum.member?(tags, "nsfw") tags = if possibly_sensitive, do: Enum.uniq(["nsfw" | tags]), else: tags - {summary, content} = render_content(object) + {summary, content} = render_content(object.data) html = content @@ -259,7 +261,7 @@ def render( activity, "twitterapi:content" ) - |> Formatter.emojify(object["emoji"]) + |> Formatter.emojify(object.data["emoji"]) text = if content do @@ -284,33 +286,33 @@ def render( %{ "id" => activity.id, - "uri" => activity.data["object"]["id"], + "uri" => object.data["id"], "user" => UserView.render("show.json", %{user: user, for: opts[:for]}), "statusnet_html" => html, "text" => text, "is_local" => activity.local, "is_post_verb" => true, "created_at" => created_at, - "in_reply_to_status_id" => object["inReplyToStatusId"], + "in_reply_to_status_id" => reply_parent && reply_parent.id, "in_reply_to_screen_name" => reply_user && reply_user.nickname, "in_reply_to_profileurl" => User.profile_url(reply_user), "in_reply_to_ostatus_uri" => reply_user && reply_user.ap_id, "in_reply_to_user_id" => reply_user && reply_user.id, "statusnet_conversation_id" => conversation_id, - "attachments" => (object["attachment"] || []) |> ObjectRepresenter.enum_to_list(opts), + "attachments" => (object.data["attachment"] || []) |> ObjectRepresenter.enum_to_list(opts), "attentions" => attentions, "fave_num" => like_count, "repeat_num" => announcement_count, "favorited" => !!favorited, "repeated" => !!repeated, "pinned" => pinned, - "external_url" => object["external_url"] || object["id"], + "external_url" => object.data["external_url"] || object.data["id"], "tags" => tags, "activity_type" => "post", "possibly_sensitive" => possibly_sensitive, "visibility" => StatusView.get_visibility(object), "summary" => summary, - "summary_html" => summary |> Formatter.emojify(object["emoji"]), + "summary_html" => summary |> Formatter.emojify(object.data["emoji"]), "card" => card, "muted" => CommonAPI.thread_muted?(user, activity) || User.mutes?(opts[:for], user) } diff --git a/lib/pleroma/web/twitter_api/views/user_view.ex b/lib/pleroma/web/twitter_api/views/user_view.ex index 0791ed760..ea015b8f0 100644 --- a/lib/pleroma/web/twitter_api/views/user_view.ex +++ b/lib/pleroma/web/twitter_api/views/user_view.ex @@ -74,58 +74,49 @@ defp do_render("user.json", %{user: user = %User{}} = assigns) do |> Enum.filter(fn %{"type" => t} -> t == "PropertyValue" end) |> Enum.map(fn fields -> Map.take(fields, ["name", "value"]) end) - data = %{ - "created_at" => user.inserted_at |> Utils.format_naive_asctime(), - "description" => HTML.strip_tags((user.bio || "") |> String.replace("
", "\n")), - "description_html" => HTML.filter_tags(user.bio, User.html_filter_policy(for_user)), - "favourites_count" => 0, - "followers_count" => user_info[:follower_count], - "following" => following, - "follows_you" => follows_you, - "statusnet_blocking" => statusnet_blocking, - "friends_count" => user_info[:following_count], - "id" => user.id, - "name" => user.name || user.nickname, - "name_html" => - if(user.name, - do: HTML.strip_tags(user.name) |> Formatter.emojify(emoji), - else: user.nickname - ), - "profile_image_url" => image, - "profile_image_url_https" => image, - "profile_image_url_profile_size" => image, - "profile_image_url_original" => image, - "rights" => %{ - "delete_others_notice" => !!user.info.is_moderator, - "admin" => !!user.info.is_admin - }, - "screen_name" => user.nickname, - "statuses_count" => user_info[:note_count], - "statusnet_profile_url" => user.ap_id, - "cover_photo" => User.banner_url(user) |> MediaProxy.url(), - "background_image" => image_url(user.info.background) |> MediaProxy.url(), - "is_local" => user.local, - "locked" => user.info.locked, - "default_scope" => user.info.default_scope, - "no_rich_text" => user.info.no_rich_text, - "hide_followers" => user.info.hide_followers, - "hide_follows" => user.info.hide_follows, - "fields" => fields, - - # Pleroma extension - "pleroma" => - %{ - "confirmation_pending" => user_info.confirmation_pending, - "tags" => user.tags - } - |> maybe_with_activation_status(user, for_user) - } - data = - if(user.info.is_admin || user.info.is_moderator, - do: maybe_with_role(data, user, for_user), - else: data - ) + %{ + "created_at" => user.inserted_at |> Utils.format_naive_asctime(), + "description" => HTML.strip_tags((user.bio || "") |> String.replace("
", "\n")), + "description_html" => HTML.filter_tags(user.bio, User.html_filter_policy(for_user)), + "favourites_count" => 0, + "followers_count" => user_info[:follower_count], + "following" => following, + "follows_you" => follows_you, + "statusnet_blocking" => statusnet_blocking, + "friends_count" => user_info[:following_count], + "id" => user.id, + "name" => user.name || user.nickname, + "name_html" => + if(user.name, + do: HTML.strip_tags(user.name) |> Formatter.emojify(emoji), + else: user.nickname + ), + "profile_image_url" => image, + "profile_image_url_https" => image, + "profile_image_url_profile_size" => image, + "profile_image_url_original" => image, + "screen_name" => user.nickname, + "statuses_count" => user_info[:note_count], + "statusnet_profile_url" => user.ap_id, + "cover_photo" => User.banner_url(user) |> MediaProxy.url(), + "background_image" => image_url(user.info.background) |> MediaProxy.url(), + "is_local" => user.local, + "locked" => user.info.locked, + "hide_followers" => user.info.hide_followers, + "hide_follows" => user.info.hide_follows, + "fields" => fields, + + # Pleroma extension + "pleroma" => + %{ + "confirmation_pending" => user_info.confirmation_pending, + "tags" => user.tags + } + |> maybe_with_activation_status(user, for_user) + } + |> maybe_with_user_settings(user, for_user) + |> maybe_with_role(user, for_user) if assigns[:token] do Map.put(data, "token", token_string(assigns[:token])) @@ -141,15 +132,35 @@ defp maybe_with_activation_status(data, user, %User{info: %{is_admin: true}}) do defp maybe_with_activation_status(data, _, _), do: data defp maybe_with_role(data, %User{id: id} = user, %User{id: id}) do - Map.merge(data, %{"role" => role(user), "show_role" => user.info.show_role}) + Map.merge(data, %{ + "role" => role(user), + "show_role" => user.info.show_role, + "rights" => %{ + "delete_others_notice" => !!user.info.is_moderator, + "admin" => !!user.info.is_admin + } + }) end defp maybe_with_role(data, %User{info: %{show_role: true}} = user, _user) do - Map.merge(data, %{"role" => role(user)}) + Map.merge(data, %{ + "role" => role(user), + "rights" => %{ + "delete_others_notice" => !!user.info.is_moderator, + "admin" => !!user.info.is_admin + } + }) end defp maybe_with_role(data, _, _), do: data + defp maybe_with_user_settings(data, %User{info: info, id: id} = _user, %User{id: id}) do + data + |> Kernel.put_in(["default_scope"], info.default_scope) + |> Kernel.put_in(["no_rich_text"], info.no_rich_text) + end + + defp maybe_with_user_settings(data, _, _), do: data defp role(%User{info: %{:is_admin => true}}), do: "admin" defp role(%User{info: %{:is_moderator => true}}), do: "moderator" defp role(_), do: "member" diff --git a/lib/pleroma/web/web_finger/web_finger.ex b/lib/pleroma/web/web_finger/web_finger.ex index 32c3455f5..a3b0bf999 100644 --- a/lib/pleroma/web/web_finger/web_finger.ex +++ b/lib/pleroma/web/web_finger/web_finger.ex @@ -37,7 +37,7 @@ def webfinger(resource, fmt) when fmt in ["XML", "JSON"] do regex = ~r/(acct:)?(?\w+)@#{host}/ with %{"username" => username} <- Regex.named_captures(regex, resource), - %User{} = user <- User.get_by_nickname(username) do + %User{} = user <- User.get_cached_by_nickname(username) do {:ok, represent_user(user, fmt)} else _e -> diff --git a/mix.exs b/mix.exs index 26a03b70b..efaa06a1c 100644 --- a/mix.exs +++ b/mix.exs @@ -22,7 +22,7 @@ def project do homepage_url: "https://pleroma.social/", docs: [ logo: "priv/static/static/logo.png", - extras: ["README.md" | Path.wildcard("docs/**/*.md")], + extras: ["README.md", "CHANGELOG.md"] ++ Path.wildcard("docs/**/*.md"), groups_for_extras: [ "Installation manuals": Path.wildcard("docs/installation/*.md"), Configuration: Path.wildcard("docs/config/*.md"), @@ -84,13 +84,14 @@ defp deps do {:ex_aws, "~> 2.0"}, {:ex_aws_s3, "~> 2.0"}, {:earmark, "~> 1.3"}, + {:bbcode, "~> 0.1"}, {:ex_machina, "~> 2.3", only: :test}, {:credo, "~> 0.9.3", only: [:dev, :test]}, {:mock, "~> 0.3.1", only: :test}, {:crypt, git: "https://github.com/msantos/crypt", ref: "1f2b58927ab57e72910191a7ebaeff984382a1d3"}, {:cors_plug, "~> 1.5"}, - {:ex_doc, "~> 0.19", only: :dev, runtime: false}, + {:ex_doc, "~> 0.20.2", only: :dev, runtime: false}, {:web_push_encryption, "~> 0.2.1"}, {:swoosh, "~> 0.20"}, {:gen_smtp, "~> 0.13"}, @@ -101,7 +102,7 @@ defp deps do {:ueberauth, "~> 0.4"}, {:auto_linker, git: "https://git.pleroma.social/pleroma/auto_linker.git", - ref: "479dd343f4e563ff91215c8275f3b5c67e032850"}, + ref: "90613b4bae875a3610c275b7056b61ffdd53210d"}, {:pleroma_job_queue, "~> 0.2.0"}, {:telemetry, "~> 0.3"}, {:prometheus_ex, "~> 3.0"}, diff --git a/mix.lock b/mix.lock index bb40ebd48..979d599b4 100644 --- a/mix.lock +++ b/mix.lock @@ -1,7 +1,8 @@ %{ "accept": {:hex, :accept, "0.3.5", "b33b127abca7cc948bbe6caa4c263369abf1347cfa9d8e699c6d214660f10cd1", [:rebar3], [], "hexpm"}, - "auto_linker": {:git, "https://git.pleroma.social/pleroma/auto_linker.git", "479dd343f4e563ff91215c8275f3b5c67e032850", [ref: "479dd343f4e563ff91215c8275f3b5c67e032850"]}, + "auto_linker": {:git, "https://git.pleroma.social/pleroma/auto_linker.git", "90613b4bae875a3610c275b7056b61ffdd53210d", [ref: "90613b4bae875a3610c275b7056b61ffdd53210d"]}, "base64url": {:hex, :base64url, "0.0.1", "36a90125f5948e3afd7be97662a1504b934dd5dac78451ca6e9abf85a10286be", [:rebar], [], "hexpm"}, + "bbcode": {:hex, :bbcode, "0.1.0", "400e618b640b635261611d7fb7f79d104917fc5b084aae371ab6b08477cb035b", [:mix], [{:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"}, "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"}, "cachex": {:hex, :cachex, "3.0.2", "1351caa4e26e29f7d7ec1d29b53d6013f0447630bbf382b4fb5d5bad0209f203", [:mix], [{:eternal, "~> 1.2", [hex: :eternal, repo: "hexpm", optional: false]}, {:unsafe, "~> 1.0", [hex: :unsafe, repo: "hexpm", optional: false]}], "hexpm"}, "calendar": {:hex, :calendar, "0.17.4", "22c5e8d98a4db9494396e5727108dffb820ee0d18fed4b0aa8ab76e4f5bc32f1", [:mix], [{:tzdata, "~> 0.5.8 or ~> 0.1.201603", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm"}, @@ -16,13 +17,13 @@ "crypt": {:git, "https://github.com/msantos/crypt", "1f2b58927ab57e72910191a7ebaeff984382a1d3", [ref: "1f2b58927ab57e72910191a7ebaeff984382a1d3"]}, "db_connection": {:hex, :db_connection, "2.0.5", "ddb2ba6761a08b2bb9ca0e7d260e8f4dd39067426d835c24491a321b7f92a4da", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"}, "decimal": {:hex, :decimal, "1.7.0", "30d6b52c88541f9a66637359ddf85016df9eb266170d53105f02e4a67e00c5aa", [:mix], [], "hexpm"}, - "earmark": {:hex, :earmark, "1.3.0", "17f0c38eaafb4800f746b457313af4b2442a8c2405b49c645768680f900be603", [:mix], [], "hexpm"}, + "earmark": {:hex, :earmark, "1.3.2", "b840562ea3d67795ffbb5bd88940b1bed0ed9fa32834915125ea7d02e35888a5", [:mix], [], "hexpm"}, "ecto": {:hex, :ecto, "3.0.7", "44dda84ac6b17bbbdeb8ac5dfef08b7da253b37a453c34ab1a98de7f7e5fec7f", [:mix], [{:decimal, "~> 1.6", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm"}, "ecto_sql": {:hex, :ecto_sql, "3.0.5", "7e44172b4f7aca4469f38d7f6a3da394dbf43a1bcf0ca975e958cb957becd74e", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.0.6", [hex: :ecto, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.9.1", [hex: :mariaex, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.14.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.3.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"}, "eternal": {:hex, :eternal, "1.2.0", "e2a6b6ce3b8c248f7dc31451aefca57e3bdf0e48d73ae5043229380a67614c41", [:mix], [], "hexpm"}, "ex_aws": {:hex, :ex_aws, "2.1.0", "b92651527d6c09c479f9013caa9c7331f19cba38a650590d82ebf2c6c16a1d8a", [:mix], [{:configparser_ex, "~> 2.0", [hex: :configparser_ex, repo: "hexpm", optional: true]}, {:hackney, "1.6.3 or 1.6.5 or 1.7.1 or 1.8.6 or ~> 1.9", [hex: :hackney, repo: "hexpm", optional: true]}, {:jsx, "~> 2.8", [hex: :jsx, repo: "hexpm", optional: true]}, {:poison, ">= 1.2.0", [hex: :poison, repo: "hexpm", optional: true]}, {:sweet_xml, "~> 0.6", [hex: :sweet_xml, repo: "hexpm", optional: true]}, {:xml_builder, "~> 0.1.0", [hex: :xml_builder, repo: "hexpm", optional: true]}], "hexpm"}, "ex_aws_s3": {:hex, :ex_aws_s3, "2.0.1", "9e09366e77f25d3d88c5393824e613344631be8db0d1839faca49686e99b6704", [:mix], [{:ex_aws, "~> 2.0", [hex: :ex_aws, repo: "hexpm", optional: false]}, {:sweet_xml, ">= 0.0.0", [hex: :sweet_xml, repo: "hexpm", optional: true]}], "hexpm"}, - "ex_doc": {:hex, :ex_doc, "0.19.1", "519bb9c19526ca51d326c060cb1778d4a9056b190086a8c6c115828eaccea6cf", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.7", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"}, + "ex_doc": {:hex, :ex_doc, "0.20.2", "1bd0dfb0304bade58beb77f20f21ee3558cc3c753743ae0ddbb0fd7ba2912331", [:mix], [{:earmark, "~> 1.3", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"}, "ex_machina": {:hex, :ex_machina, "2.3.0", "92a5ad0a8b10ea6314b876a99c8c9e3f25f4dde71a2a835845b136b9adaf199a", [:mix], [{:ecto, "~> 2.2 or ~> 3.0", [hex: :ecto, repo: "hexpm", optional: true]}, {:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}], "hexpm"}, "ex_syslogger": {:git, "https://github.com/slashmili/ex_syslogger.git", "f3963399047af17e038897c69e20d552e6899e1d", [tag: "1.4.0"]}, "floki": {:hex, :floki, "0.20.4", "be42ac911fece24b4c72f3b5846774b6e61b83fe685c2fc9d62093277fb3bc86", [:mix], [{:html_entities, "~> 0.4.0", [hex: :html_entities, repo: "hexpm", optional: false]}, {:mochiweb, "~> 2.15", [hex: :mochiweb, repo: "hexpm", optional: false]}], "hexpm"}, @@ -35,8 +36,8 @@ "idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"}, "jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, "jose": {:hex, :jose, "1.8.4", "7946d1e5c03a76ac9ef42a6e6a20001d35987afd68c2107bcd8f01a84e75aa73", [:mix, :rebar3], [{:base64url, "~> 0.0.1", [hex: :base64url, repo: "hexpm", optional: false]}], "hexpm"}, - "makeup": {:hex, :makeup, "0.5.5", "9e08dfc45280c5684d771ad58159f718a7b5788596099bdfb0284597d368a882", [:mix], [{:nimble_parsec, "~> 0.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.10.0", "0f09c2ddf352887a956d84f8f7e702111122ca32fbbc84c2f0569b8b65cbf7fa", [:mix], [{:makeup, "~> 0.5.5", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm"}, + "makeup": {:hex, :makeup, "0.8.0", "9cf32aea71c7fe0a4b2e9246c2c4978f9070257e5c9ce6d4a28ec450a839b55f", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"}, + "makeup_elixir": {:hex, :makeup_elixir, "0.13.0", "be7a477997dcac2e48a9d695ec730b2d22418292675c75aa2d34ba0909dcdeda", [:mix], [{:makeup, "~> 0.8", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm"}, "meck": {:hex, :meck, "0.8.13", "ffedb39f99b0b99703b8601c6f17c7f76313ee12de6b646e671e3188401f7866", [:rebar3], [], "hexpm"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm"}, "mime": {:hex, :mime, "1.3.1", "30ce04ab3175b6ad0bdce0035cba77bba68b813d523d1aac73d9781b4d193cf8", [:mix], [], "hexpm"}, @@ -44,7 +45,7 @@ "mochiweb": {:hex, :mochiweb, "2.15.0", "e1daac474df07651e5d17cc1e642c4069c7850dc4508d3db7263a0651330aacc", [:rebar3], [], "hexpm"}, "mock": {:hex, :mock, "0.3.1", "994f00150f79a0ea50dc9d86134cd9ebd0d177ad60bd04d1e46336cdfdb98ff9", [:mix], [{:meck, "~> 0.8.8", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm"}, "mogrify": {:hex, :mogrify, "0.6.1", "de1b527514f2d95a7bbe9642eb556061afb337e220cf97adbf3a4e6438ed70af", [:mix], [], "hexpm"}, - "nimble_parsec": {:hex, :nimble_parsec, "0.4.0", "ee261bb53214943679422be70f1658fff573c5d0b0a1ecd0f18738944f818efe", [:mix], [], "hexpm"}, + "nimble_parsec": {:hex, :nimble_parsec, "0.5.0", "90e2eca3d0266e5c53f8fbe0079694740b9c91b6747f2b7e3c5d21966bba8300", [:mix], [], "hexpm"}, "parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm"}, "pbkdf2_elixir": {:hex, :pbkdf2_elixir, "0.12.3", "6706a148809a29c306062862c803406e88f048277f6e85b68faf73291e820b84", [:mix], [], "hexpm"}, "phoenix": {:hex, :phoenix, "1.4.1", "801f9d632808657f1f7c657c8bbe624caaf2ba91429123ebe3801598aea4c3d9", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm"}, diff --git a/priv/repo/migrations/20190413082658_create_bookmarks.exs b/priv/repo/migrations/20190413082658_create_bookmarks.exs new file mode 100644 index 000000000..38b108158 --- /dev/null +++ b/priv/repo/migrations/20190413082658_create_bookmarks.exs @@ -0,0 +1,14 @@ +defmodule Pleroma.Repo.Migrations.CreateBookmarks do + use Ecto.Migration + + def change do + create table(:bookmarks) do + add(:user_id, references(:users, type: :uuid, on_delete: :delete_all)) + add(:activity_id, references(:activities, type: :uuid, on_delete: :delete_all)) + + timestamps() + end + + create(unique_index(:bookmarks, [:user_id, :activity_id])) + end +end diff --git a/priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs b/priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs new file mode 100644 index 000000000..ebe69696e --- /dev/null +++ b/priv/repo/migrations/20190414125034_migrate_old_bookmarks.exs @@ -0,0 +1,29 @@ +defmodule Pleroma.Repo.Migrations.MigrateOldBookmarks do + use Ecto.Migration + import Ecto.Query + alias Pleroma.Activity + alias Pleroma.Bookmark + alias Pleroma.User + alias Pleroma.Repo + + def change do + query = + from(u in User, + where: u.local == true, + where: fragment("array_length(bookmarks, 1)") > 0, + select: %{id: u.id, bookmarks: fragment("bookmarks")} + ) + + Repo.stream(query) + |> Enum.each(fn %{id: user_id, bookmarks: bookmarks} -> + Enum.each(bookmarks, fn ap_id -> + activity = Activity.get_create_by_object_ap_id(ap_id) + {:ok, _} = Bookmark.create(user_id, activity.id) + end) + end) + + alter table(:users) do + remove(:bookmarks) + end + end +end diff --git a/priv/static/finmoji/1000px/a_trusted_friend.png b/priv/static/finmoji/1000px/a_trusted_friend.png deleted file mode 100644 index 5658d589c..000000000 Binary files a/priv/static/finmoji/1000px/a_trusted_friend.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/alandislands.png b/priv/static/finmoji/1000px/alandislands.png deleted file mode 100644 index 094dd3284..000000000 Binary files a/priv/static/finmoji/1000px/alandislands.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/association.png b/priv/static/finmoji/1000px/association.png deleted file mode 100644 index dad3b8864..000000000 Binary files a/priv/static/finmoji/1000px/association.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/auroraborealis.png b/priv/static/finmoji/1000px/auroraborealis.png deleted file mode 100644 index 5875dc2c4..000000000 Binary files a/priv/static/finmoji/1000px/auroraborealis.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/baby_in_a_box.png b/priv/static/finmoji/1000px/baby_in_a_box.png deleted file mode 100644 index 9479aaebb..000000000 Binary files a/priv/static/finmoji/1000px/baby_in_a_box.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/bear.png b/priv/static/finmoji/1000px/bear.png deleted file mode 100644 index 5d9fbb320..000000000 Binary files a/priv/static/finmoji/1000px/bear.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/black_gold.png b/priv/static/finmoji/1000px/black_gold.png deleted file mode 100644 index 707e949ec..000000000 Binary files a/priv/static/finmoji/1000px/black_gold.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/christmasparty.png b/priv/static/finmoji/1000px/christmasparty.png deleted file mode 100644 index 785decb8d..000000000 Binary files a/priv/static/finmoji/1000px/christmasparty.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/crosscountryskiing.png b/priv/static/finmoji/1000px/crosscountryskiing.png deleted file mode 100644 index 2a9bddf41..000000000 Binary files a/priv/static/finmoji/1000px/crosscountryskiing.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/cupofcoffee.png b/priv/static/finmoji/1000px/cupofcoffee.png deleted file mode 100644 index a12cc867c..000000000 Binary files a/priv/static/finmoji/1000px/cupofcoffee.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/education.png b/priv/static/finmoji/1000px/education.png deleted file mode 100644 index af9feee59..000000000 Binary files a/priv/static/finmoji/1000px/education.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/fashionista_finns.png b/priv/static/finmoji/1000px/fashionista_finns.png deleted file mode 100644 index d1140250d..000000000 Binary files a/priv/static/finmoji/1000px/fashionista_finns.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/finnishlove.png b/priv/static/finmoji/1000px/finnishlove.png deleted file mode 100644 index 00148202f..000000000 Binary files a/priv/static/finmoji/1000px/finnishlove.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/flag.png b/priv/static/finmoji/1000px/flag.png deleted file mode 100644 index e709449d7..000000000 Binary files a/priv/static/finmoji/1000px/flag.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/forest.png b/priv/static/finmoji/1000px/forest.png deleted file mode 100644 index b2d64ea37..000000000 Binary files a/priv/static/finmoji/1000px/forest.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/four_seasons_of_bbq.png b/priv/static/finmoji/1000px/four_seasons_of_bbq.png deleted file mode 100644 index 42f4a7fb7..000000000 Binary files a/priv/static/finmoji/1000px/four_seasons_of_bbq.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/girlpower.png b/priv/static/finmoji/1000px/girlpower.png deleted file mode 100644 index 7674f2e26..000000000 Binary files a/priv/static/finmoji/1000px/girlpower.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/handshake.png b/priv/static/finmoji/1000px/handshake.png deleted file mode 100644 index d9857d699..000000000 Binary files a/priv/static/finmoji/1000px/handshake.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/happiness.png b/priv/static/finmoji/1000px/happiness.png deleted file mode 100644 index fbfc34fe4..000000000 Binary files a/priv/static/finmoji/1000px/happiness.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/headbanger.png b/priv/static/finmoji/1000px/headbanger.png deleted file mode 100644 index d9c2f6247..000000000 Binary files a/priv/static/finmoji/1000px/headbanger.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/icebreaker.png b/priv/static/finmoji/1000px/icebreaker.png deleted file mode 100644 index aedce3dca..000000000 Binary files a/priv/static/finmoji/1000px/icebreaker.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/iceman.png b/priv/static/finmoji/1000px/iceman.png deleted file mode 100644 index c172e60d5..000000000 Binary files a/priv/static/finmoji/1000px/iceman.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/joulutorttu.png b/priv/static/finmoji/1000px/joulutorttu.png deleted file mode 100644 index d7b5a7e53..000000000 Binary files a/priv/static/finmoji/1000px/joulutorttu.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/kaamos.png b/priv/static/finmoji/1000px/kaamos.png deleted file mode 100644 index 139b21953..000000000 Binary files a/priv/static/finmoji/1000px/kaamos.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/kalsarikannit_f.png b/priv/static/finmoji/1000px/kalsarikannit_f.png deleted file mode 100644 index 064c86160..000000000 Binary files a/priv/static/finmoji/1000px/kalsarikannit_f.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/kalsarikannit_m.png b/priv/static/finmoji/1000px/kalsarikannit_m.png deleted file mode 100644 index e08bd27af..000000000 Binary files a/priv/static/finmoji/1000px/kalsarikannit_m.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/karjalanpiirakka.png b/priv/static/finmoji/1000px/karjalanpiirakka.png deleted file mode 100644 index dbf647df5..000000000 Binary files a/priv/static/finmoji/1000px/karjalanpiirakka.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/kicksled.png b/priv/static/finmoji/1000px/kicksled.png deleted file mode 100644 index 305a56f77..000000000 Binary files a/priv/static/finmoji/1000px/kicksled.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/kokko.png b/priv/static/finmoji/1000px/kokko.png deleted file mode 100644 index 0a5472c9a..000000000 Binary files a/priv/static/finmoji/1000px/kokko.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/lavatanssit.png b/priv/static/finmoji/1000px/lavatanssit.png deleted file mode 100644 index a1f0a69dd..000000000 Binary files a/priv/static/finmoji/1000px/lavatanssit.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/losthopes_f.png b/priv/static/finmoji/1000px/losthopes_f.png deleted file mode 100644 index a847df3c5..000000000 Binary files a/priv/static/finmoji/1000px/losthopes_f.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/losthopes_m.png b/priv/static/finmoji/1000px/losthopes_m.png deleted file mode 100644 index 93c83b995..000000000 Binary files a/priv/static/finmoji/1000px/losthopes_m.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/mattinykanen.png b/priv/static/finmoji/1000px/mattinykanen.png deleted file mode 100644 index 2d9c9d38f..000000000 Binary files a/priv/static/finmoji/1000px/mattinykanen.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/meanwhileinfinland.png b/priv/static/finmoji/1000px/meanwhileinfinland.png deleted file mode 100644 index 794db1eed..000000000 Binary files a/priv/static/finmoji/1000px/meanwhileinfinland.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/moominmamma.png b/priv/static/finmoji/1000px/moominmamma.png deleted file mode 100644 index d34b1b98b..000000000 Binary files a/priv/static/finmoji/1000px/moominmamma.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/nordicfamily.png b/priv/static/finmoji/1000px/nordicfamily.png deleted file mode 100644 index 21292eaff..000000000 Binary files a/priv/static/finmoji/1000px/nordicfamily.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/out_of_office.png b/priv/static/finmoji/1000px/out_of_office.png deleted file mode 100644 index b72d6dbd5..000000000 Binary files a/priv/static/finmoji/1000px/out_of_office.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/peacemaker.png b/priv/static/finmoji/1000px/peacemaker.png deleted file mode 100644 index 48a51fa6f..000000000 Binary files a/priv/static/finmoji/1000px/peacemaker.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/perkele.png b/priv/static/finmoji/1000px/perkele.png deleted file mode 100644 index 16a68d053..000000000 Binary files a/priv/static/finmoji/1000px/perkele.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/pesapallo.png b/priv/static/finmoji/1000px/pesapallo.png deleted file mode 100644 index 2f35c8e02..000000000 Binary files a/priv/static/finmoji/1000px/pesapallo.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/polarbear.png b/priv/static/finmoji/1000px/polarbear.png deleted file mode 100644 index ce6c65e8b..000000000 Binary files a/priv/static/finmoji/1000px/polarbear.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/pusa_hispida_saimensis.png b/priv/static/finmoji/1000px/pusa_hispida_saimensis.png deleted file mode 100644 index 35ec8caed..000000000 Binary files a/priv/static/finmoji/1000px/pusa_hispida_saimensis.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/reindeer.png b/priv/static/finmoji/1000px/reindeer.png deleted file mode 100644 index e60f0f0a4..000000000 Binary files a/priv/static/finmoji/1000px/reindeer.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/sami.png b/priv/static/finmoji/1000px/sami.png deleted file mode 100644 index e4703dfd2..000000000 Binary files a/priv/static/finmoji/1000px/sami.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/sauna_f.png b/priv/static/finmoji/1000px/sauna_f.png deleted file mode 100644 index 9a4ba8629..000000000 Binary files a/priv/static/finmoji/1000px/sauna_f.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/sauna_m.png b/priv/static/finmoji/1000px/sauna_m.png deleted file mode 100644 index 4bdd33f7b..000000000 Binary files a/priv/static/finmoji/1000px/sauna_m.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/sauna_whisk.png b/priv/static/finmoji/1000px/sauna_whisk.png deleted file mode 100644 index c16928065..000000000 Binary files a/priv/static/finmoji/1000px/sauna_whisk.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/sisu.png b/priv/static/finmoji/1000px/sisu.png deleted file mode 100644 index 238453bb5..000000000 Binary files a/priv/static/finmoji/1000px/sisu.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/stuck.png b/priv/static/finmoji/1000px/stuck.png deleted file mode 100644 index 4180e3ecd..000000000 Binary files a/priv/static/finmoji/1000px/stuck.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/suomimainittu.png b/priv/static/finmoji/1000px/suomimainittu.png deleted file mode 100644 index af46347f5..000000000 Binary files a/priv/static/finmoji/1000px/suomimainittu.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/superfood.png b/priv/static/finmoji/1000px/superfood.png deleted file mode 100644 index 8fa033c18..000000000 Binary files a/priv/static/finmoji/1000px/superfood.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/swan.png b/priv/static/finmoji/1000px/swan.png deleted file mode 100644 index 5363f861d..000000000 Binary files a/priv/static/finmoji/1000px/swan.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/the_cap.png b/priv/static/finmoji/1000px/the_cap.png deleted file mode 100644 index 7f547dc0e..000000000 Binary files a/priv/static/finmoji/1000px/the_cap.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/the_conductor.png b/priv/static/finmoji/1000px/the_conductor.png deleted file mode 100644 index ed5ca7f1f..000000000 Binary files a/priv/static/finmoji/1000px/the_conductor.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/the_king.png b/priv/static/finmoji/1000px/the_king.png deleted file mode 100644 index 8c3a5c66d..000000000 Binary files a/priv/static/finmoji/1000px/the_king.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/the_voice.png b/priv/static/finmoji/1000px/the_voice.png deleted file mode 100644 index 9bfc87b3a..000000000 Binary files a/priv/static/finmoji/1000px/the_voice.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/theoriginalsanta.png b/priv/static/finmoji/1000px/theoriginalsanta.png deleted file mode 100644 index b8dc1ef47..000000000 Binary files a/priv/static/finmoji/1000px/theoriginalsanta.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/tomoffinland.png b/priv/static/finmoji/1000px/tomoffinland.png deleted file mode 100644 index 97da05a64..000000000 Binary files a/priv/static/finmoji/1000px/tomoffinland.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/torillatavataan.png b/priv/static/finmoji/1000px/torillatavataan.png deleted file mode 100644 index ff7a81eda..000000000 Binary files a/priv/static/finmoji/1000px/torillatavataan.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/unbreakable.png b/priv/static/finmoji/1000px/unbreakable.png deleted file mode 100644 index 1778fc115..000000000 Binary files a/priv/static/finmoji/1000px/unbreakable.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/waiting.png b/priv/static/finmoji/1000px/waiting.png deleted file mode 100644 index 2aa9afa70..000000000 Binary files a/priv/static/finmoji/1000px/waiting.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/white_nights.png b/priv/static/finmoji/1000px/white_nights.png deleted file mode 100644 index 8e9cd3fc8..000000000 Binary files a/priv/static/finmoji/1000px/white_nights.png and /dev/null differ diff --git a/priv/static/finmoji/1000px/woollysocks.png b/priv/static/finmoji/1000px/woollysocks.png deleted file mode 100644 index 5ee4e6de1..000000000 Binary files a/priv/static/finmoji/1000px/woollysocks.png and /dev/null differ diff --git a/priv/static/finmoji/128px/a_trusted_friend-128.png b/priv/static/finmoji/128px/a_trusted_friend-128.png deleted file mode 100644 index 16d596bda..000000000 Binary files a/priv/static/finmoji/128px/a_trusted_friend-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/alandislands-128.png b/priv/static/finmoji/128px/alandislands-128.png deleted file mode 100644 index 13cdf6e76..000000000 Binary files a/priv/static/finmoji/128px/alandislands-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/association-128.png b/priv/static/finmoji/128px/association-128.png deleted file mode 100644 index 5b388d781..000000000 Binary files a/priv/static/finmoji/128px/association-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/auroraborealis-128.png b/priv/static/finmoji/128px/auroraborealis-128.png deleted file mode 100644 index 7e2af77b9..000000000 Binary files a/priv/static/finmoji/128px/auroraborealis-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/baby_in_a_box-128.png b/priv/static/finmoji/128px/baby_in_a_box-128.png deleted file mode 100644 index 9c495e24a..000000000 Binary files a/priv/static/finmoji/128px/baby_in_a_box-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/bear-128.png b/priv/static/finmoji/128px/bear-128.png deleted file mode 100644 index 8bb101bf4..000000000 Binary files a/priv/static/finmoji/128px/bear-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/black_gold-128.png b/priv/static/finmoji/128px/black_gold-128.png deleted file mode 100644 index 1833edab4..000000000 Binary files a/priv/static/finmoji/128px/black_gold-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/christmasparty-128.png b/priv/static/finmoji/128px/christmasparty-128.png deleted file mode 100644 index 98216830c..000000000 Binary files a/priv/static/finmoji/128px/christmasparty-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/crosscountryskiing-128.png b/priv/static/finmoji/128px/crosscountryskiing-128.png deleted file mode 100644 index 67553f398..000000000 Binary files a/priv/static/finmoji/128px/crosscountryskiing-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/cupofcoffee-128.png b/priv/static/finmoji/128px/cupofcoffee-128.png deleted file mode 100644 index 20064f218..000000000 Binary files a/priv/static/finmoji/128px/cupofcoffee-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/education-128.png b/priv/static/finmoji/128px/education-128.png deleted file mode 100644 index c98083bdd..000000000 Binary files a/priv/static/finmoji/128px/education-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/fashionista_finns-128.png b/priv/static/finmoji/128px/fashionista_finns-128.png deleted file mode 100644 index 4248825e0..000000000 Binary files a/priv/static/finmoji/128px/fashionista_finns-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/finnishlove-128.png b/priv/static/finmoji/128px/finnishlove-128.png deleted file mode 100644 index 5d4f9476c..000000000 Binary files a/priv/static/finmoji/128px/finnishlove-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/flag-128.png b/priv/static/finmoji/128px/flag-128.png deleted file mode 100644 index 0087cc589..000000000 Binary files a/priv/static/finmoji/128px/flag-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/forest-128.png b/priv/static/finmoji/128px/forest-128.png deleted file mode 100644 index 142e60b94..000000000 Binary files a/priv/static/finmoji/128px/forest-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/four_seasons_of_bbq-128.png b/priv/static/finmoji/128px/four_seasons_of_bbq-128.png deleted file mode 100644 index bb7fe1f51..000000000 Binary files a/priv/static/finmoji/128px/four_seasons_of_bbq-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/girlpower-128.png b/priv/static/finmoji/128px/girlpower-128.png deleted file mode 100644 index bc76a51c5..000000000 Binary files a/priv/static/finmoji/128px/girlpower-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/handshake-128.png b/priv/static/finmoji/128px/handshake-128.png deleted file mode 100644 index 4ebf196ab..000000000 Binary files a/priv/static/finmoji/128px/handshake-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/happiness-128.png b/priv/static/finmoji/128px/happiness-128.png deleted file mode 100644 index e28f99a26..000000000 Binary files a/priv/static/finmoji/128px/happiness-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/headbanger-128.png b/priv/static/finmoji/128px/headbanger-128.png deleted file mode 100644 index 0de620efe..000000000 Binary files a/priv/static/finmoji/128px/headbanger-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/icebreaker-128.png b/priv/static/finmoji/128px/icebreaker-128.png deleted file mode 100644 index 7fb36a4a3..000000000 Binary files a/priv/static/finmoji/128px/icebreaker-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/iceman-128.png b/priv/static/finmoji/128px/iceman-128.png deleted file mode 100644 index eb814e6aa..000000000 Binary files a/priv/static/finmoji/128px/iceman-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/joulutorttu-128.png b/priv/static/finmoji/128px/joulutorttu-128.png deleted file mode 100644 index 50448e333..000000000 Binary files a/priv/static/finmoji/128px/joulutorttu-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/kaamos-128.png b/priv/static/finmoji/128px/kaamos-128.png deleted file mode 100644 index 8b2df03ef..000000000 Binary files a/priv/static/finmoji/128px/kaamos-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/kalsarikannit_f-128.png b/priv/static/finmoji/128px/kalsarikannit_f-128.png deleted file mode 100644 index bcd94141a..000000000 Binary files a/priv/static/finmoji/128px/kalsarikannit_f-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/kalsarikannit_m-128.png b/priv/static/finmoji/128px/kalsarikannit_m-128.png deleted file mode 100644 index c6938e677..000000000 Binary files a/priv/static/finmoji/128px/kalsarikannit_m-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/karjalanpiirakka-128.png b/priv/static/finmoji/128px/karjalanpiirakka-128.png deleted file mode 100644 index a82a902db..000000000 Binary files a/priv/static/finmoji/128px/karjalanpiirakka-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/kicksled-128.png b/priv/static/finmoji/128px/kicksled-128.png deleted file mode 100644 index ff42462db..000000000 Binary files a/priv/static/finmoji/128px/kicksled-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/kokko-128.png b/priv/static/finmoji/128px/kokko-128.png deleted file mode 100644 index e0b6e07fa..000000000 Binary files a/priv/static/finmoji/128px/kokko-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/lavatanssit-128.png b/priv/static/finmoji/128px/lavatanssit-128.png deleted file mode 100644 index f89dc358c..000000000 Binary files a/priv/static/finmoji/128px/lavatanssit-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/losthopes_f-128.png b/priv/static/finmoji/128px/losthopes_f-128.png deleted file mode 100644 index 60f0949c0..000000000 Binary files a/priv/static/finmoji/128px/losthopes_f-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/losthopes_m-128.png b/priv/static/finmoji/128px/losthopes_m-128.png deleted file mode 100644 index 9ae6f9e2f..000000000 Binary files a/priv/static/finmoji/128px/losthopes_m-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/mattinykanen-128.png b/priv/static/finmoji/128px/mattinykanen-128.png deleted file mode 100644 index 0e81271ca..000000000 Binary files a/priv/static/finmoji/128px/mattinykanen-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/meanwhileinfinland-128.png b/priv/static/finmoji/128px/meanwhileinfinland-128.png deleted file mode 100644 index 5a9710a3b..000000000 Binary files a/priv/static/finmoji/128px/meanwhileinfinland-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/moominmamma-128.png b/priv/static/finmoji/128px/moominmamma-128.png deleted file mode 100644 index ae37bb94a..000000000 Binary files a/priv/static/finmoji/128px/moominmamma-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/nordicfamily-128.png b/priv/static/finmoji/128px/nordicfamily-128.png deleted file mode 100644 index cff41b228..000000000 Binary files a/priv/static/finmoji/128px/nordicfamily-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/out_of_office-128.png b/priv/static/finmoji/128px/out_of_office-128.png deleted file mode 100644 index 45cd1c2f5..000000000 Binary files a/priv/static/finmoji/128px/out_of_office-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/peacemaker-128.png b/priv/static/finmoji/128px/peacemaker-128.png deleted file mode 100644 index c4e9bd447..000000000 Binary files a/priv/static/finmoji/128px/peacemaker-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/perkele-128.png b/priv/static/finmoji/128px/perkele-128.png deleted file mode 100644 index e89e5bf32..000000000 Binary files a/priv/static/finmoji/128px/perkele-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/pesapallo-128.png b/priv/static/finmoji/128px/pesapallo-128.png deleted file mode 100644 index 5e06bec50..000000000 Binary files a/priv/static/finmoji/128px/pesapallo-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/polarbear-128.png b/priv/static/finmoji/128px/polarbear-128.png deleted file mode 100644 index fd3c3ec30..000000000 Binary files a/priv/static/finmoji/128px/polarbear-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/pusa_hispida_saimensis-128.png b/priv/static/finmoji/128px/pusa_hispida_saimensis-128.png deleted file mode 100644 index 60620be5d..000000000 Binary files a/priv/static/finmoji/128px/pusa_hispida_saimensis-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/reindeer-128.png b/priv/static/finmoji/128px/reindeer-128.png deleted file mode 100644 index 8cdd05f27..000000000 Binary files a/priv/static/finmoji/128px/reindeer-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/sami-128.png b/priv/static/finmoji/128px/sami-128.png deleted file mode 100644 index e9e9f41a7..000000000 Binary files a/priv/static/finmoji/128px/sami-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/sauna_f-128.png b/priv/static/finmoji/128px/sauna_f-128.png deleted file mode 100644 index 474f126ff..000000000 Binary files a/priv/static/finmoji/128px/sauna_f-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/sauna_m-128.png b/priv/static/finmoji/128px/sauna_m-128.png deleted file mode 100644 index f7f563a9b..000000000 Binary files a/priv/static/finmoji/128px/sauna_m-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/sauna_whisk-128.png b/priv/static/finmoji/128px/sauna_whisk-128.png deleted file mode 100644 index 80ebb55e4..000000000 Binary files a/priv/static/finmoji/128px/sauna_whisk-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/sisu-128.png b/priv/static/finmoji/128px/sisu-128.png deleted file mode 100644 index 7b9330654..000000000 Binary files a/priv/static/finmoji/128px/sisu-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/stuck-128.png b/priv/static/finmoji/128px/stuck-128.png deleted file mode 100644 index c14bc555d..000000000 Binary files a/priv/static/finmoji/128px/stuck-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/suomimainittu-128.png b/priv/static/finmoji/128px/suomimainittu-128.png deleted file mode 100644 index 8d35b9be1..000000000 Binary files a/priv/static/finmoji/128px/suomimainittu-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/superfood-128.png b/priv/static/finmoji/128px/superfood-128.png deleted file mode 100644 index 2e9d924cc..000000000 Binary files a/priv/static/finmoji/128px/superfood-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/swan-128.png b/priv/static/finmoji/128px/swan-128.png deleted file mode 100644 index d1711c70b..000000000 Binary files a/priv/static/finmoji/128px/swan-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/the_cap-128.png b/priv/static/finmoji/128px/the_cap-128.png deleted file mode 100644 index 10d83c22e..000000000 Binary files a/priv/static/finmoji/128px/the_cap-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/the_conductor-128.png b/priv/static/finmoji/128px/the_conductor-128.png deleted file mode 100644 index 0da7c42e8..000000000 Binary files a/priv/static/finmoji/128px/the_conductor-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/the_king-128.png b/priv/static/finmoji/128px/the_king-128.png deleted file mode 100644 index 07dd27ad7..000000000 Binary files a/priv/static/finmoji/128px/the_king-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/the_voice-128.png b/priv/static/finmoji/128px/the_voice-128.png deleted file mode 100644 index bb436f95b..000000000 Binary files a/priv/static/finmoji/128px/the_voice-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/theoriginalsanta-128.png b/priv/static/finmoji/128px/theoriginalsanta-128.png deleted file mode 100644 index 082d58c28..000000000 Binary files a/priv/static/finmoji/128px/theoriginalsanta-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/tomoffinland-128.png b/priv/static/finmoji/128px/tomoffinland-128.png deleted file mode 100644 index 29c68bcba..000000000 Binary files a/priv/static/finmoji/128px/tomoffinland-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/torillatavataan-128.png b/priv/static/finmoji/128px/torillatavataan-128.png deleted file mode 100644 index da7b502b4..000000000 Binary files a/priv/static/finmoji/128px/torillatavataan-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/unbreakable-128.png b/priv/static/finmoji/128px/unbreakable-128.png deleted file mode 100644 index eb825e14f..000000000 Binary files a/priv/static/finmoji/128px/unbreakable-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/waiting-128.png b/priv/static/finmoji/128px/waiting-128.png deleted file mode 100644 index 10b9167f2..000000000 Binary files a/priv/static/finmoji/128px/waiting-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/white_nights-128.png b/priv/static/finmoji/128px/white_nights-128.png deleted file mode 100644 index 8eacd11f0..000000000 Binary files a/priv/static/finmoji/128px/white_nights-128.png and /dev/null differ diff --git a/priv/static/finmoji/128px/woollysocks-128.png b/priv/static/finmoji/128px/woollysocks-128.png deleted file mode 100644 index 856af5b2e..000000000 Binary files a/priv/static/finmoji/128px/woollysocks-128.png and /dev/null differ diff --git a/priv/static/finmoji/LICENSE b/priv/static/finmoji/LICENSE deleted file mode 100644 index e3a607aa3..000000000 --- a/priv/static/finmoji/LICENSE +++ /dev/null @@ -1 +0,0 @@ -these are under CC-BY-ND, see https://finland.fi/emoji/ diff --git a/priv/static/index.html b/priv/static/index.html index 3114acffe..1dcedeec8 100644 --- a/priv/static/index.html +++ b/priv/static/index.html @@ -1 +1 @@ -Pleroma
\ No newline at end of file +Pleroma
\ No newline at end of file diff --git a/priv/static/static/config.json b/priv/static/static/config.json index 533a5b087..04cbb97b5 100644 --- a/priv/static/static/config.json +++ b/priv/static/static/config.json @@ -8,7 +8,6 @@ "redirectRootLogin": "/main/friends", "chatDisabled": false, "showInstanceSpecificPanel": false, - "scopeOptionsEnabled": false, "formattingOptionsEnabled": false, "collapseMessageWithSubject": false, "scopeCopy": true, @@ -21,5 +20,6 @@ "webPushNotifications": false, "noAttachmentLinks": false, "nsfwCensorImage": "", - "showFeaturesPanel": true + "showFeaturesPanel": true, + "minimalScopesMode": false } diff --git a/priv/static/static/css/app.a81578273cb4c57163939ab70c80eb06.css b/priv/static/static/css/app.a81578273cb4c57163939ab70c80eb06.css new file mode 100644 index 000000000..bf3c12d78 Binary files /dev/null and b/priv/static/static/css/app.a81578273cb4c57163939ab70c80eb06.css differ diff --git a/priv/static/static/css/app.a81578273cb4c57163939ab70c80eb06.css.map b/priv/static/static/css/app.a81578273cb4c57163939ab70c80eb06.css.map new file mode 100644 index 000000000..e4bc2dbe1 --- /dev/null +++ b/priv/static/static/css/app.a81578273cb4c57163939ab70c80eb06.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack:///src/components/timeline/timeline.vue","webpack:///webpack:///src/components/status/status.vue","webpack:///webpack:///src/components/attachment/attachment.vue","webpack:///webpack:///src/components/still-image/still-image.vue","webpack:///webpack:///src/components/favorite_button/favorite_button.vue","webpack:///webpack:///src/components/retweet_button/retweet_button.vue","webpack:///webpack:///src/components/delete_button/delete_button.vue","webpack:///webpack:///src/components/post_status_form/post_status_form.vue","webpack:///webpack:///src/components/media_upload/media_upload.vue","webpack:///webpack:///src/components/emoji-input/emoji-input.vue","webpack:///webpack:///src/components/user_card/user_card.vue","webpack:///webpack:///src/components/user_avatar/user_avatar.vue","webpack:///webpack:///src/components/remote_follow/remote_follow.vue","webpack:///webpack:///src/components/moderation_tools/moderation_tools.vue","webpack:///webpack:///src/components/dialog_modal/dialog_modal.vue","webpack:///webpack:///~/vue-popperjs/src/component/popper.js.vue","webpack:///webpack:///src/components/gallery/gallery.vue","webpack:///webpack:///src/components/link-preview/link-preview.vue","webpack:///webpack:///src/components/conversation/conversation.vue","webpack:///webpack:///src/components/user_profile/user_profile.vue","webpack:///webpack:///src/components/follow_card/follow_card.vue","webpack:///webpack:///src/components/basic_user_card/basic_user_card.vue","webpack:///webpack:///src/components/list/list.vue","webpack:///webpack:///src/hocs/with_load_more/src/hocs/with_load_more/with_load_more.scss","webpack:///webpack:///src/components/settings/settings.vue","webpack:///webpack:///src/components/tab_switcher/src/components/tab_switcher/tab_switcher.scss","webpack:///webpack:///src/components/style_switcher/style_switcher.scss","webpack:///webpack:///src/components/color_input/color_input.vue","webpack:///webpack:///src/components/shadow_control/shadow_control.vue","webpack:///webpack:///src/components/font_control/font_control.vue","webpack:///webpack:///src/components/contrast_ratio/contrast_ratio.vue","webpack:///webpack:///src/components/export_import/export_import.vue","webpack:///webpack:///src/components/registration/registration.vue","webpack:///webpack:///src/components/user_settings/user_settings.vue","webpack:///webpack:///src/components/image_cropper/image_cropper.vue","webpack:///webpack:///~/cropperjs/dist/cropper.css","webpack:///webpack:///src/components/block_card/block_card.vue","webpack:///webpack:///src/components/mute_card/mute_card.vue","webpack:///webpack:///src/components/selectable_list/selectable_list.vue","webpack:///webpack:///src/components/checkbox/checkbox.vue","webpack:///webpack:///src/components/autosuggest/autosuggest.vue","webpack:///webpack:///src/hocs/with_subscription/src/hocs/with_subscription/with_subscription.scss","webpack:///webpack:///src/components/follow_request_card/follow_request_card.vue","webpack:///webpack:///src/components/user_search/user_search.vue","webpack:///webpack:///src/components/notifications/notifications.scss","webpack:///webpack:///src/components/login_form/login_form.vue","webpack:///webpack:///src/components/chat_panel/chat_panel.vue","webpack:///webpack:///src/components/features_panel/features_panel.vue","webpack:///webpack:///src/components/terms_of_service_panel/terms_of_service_panel.vue","webpack:///webpack:///src/App.scss","webpack:///webpack:///src/components/nav_panel/nav_panel.vue","webpack:///webpack:///src/components/user_finder/user_finder.vue","webpack:///webpack:///src/components/who_to_follow_panel/who_to_follow_panel.vue","webpack:///webpack:///src/components/media_modal/media_modal.vue","webpack:///webpack:///src/components/side_drawer/side_drawer.vue","webpack:///webpack:///src/components/mobile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AAU,WAAW,mBAAmB,eAAe,aAAa,YAAY,yBAAyB,oCAAqC,oBAAoB,aAAa,qBAAqB,uBAAuB,sBAAsB,mBAAmB,6DAAmE,WAAW,0BAA2B,iDAAqD,CAErb,0BAA0B,0BAA0B,CAEpD,qBAAqB,gBAAgB,cAAc,yBAA0B,CAE7E,yBACA,mBAAmB,YAAY,CAC9B,CCZD,kBAAkB,WAAW,oBAAoB,aAAa,sBAAsB,kBAAkB,CAEtG,mBAAmB,oBAAoB,aAAa,qBAAqB,uBAAuB,WAAW,kBAAkB,cAAc,CAE3I,WAAW,mBAAmB,WAAW,UAAU,kBAAkB,qBAAqB,oBAAoB,gBAAgB,gBAAgB,qBAAqB,6CAA8C,CAEjN,6BAA6B,WAAW,aAAa,kBAAkB,eAAe,MAAM,OAAO,sCAAuC,8BAA8B,8BAA8B,yBAA0B,uBAAuB,CAEvP,oCAAoC,0BAA0B,CAE9D,6BAA6B,oBAAoB,aAAa,sBAAsB,mBAAmB,sBAAsB,8BAA8B,UAAU,WAAW,YAAY,iBAAiB,kBAAkB,wBAAwB,yBAAyB,uCAAwC,kCAAuC,8BAA8B,CAE7X,oCAAoC,gBAAgB,gBAAiB,CAErE,sBAAsB,gBAAgB,YAAY,0BAA0B,kBAAkB,kBAAkB,cAAc,0BAA2B,yBAAyB,kCAAmC,CAErN,qCAAqC,UAAU,gBAAgB,eAAe,CAE9E,4CAA4C,gBAAgB,SAAS,eAAe,CAEpF,kDAAkD,eAAe,CAEjE,2DAA2D,gBAAgB,eAAe","file":"static/css/app.a81578273cb4c57163939ab70c80eb06.css","sourcesContent":["\n.timeline .loadmore-text{opacity:1\n}\n.new-status-notification{position:relative;margin-top:-1px;font-size:1.1em;border-width:1px 0 0 0;border-style:solid;border-color:var(--border, #222);padding:10px;z-index:1;background-color:#182230;background-color:var(--panel, #182230)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/timeline/timeline.vue","\n.status-body{-ms-flex:1;flex:1;min-width:0\n}\n.status-preview.status-el{border-style:solid;border-width:1px;border-color:#222;border-color:var(--border, #222)\n}\n.status-preview-container{position:relative;max-width:100%\n}\n.status-preview{position:absolute;max-width:95%;display:-ms-flexbox;display:flex;background-color:#121a24;background-color:var(--bg, #121a24);border-color:#222;border-color:var(--border, #222);border-style:solid;border-width:1px;border-radius:5px;border-radius:var(--tooltipRadius, 5px);box-shadow:2px 2px 3px rgba(0,0,0,0.5);box-shadow:var(--popupShadow);margin-top:0.25em;margin-left:0.5em;z-index:50\n}\n.status-preview .status{-ms-flex:1;flex:1;border:0;min-width:15em\n}\n.status-preview-loading{display:block;min-width:15em;padding:1em;text-align:center;border-width:1px;border-style:solid\n}\n.status-preview-loading i{font-size:2em\n}\n.media-left{margin-right:.75em\n}\n.status-el{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;border-left-width:0px;min-width:0;border-color:#222;border-color:var(--border, #222);border-left:4px red;border-left:4px var(--cRed, red)\n}\n.status-el_focused{background-color:#151e2a;background-color:var(--lightBg, #151e2a)\n}\n.timeline .status-el{border-bottom-width:1px;border-bottom-style:solid\n}\n.status-el .media-body{-ms-flex:1;flex:1;padding:0\n}\n.status-el .status-usercard{margin-bottom:.75em\n}\n.status-el .user-name{white-space:nowrap;font-size:14px;overflow:hidden;-ms-flex-negative:0;flex-shrink:0;max-width:85%;font-weight:bold\n}\n.status-el .user-name img{width:14px;height:14px;vertical-align:middle;object-fit:contain\n}\n.status-el .media-heading{padding:0;vertical-align:bottom;-ms-flex-preferred-size:100%;flex-basis:100%;margin-bottom:0.5em\n}\n.status-el .media-heading a{display:inline-block;word-break:break-all\n}\n.status-el .media-heading small{font-weight:lighter\n}\n.status-el .media-heading .heading-name-row{padding:0;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;line-height:18px\n}\n.status-el .media-heading .heading-name-row .name-and-account-name{display:-ms-flexbox;display:flex;min-width:0\n}\n.status-el .media-heading .heading-name-row .user-name{-ms-flex-negative:1;flex-shrink:1;margin-right:0.4em;overflow:hidden;text-overflow:ellipsis\n}\n.status-el .media-heading .heading-name-row .account-name{min-width:1.6em;margin-right:0.4em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-ms-flex:1 1 0px;flex:1 1 0\n}\n.status-el .media-heading .heading-right{display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0\n}\n.status-el .media-heading .timeago{margin-right:0.2em\n}\n.status-el .media-heading .heading-reply-row{-ms-flex-line-pack:baseline;align-content:baseline;font-size:12px;line-height:18px;max-width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:stretch;align-items:stretch\n}\n.status-el .media-heading .heading-reply-row a{max-width:100%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap\n}\n.status-el .media-heading .reply-to-and-accountname{display:-ms-flexbox;display:flex;height:18px;margin-right:0.5em;overflow:hidden;max-width:100%\n}\n.status-el .media-heading .reply-to-and-accountname .icon-reply{transform:scaleX(-1)\n}\n.status-el .media-heading .reply-info{display:-ms-flexbox;display:flex\n}\n.status-el .media-heading .reply-to{display:-ms-flexbox;display:flex\n}\n.status-el .media-heading .reply-to-text{overflow:hidden;text-overflow:ellipsis;margin:0 0.4em 0 0.2em\n}\n.status-el .media-heading .replies-separator{margin-left:0.4em\n}\n.status-el .media-heading .replies{line-height:18px;font-size:12px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.status-el .media-heading .replies>*{margin-right:0.4em\n}\n.status-el .media-heading .reply-link{height:17px\n}\n.status-el .tall-status{position:relative;height:220px;overflow-x:hidden;overflow-y:hidden\n}\n.status-el .tall-status-hider{display:inline-block;word-break:break-all;position:absolute;height:70px;margin-top:150px;width:100%;text-align:center;line-height:110px;background:linear-gradient(to bottom, transparent, #121a24 80%);background:linear-gradient(to bottom, transparent, var(--bg, #121a24) 80%)\n}\n.status-el .tall-status-hider_focused{background:linear-gradient(to bottom, transparent, #151e2a 80%);background:linear-gradient(to bottom, transparent, var(--lightBg, #151e2a) 80%)\n}\n.status-el .status-unhider,.status-el .cw-status-hider{width:100%;text-align:center;display:inline-block;word-break:break-all\n}\n.status-el .status-content{font-family:var(--postFont, sans-serif);line-height:1.4em\n}\n.status-el .status-content img,.status-el .status-content video{max-width:100%;max-height:400px;vertical-align:middle;object-fit:contain\n}\n.status-el .status-content img.emoji,.status-el .status-content video.emoji{width:32px;height:32px\n}\n.status-el .status-content blockquote{margin:0.2em 0 0.2em 2em;font-style:italic\n}\n.status-el .status-content pre{overflow:auto\n}\n.status-el .status-content code,.status-el .status-content samp,.status-el .status-content kbd,.status-el .status-content var,.status-el .status-content pre{font-family:var(--postCodeFont, monospace)\n}\n.status-el .status-content p{margin:0 0 1em 0\n}\n.status-el .status-content p:last-child{margin:0 0 0 0\n}\n.status-el .status-content h1{font-size:1.1em;line-height:1.2em;margin:1.4em 0\n}\n.status-el .status-content h2{font-size:1.1em;margin:1.0em 0\n}\n.status-el .status-content h3{font-size:1em;margin:1.2em 0\n}\n.status-el .status-content h4{margin:1.1em 0\n}\n.status-el .retweet-info{padding:0.4em .75em;margin:0\n}\n.status-el .retweet-info .avatar.still-image{border-radius:10px;border-radius:var(--avatarAltRadius, 10px);margin-left:28px;width:20px;height:20px\n}\n.status-el .retweet-info .media-body{font-size:1em;line-height:22px;display:-ms-flexbox;display:flex;-ms-flex-line-pack:center;align-content:center;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.status-el .retweet-info .media-body .user-name{font-weight:bold;overflow:hidden;text-overflow:ellipsis\n}\n.status-el .retweet-info .media-body .user-name img{width:14px;height:14px;vertical-align:middle;object-fit:contain\n}\n.status-el .retweet-info .media-body i{padding:0 0.2em\n}\n.status-el .retweet-info .media-body a{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap\n}\n.status-fadein{animation-duration:0.4s;animation-name:fadein\n}\n@keyframes fadein{\nfrom{opacity:0\n}\nto{opacity:1\n}\n}\n.greentext{color:green\n}\n.status-conversation{border-left-style:solid\n}\n.status-actions{width:100%;display:-ms-flexbox;display:flex;margin-top:.75em\n}\n.status-actions div,.status-actions favorite-button{max-width:4em;-ms-flex:1;flex:1\n}\n.icon-reply:hover{color:#0095ff;color:var(--cBlue, #0095ff);cursor:pointer\n}\n.icon-reply.icon-reply-active{color:#0095ff;color:var(--cBlue, #0095ff)\n}\n.status:hover .animated.avatar canvas{display:none\n}\n.status:hover .animated.avatar img{visibility:visible\n}\n.status{display:-ms-flexbox;display:flex;padding:.75em\n}\n.status.is-retweet{padding-top:0\n}\n.status-conversation:last-child{border-bottom:none\n}\n.muted{padding:0.25em 0.5em\n}\n.muted button{margin-left:auto\n}\n.muted .muteWords{margin-left:10px\n}\na.unmute{display:block;margin-left:auto\n}\n.reply-left{-ms-flex:0;flex:0;min-width:48px\n}\n.reply-body{-ms-flex:1;flex:1\n}\n.timeline>.status-el:last-child{border-radius:0 0 10px 10px;border-radius:0 0 var(--panelRadius, 10px) var(--panelRadius, 10px);border-bottom:none\n}\n@media all and (max-width: 800px){\n.status-el .retweet-info .avatar.still-image{margin-left:20px\n}\n.status{max-width:100%\n}\n.status .avatar.still-image{width:40px;height:40px\n}\n.status .avatar.still-image.avatar-compact{width:32px;height:32px\n}\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/status/status.vue","\n.attachments{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.attachments .attachment.media-upload-container{-ms-flex:0 0 auto;flex:0 0 auto;max-height:200px;max-width:100%;display:-ms-flexbox;display:flex\n}\n.attachments .attachment.media-upload-container video{max-width:100%\n}\n.attachments .placeholder{margin-right:8px;margin-bottom:4px\n}\n.attachments .nsfw-placeholder{cursor:pointer\n}\n.attachments .nsfw-placeholder.loading{cursor:progress\n}\n.attachments .attachment{position:relative;margin-top:0.5em;-ms-flex-item-align:start;align-self:flex-start;line-height:0;border-style:solid;border-width:1px;border-radius:10px;border-radius:var(--attachmentRadius, 10px);border-color:#222;border-color:var(--border, #222);overflow:hidden\n}\n.attachments .non-gallery.attachment.video{-ms-flex:1 0 40%;flex:1 0 40%\n}\n.attachments .non-gallery.attachment .nsfw{height:260px\n}\n.attachments .non-gallery.attachment .small{height:120px;-ms-flex-positive:0;flex-grow:0\n}\n.attachments .non-gallery.attachment .video{height:260px;display:-ms-flexbox;display:flex\n}\n.attachments .non-gallery.attachment video{max-height:100%;object-fit:contain\n}\n.attachments .fullwidth{-ms-flex-preferred-size:100%;flex-basis:100%\n}\n.attachments.video{line-height:0\n}\n.attachments .video-container{display:-ms-flexbox;display:flex;max-height:100%\n}\n.attachments .video{width:100%\n}\n.attachments .play-icon{position:absolute;font-size:64px;top:calc(50% - 32px);left:calc(50% - 32px);color:rgba(255,255,255,0.75);text-shadow:0 0 2px rgba(0,0,0,0.4)\n}\n.attachments .play-icon::before{margin:0\n}\n.attachments.html{-ms-flex-preferred-size:90%;flex-basis:90%;width:100%;display:-ms-flexbox;display:flex\n}\n.attachments .hider{position:absolute;right:0;white-space:nowrap;margin:10px;padding:5px;background:rgba(230,230,230,0.6);font-weight:bold;z-index:4;line-height:1;border-radius:5px;border-radius:var(--tooltipRadius, 5px)\n}\n.attachments video{z-index:0\n}\n.attachments audio{width:100%\n}\n.attachments img.media-upload{line-height:0;max-height:200px;max-width:100%\n}\n.attachments .oembed{line-height:1.2em;-ms-flex:1 0 100%;flex:1 0 100%;width:100%;margin-right:15px;display:-ms-flexbox;display:flex\n}\n.attachments .oembed img{width:100%\n}\n.attachments .oembed .image{-ms-flex:1;flex:1\n}\n.attachments .oembed .image img{border:0px;border-radius:5px;height:100%;object-fit:cover\n}\n.attachments .oembed .text{-ms-flex:2;flex:2;margin:8px;word-break:break-all\n}\n.attachments .oembed .text h1{font-size:14px;margin:0px\n}\n.attachments .image-attachment{width:100%;height:100%\n}\n.attachments .image-attachment.hidden{display:none\n}\n.attachments .image-attachment .nsfw{object-fit:cover;width:100%;height:100%\n}\n.attachments .image-attachment img{image-orientation:from-image\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/attachment/attachment.vue","\n.still-image{position:relative;line-height:0;overflow:hidden;width:100%;height:100%\n}\n.still-image:hover canvas{display:none\n}\n.still-image img{width:100%;height:100%;object-fit:contain\n}\n.still-image.animated:hover::before,.still-image.animated img{visibility:hidden\n}\n.still-image.animated:hover img{visibility:visible\n}\n.still-image.animated::before{content:'gif';position:absolute;line-height:10px;font-size:10px;top:5px;left:5px;background:rgba(127,127,127,0.5);color:#FFF;display:block;padding:2px 4px;border-radius:5px;border-radius:var(--tooltipRadius, 5px);z-index:2\n}\n.still-image canvas{position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:100%;object-fit:contain\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/still-image/still-image.vue","\n.fav-active{cursor:pointer;animation-duration:0.6s\n}\n.fav-active:hover{color:orange;color:var(--cOrange, orange)\n}\n.favorite-button.icon-star{color:orange;color:var(--cOrange, orange)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/favorite_button/favorite_button.vue","\n.rt-active{cursor:pointer;animation-duration:0.6s\n}\n.rt-active:hover{color:#0fa00f;color:var(--cGreen, #0fa00f)\n}\n.icon-retweet.retweeted{color:#0fa00f;color:var(--cGreen, #0fa00f)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/retweet_button/retweet_button.vue","\n.icon-cancel,.delete-status{cursor:pointer\n}\n.icon-cancel:hover,.delete-status:hover{color:red;color:var(--cRed, red)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/delete_button/delete_button.vue","\n.tribute-container ul{padding:0px\n}\n.tribute-container ul li{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center\n}\n.tribute-container img{padding:3px;width:16px;height:16px;border-radius:10px;border-radius:var(--avatarAltRadius, 10px)\n}\n.post-status-form .visibility-tray{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:row-reverse;flex-direction:row-reverse\n}\n.post-status-form .form-bottom,.login .form-bottom{display:-ms-flexbox;display:flex;padding:0.5em;height:32px\n}\n.post-status-form .form-bottom button,.login .form-bottom button{width:10em\n}\n.post-status-form .form-bottom p,.login .form-bottom p{margin:0.35em;padding:0.35em;display:-ms-flexbox;display:flex\n}\n.post-status-form .error,.login .error{text-align:center\n}\n.post-status-form .media-upload-wrapper,.login .media-upload-wrapper{-ms-flex:0 0 auto;flex:0 0 auto;max-width:100%;min-width:50px;margin-right:.2em;margin-bottom:.5em\n}\n.post-status-form .media-upload-wrapper .icon-cancel,.login .media-upload-wrapper .icon-cancel{display:inline-block;position:static;margin:0;padding-bottom:0;margin-left:10px;margin-left:var(--attachmentRadius, 10px);background-color:#182230;background-color:var(--btn, #182230);border-bottom-left-radius:0;border-bottom-right-radius:0\n}\n.post-status-form .attachments,.login .attachments{padding:0 0.5em\n}\n.post-status-form .attachments .attachment,.login .attachments .attachment{margin:0;position:relative;-ms-flex:0 0 auto;flex:0 0 auto;border:1px solid #222;border:1px solid var(--border, #222);text-align:center\n}\n.post-status-form .attachments .attachment audio,.login .attachments .attachment audio{min-width:300px;-ms-flex:1 0 auto;flex:1 0 auto\n}\n.post-status-form .attachments .attachment a,.login .attachments .attachment a{display:block;text-align:left;line-height:1.2;padding:.5em\n}\n.post-status-form .attachments i,.login .attachments i{position:absolute;margin:10px;padding:5px;background:rgba(230,230,230,0.6);border-radius:10px;border-radius:var(--attachmentRadius, 10px);font-weight:bold\n}\n.post-status-form .btn,.login .btn{cursor:pointer\n}\n.post-status-form .btn[disabled],.login .btn[disabled]{cursor:not-allowed\n}\n.post-status-form form,.login form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:0.6em\n}\n.post-status-form .form-group,.login .form-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:0.3em 0.5em 0.6em;line-height:24px\n}\n.post-status-form form textarea.form-cw,.login form textarea.form-cw{line-height:16px;resize:none;overflow:hidden;transition:min-height 200ms 100ms;min-height:1px\n}\n.post-status-form form textarea.form-control,.login form textarea.form-control{line-height:16px;resize:none;overflow:hidden;transition:min-height 200ms 100ms;min-height:1px;box-sizing:content-box\n}\n.post-status-form form textarea.form-control:focus,.login form textarea.form-control:focus{min-height:48px\n}\n.post-status-form .btn,.login .btn{cursor:pointer\n}\n.post-status-form .btn[disabled],.login .btn[disabled]{cursor:not-allowed\n}\n.post-status-form .icon-cancel,.login .icon-cancel{cursor:pointer;z-index:4\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/post_status_form/post_status_form.vue","\n.media-upload {\n font-size: 26px;\n -ms-flex: 1;\n flex: 1;\n}\n.icon-upload {\n cursor: pointer;\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/media_upload/media_upload.vue","\n.emoji-input .form-control{width:100%\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/emoji-input/emoji-input.vue","\n.user-card{background-size:cover;overflow:hidden\n}\n.user-card .panel-heading{padding:.5em 0;text-align:center;box-shadow:none;background:transparent;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch\n}\n.user-card .panel-body{word-wrap:break-word;background:linear-gradient(to bottom, transparent, #121a24 80%);background:linear-gradient(to bottom, transparent, var(--bg, #121a24) 80%)\n}\n.user-card p{margin-bottom:0\n}\n.user-card-bio{text-align:center\n}\n.user-card-bio img{object-fit:contain;vertical-align:middle;max-width:100%;max-height:400px\n}\n.user-card-bio img.emoji{width:32px;height:32px\n}\n.user-card-rounded-t{border-top-left-radius:10px;border-top-left-radius:var(--panelRadius, 10px);border-top-right-radius:10px;border-top-right-radius:var(--panelRadius, 10px)\n}\n.user-card-rounded{border-radius:10px;border-radius:var(--panelRadius, 10px)\n}\n.user-card-bordered{border-width:1px;border-style:solid;border-color:#222;border-color:var(--border, #222)\n}\n.user-info{color:#b9b9ba;color:var(--lightText, #b9b9ba);padding:0 26px\n}\n.user-info .container{padding:16px 0 6px;display:-ms-flexbox;display:flex;max-height:56px\n}\n.user-info .container .avatar{-ms-flex:1 0 100%;flex:1 0 100%;width:56px;height:56px;box-shadow:0px 1px 8px rgba(0,0,0,0.75);box-shadow:var(--avatarShadow);object-fit:cover\n}\n.user-info:hover .animated.avatar canvas{display:none\n}\n.user-info:hover .animated.avatar img{visibility:visible\n}\n.user-info .usersettings{color:#b9b9ba;color:var(--lightText, #b9b9ba);opacity:.8\n}\n.user-info .name-and-screen-name{display:block;margin-left:0.6em;text-align:left;text-overflow:ellipsis;white-space:nowrap;-ms-flex:1 1 0px;flex:1 1 0;z-index:1\n}\n.user-info .name-and-screen-name img{width:26px;height:26px;vertical-align:middle;object-fit:contain\n}\n.user-info .name-and-screen-name .top-line{display:-ms-flexbox;display:flex\n}\n.user-info .user-name{text-overflow:ellipsis;overflow:hidden;-ms-flex:1 1 auto;flex:1 1 auto;margin-right:1em;font-size:15px\n}\n.user-info .user-name img{object-fit:contain;height:16px;width:16px;vertical-align:middle\n}\n.user-info .user-screen-name{color:#b9b9ba;color:var(--lightText, #b9b9ba);display:inline-block;font-weight:light;font-size:15px;padding-right:0.1em;width:100%;display:-ms-flexbox;display:flex\n}\n.user-info .user-screen-name .dailyAvg{min-width:1px;-ms-flex:0 0 auto;flex:0 0 auto;margin-left:1em;font-size:0.7em;color:#b9b9ba;color:var(--text, #b9b9ba)\n}\n.user-info .user-screen-name .handle{min-width:1px;-ms-flex:0 1 auto;flex:0 1 auto;text-overflow:ellipsis;overflow:hidden\n}\n.user-info .user-screen-name .staff{text-transform:capitalize;color:#b9b9ba;color:var(--btnText, #b9b9ba);background-color:#182230;background-color:var(--btn, #182230)\n}\n.user-info .user-meta{margin-bottom:.15em;display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;font-size:14px;line-height:22px;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.user-info .user-meta .following{-ms-flex:1 0 auto;flex:1 0 auto;margin:0;margin-bottom:.25em;text-align:left\n}\n.user-info .user-meta .highlighter{-ms-flex:0 1 auto;flex:0 1 auto;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5em;-ms-flex-item-align:start;align-self:start\n}\n.user-info .user-meta .highlighter .userHighlightCl{padding:2px 10px;-ms-flex:1 0 auto;flex:1 0 auto\n}\n.user-info .user-meta .highlighter .userHighlightSel,.user-info .user-meta .highlighter .userHighlightSel.select{padding-top:0;padding-bottom:0;-ms-flex:1 0 auto;flex:1 0 auto\n}\n.user-info .user-meta .highlighter .userHighlightSel.select i{line-height:22px\n}\n.user-info .user-meta .highlighter .userHighlightText{width:70px;-ms-flex:1 0 auto;flex:1 0 auto\n}\n.user-info .user-meta .highlighter .userHighlightCl,.user-info .user-meta .highlighter .userHighlightText,.user-info .user-meta .highlighter .userHighlightSel,.user-info .user-meta .highlighter .userHighlightSel.select{height:22px;vertical-align:top;margin-right:.5em;margin-bottom:.25em\n}\n.user-info .user-interactions{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-pack:justify;justify-content:space-between;margin-right:-.75em\n}\n.user-info .user-interactions div{-ms-flex:1 0 0px;flex:1 0 0;margin-right:.75em;margin-bottom:.6em;white-space:nowrap\n}\n.user-info .user-interactions .mute{max-width:220px;min-height:28px\n}\n.user-info .user-interactions .follow{max-width:220px;min-height:28px\n}\n.user-info .user-interactions button{width:100%;height:100%;margin:0\n}\n.user-info .user-interactions .remote-button{height:28px !important;width:92%\n}\n.user-info .user-interactions .pressed{border-bottom-color:rgba(255,255,255,0.2);border-top-color:rgba(0,0,0,0.2)\n}\n.user-counts{display:-ms-flexbox;display:flex;line-height:16px;padding:.5em 1.5em 0em 1.5em;text-align:center;-ms-flex-pack:justify;justify-content:space-between;color:#b9b9ba;color:var(--lightText, #b9b9ba);-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.user-count{-ms-flex:1 0 auto;flex:1 0 auto;padding:.5em 0 .5em 0;margin:0 .5em\n}\n.user-count h5{font-size:1em;font-weight:bolder;margin:0 0 0.25em\n}\n.user-count a{text-decoration:none\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/user_card/user_card.vue","\n.avatar.still-image{width:48px;height:48px;box-shadow:var(--avatarStatusShadow);border-radius:4px;border-radius:var(--avatarRadius, 4px)\n}\n.avatar.still-image img{width:100%;height:100%\n}\n.avatar.still-image.better-shadow{box-shadow:var(--avatarStatusShadowInset);filter:var(--avatarStatusShadowFilter)\n}\n.avatar.still-image.animated::before{display:none\n}\n.avatar.still-image.avatar-compact{width:32px;height:32px;border-radius:10px;border-radius:var(--avatarAltRadius, 10px)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/user_avatar/user_avatar.vue","\n.remote-follow{max-width:220px\n}\n.remote-follow .remote-button{width:100%;min-height:28px\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/remote_follow/remote_follow.vue","\n.popper-wrapper{z-index:8\n}\n.popper-wrapper .popper__arrow{width:0;height:0;border-style:solid;position:absolute;margin:5px\n}\n.popper-wrapper[x-placement^=\"top\"]{margin-bottom:5px\n}\n.popper-wrapper[x-placement^=\"top\"] .popper__arrow{border-width:5px 5px 0 5px;border-color:#121a24 transparent transparent transparent;border-color:var(--bg, #121a24) transparent transparent transparent;bottom:-5px;left:calc(50% - 5px);margin-top:0;margin-bottom:0\n}\n.popper-wrapper[x-placement^=\"bottom\"]{margin-top:5px\n}\n.popper-wrapper[x-placement^=\"bottom\"] .popper__arrow{border-width:0 5px 5px 5px;border-color:transparent transparent #121a24 transparent;border-color:transparent transparent var(--bg, #121a24) transparent;top:-5px;left:calc(50% - 5px);margin-top:0;margin-bottom:0\n}\n.popper-wrapper[x-placement^=\"right\"]{margin-left:5px\n}\n.popper-wrapper[x-placement^=\"right\"] .popper__arrow{border-width:5px 5px 5px 0;border-color:transparent #121a24 transparent transparent;border-color:transparent var(--bg, #121a24) transparent transparent;left:-5px;top:calc(50% - 5px);margin-left:0;margin-right:0\n}\n.popper-wrapper[x-placement^=\"left\"]{margin-right:5px\n}\n.popper-wrapper[x-placement^=\"left\"] .popper__arrow{border-width:5px 0 5px 5px;border-color:transparent transparent transparent #121a24;border-color:transparent transparent transparent var(--bg, #121a24);right:-5px;top:calc(50% - 5px);margin-left:0;margin-right:0\n}\n.dropdown-menu{display:block;padding:.5rem 0;font-size:1rem;text-align:left;list-style:none;max-width:100vw;z-index:10;box-shadow:1px 1px 4px rgba(0,0,0,0.6);box-shadow:var(--panelShadow);border:none;border-radius:4px;border-radius:var(--btnRadius, 4px);background-color:#121a24;background-color:var(--bg, #121a24)\n}\n.dropdown-menu .dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #222;border-top:1px solid var(--border, #222)\n}\n.dropdown-menu .dropdown-item{line-height:21px;margin-right:5px;overflow:auto;display:block;padding:.25rem 1.0rem .25rem 1.5rem;clear:both;font-weight:400;text-align:inherit;white-space:normal;border:none;border-radius:0px;background-color:transparent;box-shadow:none;width:100%;height:100%\n}\n.dropdown-menu .dropdown-item:hover{background-color:#182230;background-color:var(--btn, #182230);box-shadow:none\n}\n.menu-checkbox{float:right;min-width:22px;max-width:22px;min-height:22px;max-height:22px;line-height:22px;text-align:center;border-radius:0px;background-color:#182230;background-color:var(--input, #182230);box-shadow:0px 0px 2px black inset;box-shadow:var(--inputShadow)\n}\n.menu-checkbox.menu-checkbox-checked::after{content:'✔'\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/moderation_tools/moderation_tools.vue","\n.dark-overlay::before{bottom:0;content:\" \";display:block;cursor:default;left:0;position:fixed;right:0;top:0;background:rgba(27,31,35,0.5);z-index:99\n}\n.dialog-modal.panel{top:0;left:50%;max-height:80vh;max-width:90vw;margin:15vh auto;position:fixed;transform:translateX(-50%);z-index:999;cursor:default;display:block;background-color:#121a24;background-color:var(--bg, #121a24)\n}\n.dialog-modal.panel .dialog-modal-heading{padding:.5em .5em;margin-right:auto;margin-bottom:0;white-space:nowrap;color:var(--panelText);background-color:#182230;background-color:var(--panel, #182230)\n}\n.dialog-modal.panel .dialog-modal-heading .title{margin-bottom:0\n}\n.dialog-modal.panel .dialog-modal-content{margin:0;padding:1rem 1rem;background-color:#151e2a;background-color:var(--lightBg, #151e2a);white-space:normal\n}\n.dialog-modal.panel .dialog-modal-footer{margin:0;padding:.5em .5em;background-color:#151e2a;background-color:var(--lightBg, #151e2a);border-top:1px solid #121a24;border-top:1px solid var(--bg, #121a24);-ms-flex-pack:end;justify-content:flex-end\n}\n.dialog-modal.panel .dialog-modal-footer button{width:auto;margin-left:.5rem\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/dialog_modal/dialog_modal.vue","\n.popper {\n width: auto;\n background-color: #fafafa;\n color: #212121;\n text-align: center;\n padding: 2px;\n display: inline-block;\n border-radius: 3px;\n position: absolute;\n font-size: 14px;\n font-weight: normal;\n border: 1px #ebebeb solid;\n z-index: 200000;\n box-shadow: rgb(58, 58, 58) 0 0 6px 0;\n}\n.popper .popper__arrow {\n width: 0;\n height: 0;\n border-style: solid;\n position: absolute;\n margin: 5px;\n}\n.popper[x-placement^=\"top\"] {\n margin-bottom: 5px;\n}\n.popper[x-placement^=\"top\"] .popper__arrow {\n border-width: 5px 5px 0 5px;\n border-color: #fafafa transparent transparent transparent;\n bottom: -5px;\n left: calc(50% - 5px);\n margin-top: 0;\n margin-bottom: 0;\n}\n.popper[x-placement^=\"bottom\"] {\n margin-top: 5px;\n}\n.popper[x-placement^=\"bottom\"] .popper__arrow {\n border-width: 0 5px 5px 5px;\n border-color: transparent transparent #fafafa transparent;\n top: -5px;\n left: calc(50% - 5px);\n margin-top: 0;\n margin-bottom: 0;\n}\n.popper[x-placement^=\"right\"] {\n margin-left: 5px;\n}\n.popper[x-placement^=\"right\"] .popper__arrow {\n border-width: 5px 5px 5px 0;\n border-color: transparent #fafafa transparent transparent;\n left: -5px;\n top: calc(50% - 5px);\n margin-left: 0;\n margin-right: 0;\n}\n.popper[x-placement^=\"left\"] {\n margin-right: 5px;\n}\n.popper[x-placement^=\"left\"] .popper__arrow {\n border-width: 5px 0 5px 5px;\n border-color: transparent transparent transparent #fafafa;\n right: -5px;\n top: calc(50% - 5px);\n margin-left: 0;\n margin-right: 0;\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///~/vue-popperjs/src/component/popper.js.vue","\n.gallery-row{height:200px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-line-pack:stretch;align-content:stretch;-ms-flex-positive:1;flex-grow:1;margin-top:0.5em\n}\n.gallery-row .attachments,.gallery-row .attachment{margin:0 0.5em 0 0;-ms-flex-positive:1;flex-grow:1;height:100%;box-sizing:border-box;min-width:2em\n}\n.gallery-row .attachments:last-child,.gallery-row .attachment:last-child{margin:0\n}\n.gallery-row .image-attachment{width:100%;height:100%\n}\n.gallery-row .video-container{height:100%\n}\n.gallery-row.contain-fit img,.gallery-row.contain-fit video{object-fit:contain\n}\n.gallery-row.cover-fit img,.gallery-row.cover-fit video{object-fit:cover\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/gallery/gallery.vue","\n.link-preview-card{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;cursor:pointer;overflow:hidden;margin-top:0.5em;color:#b9b9ba;color:var(--text, #b9b9ba);border-style:solid;border-width:1px;border-radius:10px;border-radius:var(--attachmentRadius, 10px);border-color:#222;border-color:var(--border, #222)\n}\n.link-preview-card .card-image{-ms-flex-negative:0;flex-shrink:0;width:120px;max-width:25%\n}\n.link-preview-card .card-image img{width:100%;height:100%;object-fit:cover;border-radius:10px;border-radius:var(--attachmentRadius, 10px)\n}\n.link-preview-card .small-image{width:80px\n}\n.link-preview-card .card-content{max-height:100%;margin:0.5em;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column\n}\n.link-preview-card .card-host{font-size:12px\n}\n.link-preview-card .card-description{margin:0.5em 0 0 0;overflow:hidden;text-overflow:ellipsis;word-break:break-word;line-height:1.2em;max-height:calc(1.2em * 3 - 1px)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/link-preview/link-preview.vue","\n.timeline .panel-disabled .status-el{border-left:none;border-bottom-width:1px;border-bottom-style:solid;border-color:var(--border, #222);border-radius:0\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/conversation/conversation.vue","\n.user-profile{-ms-flex:2;flex:2;-ms-flex-preferred-size:500px;flex-basis:500px\n}\n.user-profile .userlist-placeholder{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:middle;align-items:middle;padding:2em\n}\n.user-profile .timeline-heading{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center\n}\n.user-profile .timeline-heading .loadmore-button,.user-profile .timeline-heading .alert{-ms-flex:1;flex:1\n}\n.user-profile .timeline-heading .loadmore-button{height:28px;margin:10px .6em\n}\n.user-profile .timeline-heading .title,.user-profile .timeline-heading .loadmore-text{display:none\n}\n.user-profile-placeholder .panel-body{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:middle;align-items:middle;padding:7em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/user_profile/user_profile.vue","\n.follow-card-content-container{-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:wrap;flex-wrap:wrap;line-height:1.5em\n}\n.follow-card-follow-button{margin-top:0.5em;margin-left:auto;width:10em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/follow_card/follow_card.vue","\n.basic-user-card{display:-ms-flexbox;display:flex;-ms-flex:1 0;flex:1 0;margin:0;padding:0.6em 1em\n}\n.basic-user-card-collapsed-content{margin-left:0.7em;text-align:left;-ms-flex:1;flex:1;min-width:0\n}\n.basic-user-card-user-name img{object-fit:contain;height:16px;width:16px;vertical-align:middle\n}\n.basic-user-card-user-name-value{display:inline-block;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis\n}\n.basic-user-card-expanded-content{-ms-flex:1;flex:1;margin-left:0.7em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/basic_user_card/basic_user_card.vue","\n.list-item:not(:last-child){border-bottom:1px solid;border-bottom-color:#222;border-bottom-color:var(--border, #222)\n}\n.list-empty-content{text-align:center;padding:10px\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/list/list.vue","\n@import '../../_variables.scss';\n\n.with-load-more {\n &-footer {\n padding: 10px;\n text-align: center;\n border-top: 1px solid;\n border-top-color: $fallback--border;\n border-top-color: var(--border, $fallback--border);\n\n .error {\n font-size: 14px;\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/hocs/with_load_more/src/hocs/with_load_more/with_load_more.scss","\n.setting-item{border-bottom:2px solid var(--fg, #182230);margin:1em 1em 1.4em;padding-bottom:1.4em\n}\n.setting-item>div{margin-bottom:.5em\n}\n.setting-item>div:last-child{margin-bottom:0\n}\n.setting-item:last-child{border-bottom:none;padding-bottom:0;margin-bottom:1em\n}\n.setting-item select{min-width:10em\n}\n.setting-item textarea{width:100%;max-width:100%;height:100px\n}\n.setting-item .unavailable,.setting-item .unavailable i{color:var(--cRed, red);color:red\n}\n.setting-item .btn{min-height:28px;min-width:10em;padding:0 2em\n}\n.setting-item .number-input{max-width:6em\n}\n.select-multiple{display:-ms-flexbox;display:flex\n}\n.select-multiple .option-list{margin:0;padding-left:.5em\n}\n.setting-list,.option-list{list-style-type:none;padding-left:2em\n}\n.setting-list li,.option-list li{margin-bottom:0.5em\n}\n.setting-list .suboptions,.option-list .suboptions{margin-top:0.3em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/settings/settings.vue","@import '../../_variables.scss';\n\n.tab-switcher {\n .contents {\n .hidden {\n display: none;\n }\n }\n .tabs {\n display: flex;\n position: relative;\n width: 100%;\n overflow-y: hidden;\n overflow-x: auto;\n padding-top: 5px;\n box-sizing: border-box;\n\n &::after, &::before {\n display: block;\n content: '';\n flex: 1 1 auto;\n border-bottom: 1px solid;\n border-bottom-color: $fallback--border;\n border-bottom-color: var(--border, $fallback--border);\n }\n\n .tab-wrapper {\n height: 28px;\n position: relative;\n display: flex;\n flex: 0 0 auto;\n\n .tab {\n width: 100%;\n min-width: 1px;\n position: relative;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n padding: 6px 1em;\n padding-bottom: 99px;\n margin-bottom: 6px - 99px;\n white-space: nowrap;\n\n &:not(.active) {\n z-index: 4;\n\n &:hover {\n z-index: 6;\n }\n }\n\n &.active {\n background: transparent;\n z-index: 5;\n }\n }\n\n &:not(.active) {\n &::after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 7;\n border-bottom: 1px solid;\n border-bottom-color: $fallback--border;\n border-bottom-color: var(--border, $fallback--border);\n }\n }\n }\n\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/tab_switcher/src/components/tab_switcher/tab_switcher.scss","\n.style-switcher .preset-switcher{margin-right:1em\n}\n.style-switcher .style-control{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;margin-bottom:5px\n}\n.style-switcher .style-control .label{-ms-flex:1;flex:1\n}\n.style-switcher .style-control.disabled input:not(.exclude-disabled),.style-switcher .style-control.disabled select:not(.exclude-disabled){opacity:.5\n}\n.style-switcher .style-control input,.style-switcher .style-control select{min-width:3em;margin:0;-ms-flex:0;flex:0\n}\n.style-switcher .style-control input[type=color],.style-switcher .style-control select[type=color]{padding:1px;cursor:pointer;height:29px;min-width:2em;border:none;-ms-flex-item-align:stretch;-ms-grid-row-align:stretch;align-self:stretch\n}\n.style-switcher .style-control input[type=number],.style-switcher .style-control select[type=number]{min-width:5em\n}\n.style-switcher .style-control input[type=range],.style-switcher .style-control select[type=range]{-ms-flex:1;flex:1;min-width:3em\n}\n.style-switcher .style-control input[type=checkbox]+label,.style-switcher .style-control select[type=checkbox]+label{margin:6px 0\n}\n.style-switcher .style-control input:not([type=number]):not([type=text]),.style-switcher .style-control select:not([type=number]):not([type=text]){-ms-flex-item-align:start;align-self:flex-start\n}\n.style-switcher .tab-switcher{margin:0 -1em\n}\n.style-switcher .reset-container{-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.style-switcher .fonts-container,.style-switcher .reset-container,.style-switcher .apply-container,.style-switcher .radius-container,.style-switcher .color-container{display:-ms-flexbox;display:flex\n}\n.style-switcher .fonts-container,.style-switcher .radius-container{-ms-flex-direction:column;flex-direction:column\n}\n.style-switcher .color-container{-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:justify;justify-content:space-between\n}\n.style-switcher .color-container>h4{width:99%\n}\n.style-switcher .fonts-container,.style-switcher .color-container,.style-switcher .shadow-container,.style-switcher .radius-container,.style-switcher .presets-container{margin:1em 1em 0\n}\n.style-switcher .tab-header{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline;width:100%;min-height:30px;margin-bottom:1em\n}\n.style-switcher .tab-header .btn{min-width:1px;-ms-flex:0 auto;flex:0 auto;padding:0 1em\n}\n.style-switcher .tab-header p{-ms-flex:1;flex:1;margin:0;margin-right:.5em\n}\n.style-switcher .shadow-selector .override{-ms-flex:1;flex:1;margin-left:.5em\n}\n.style-switcher .shadow-selector .select-container{margin-top:-4px;margin-bottom:-3px\n}\n.style-switcher .save-load,.style-switcher .save-load-options{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:baseline;align-items:baseline;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.style-switcher .save-load .presets,.style-switcher .save-load .import-export,.style-switcher .save-load-options .presets,.style-switcher .save-load-options .import-export{margin-bottom:.5em\n}\n.style-switcher .save-load .import-export,.style-switcher .save-load-options .import-export{display:-ms-flexbox;display:flex\n}\n.style-switcher .save-load .override,.style-switcher .save-load-options .override{margin-left:.5em\n}\n.style-switcher .save-load-options{-ms-flex-wrap:wrap;flex-wrap:wrap;margin-top:.5em;-ms-flex-pack:center;justify-content:center\n}\n.style-switcher .save-load-options .keep-option{margin:0 .5em .5em;min-width:25%\n}\n.style-switcher .preview-container{border-top:1px dashed;border-bottom:1px dashed;border-color:#222;border-color:var(--border, #222);margin:1em -1em 0;padding:1em;background:var(--body-background-image);background-size:cover;background-position:50% 50%\n}\n.style-switcher .preview-container .dummy .post{font-family:var(--postFont);display:-ms-flexbox;display:flex\n}\n.style-switcher .preview-container .dummy .post .content{-ms-flex:1;flex:1\n}\n.style-switcher .preview-container .dummy .post .content h4{margin-bottom:.25em\n}\n.style-switcher .preview-container .dummy .post .content .icons{margin-top:.5em;display:-ms-flexbox;display:flex\n}\n.style-switcher .preview-container .dummy .post .content .icons i{margin-right:1em\n}\n.style-switcher .preview-container .dummy .after-post{margin-top:1em;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center\n}\n.style-switcher .preview-container .dummy .avatar,.style-switcher .preview-container .dummy .avatar-alt{background:linear-gradient(135deg, #b8e1fc 0%, #a9d2f3 10%, #90bae4 25%, #90bcea 37%, #90bff0 50%, #6ba8e5 51%, #a2daf5 83%, #bdf3fd 100%);color:black;font-family:sans-serif;text-align:center;margin-right:1em\n}\n.style-switcher .preview-container .dummy .avatar-alt{-ms-flex:0 auto;flex:0 auto;margin-left:28px;font-size:12px;min-width:20px;min-height:20px;line-height:20px;border-radius:10px;border-radius:var(--avatarAltRadius, 10px)\n}\n.style-switcher .preview-container .dummy .avatar{-ms-flex:0 auto;flex:0 auto;width:48px;height:48px;font-size:14px;line-height:48px\n}\n.style-switcher .preview-container .dummy .actions{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline\n}\n.style-switcher .preview-container .dummy .actions .checkbox{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:baseline;align-items:baseline;margin-right:1em;-ms-flex:1;flex:1\n}\n.style-switcher .preview-container .dummy .separator{margin:1em;border-bottom:1px solid;border-color:#222;border-color:var(--border, #222)\n}\n.style-switcher .preview-container .dummy .panel-heading .badge,.style-switcher .preview-container .dummy .panel-heading .alert,.style-switcher .preview-container .dummy .panel-heading .btn,.style-switcher .preview-container .dummy .panel-heading .faint{margin-left:1em;white-space:nowrap\n}\n.style-switcher .preview-container .dummy .panel-heading .faint{text-overflow:ellipsis;min-width:2em;overflow-x:hidden\n}\n.style-switcher .preview-container .dummy .panel-heading .flex-spacer{-ms-flex:1;flex:1\n}\n.style-switcher .preview-container .dummy .btn{margin-left:0;padding:0 1em;min-width:3em;min-height:30px\n}\n.style-switcher .apply-container{-ms-flex-pack:center;justify-content:center\n}\n.style-switcher .radius-item,.style-switcher .color-item{min-width:20em;margin:5px 6px 0 0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1 1 0px;flex:1 1 0\n}\n.style-switcher .radius-item.wide,.style-switcher .color-item.wide{min-width:60%\n}\n.style-switcher .radius-item:not(.wide):nth-child(2n+1),.style-switcher .color-item:not(.wide):nth-child(2n+1){margin-right:7px\n}\n.style-switcher .radius-item .color,.style-switcher .radius-item .opacity,.style-switcher .color-item .color,.style-switcher .color-item .opacity{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline\n}\n.style-switcher .radius-item{-ms-flex-preferred-size:auto;flex-basis:auto\n}\n.style-switcher .theme-radius-rn,.style-switcher .theme-color-cl{border:0;box-shadow:none;background:transparent;color:var(--faint, rgba(185,185,186,0.5));-ms-flex-item-align:stretch;-ms-grid-row-align:stretch;align-self:stretch\n}\n.style-switcher .theme-color-cl,.style-switcher .theme-radius-in,.style-switcher .theme-color-in{margin-left:4px\n}\n.style-switcher .theme-radius-in{min-width:1em\n}\n.style-switcher .theme-radius-in{max-width:7em;-ms-flex:1;flex:1\n}\n.style-switcher .theme-radius-lb{max-width:50em\n}\n.style-switcher .theme-preview-content{padding:20px\n}\n.style-switcher .btn{margin-left:.25em;margin-right:.25em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/style_switcher/style_switcher.scss","\n.color-control input.text-input{max-width:7em;-ms-flex:1;flex:1\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/color_input/color_input.vue","\n.shadow-control{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin-bottom:1em\n}\n.shadow-control .shadow-preview-container,.shadow-control .shadow-tweak{margin:5px 6px 0 0\n}\n.shadow-control .shadow-preview-container{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.shadow-control .shadow-preview-container input[type=number]{width:5em;min-width:2em\n}\n.shadow-control .shadow-preview-container .x-shift-control,.shadow-control .shadow-preview-container .y-shift-control{display:-ms-flexbox;display:flex;-ms-flex:0;flex:0\n}\n.shadow-control .shadow-preview-container .x-shift-control[disabled=disabled] *,.shadow-control .shadow-preview-container .y-shift-control[disabled=disabled] *{opacity:.5\n}\n.shadow-control .shadow-preview-container .x-shift-control{-ms-flex-align:start;align-items:flex-start\n}\n.shadow-control .shadow-preview-container .x-shift-control .wrap,.shadow-control .shadow-preview-container input[type=range]{margin:0;width:15em;height:2em\n}\n.shadow-control .shadow-preview-container .y-shift-control{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:flex-end\n}\n.shadow-control .shadow-preview-container .y-shift-control .wrap{width:2em;height:15em\n}\n.shadow-control .shadow-preview-container .y-shift-control input[type=range]{transform-origin:1em 1em;transform:rotate(90deg)\n}\n.shadow-control .shadow-preview-container .preview-window{-ms-flex:1;flex:1;background-color:#999999;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-image:linear-gradient(45deg, #666 25%, transparent 25%),linear-gradient(-45deg, #666 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #666 75%),linear-gradient(-45deg, transparent 75%, #666 75%);background-size:20px 20px;background-position:0 0, 0 10px, 10px -10px, -10px 0;border-radius:4px;border-radius:var(--inputRadius, 4px)\n}\n.shadow-control .shadow-preview-container .preview-window .preview-block{width:33%;height:33%;background-color:#121a24;background-color:var(--bg, #121a24);border-radius:10px;border-radius:var(--panelRadius, 10px)\n}\n.shadow-control .shadow-tweak{-ms-flex:1;flex:1;min-width:280px\n}\n.shadow-control .shadow-tweak .id-control{-ms-flex-align:stretch;align-items:stretch\n}\n.shadow-control .shadow-tweak .id-control .select,.shadow-control .shadow-tweak .id-control .btn{min-width:1px;margin-right:5px\n}\n.shadow-control .shadow-tweak .id-control .btn{padding:0 .4em;margin:0 .1em\n}\n.shadow-control .shadow-tweak .id-control .select{-ms-flex:1;flex:1\n}\n.shadow-control .shadow-tweak .id-control .select select{-ms-flex-item-align:initial;-ms-grid-row-align:initial;align-self:initial\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/shadow_control/shadow_control.vue","\n.font-control input.custom-font{min-width:10em\n}\n.font-control.custom .select{border-top-right-radius:0;border-bottom-right-radius:0\n}\n.font-control.custom .custom-font{border-top-left-radius:0;border-bottom-left-radius:0\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/font_control/font_control.vue","\n.contrast-ratio{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;margin-top:-4px;margin-bottom:5px\n}\n.contrast-ratio .label{margin-right:1em\n}\n.contrast-ratio .rating{display:inline-block;text-align:center\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/contrast_ratio/contrast_ratio.vue","\n.import-export-container{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:baseline;align-items:baseline;-ms-flex-pack:center;justify-content:center\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/export_import/export_import.vue","\n.registration-form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:0.6em\n}\n.registration-form .container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row\n}\n.registration-form .terms-of-service{-ms-flex:0 1 50%;flex:0 1 50%;margin:0.8em\n}\n.registration-form .text-fields{margin-top:0.6em;-ms-flex:1 0;flex:1 0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column\n}\n.registration-form textarea{min-height:100px\n}\n.registration-form .form-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:0.3em 0.0em 0.3em;line-height:24px;margin-bottom:1em\n}\n.registration-form .form-group--error{animation-name:shakeError;animation-duration:.6s;animation-timing-function:ease-in-out\n}\n.registration-form .form-group--error .form--label{color:#f04124;color:var(--cRed, #f04124)\n}\n.registration-form .form-error{margin-top:-0.7em;text-align:left\n}\n.registration-form .form-error span{font-size:12px\n}\n.registration-form .form-error ul{list-style:none;padding:0 0 0 5px;margin-top:0\n}\n.registration-form .form-error ul li::before{content:\"• \"\n}\n.registration-form form textarea{line-height:16px;resize:vertical\n}\n.registration-form .captcha{max-width:350px;margin-bottom:0.4em\n}\n.registration-form .btn{margin-top:0.6em;height:28px\n}\n.registration-form .error{text-align:center\n}\n@media all and (max-width: 800px){\n.registration-form .container{-ms-flex-direction:column-reverse;flex-direction:column-reverse\n}\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/registration/registration.vue","\n.profile-edit .bio{margin:0\n}\n.profile-edit input[type=file]{padding:5px;height:auto\n}\n.profile-edit .banner{max-width:100%\n}\n.profile-edit .uploading{font-size:1.5em;margin:0.25em\n}\n.profile-edit .name-changer{width:100%\n}\n.profile-edit .bg{max-width:100%\n}\n.profile-edit .current-avatar{display:block;width:150px;height:150px;border-radius:4px;border-radius:var(--avatarRadius, 4px)\n}\n.profile-edit .oauth-tokens{width:100%\n}\n.profile-edit .oauth-tokens th{text-align:left\n}\n.profile-edit .oauth-tokens .actions{text-align:right\n}\n.profile-edit-usersearch-wrapper{padding:1em\n}\n.profile-edit-bulk-actions{text-align:right;padding:0 1em;min-height:28px\n}\n.profile-edit-bulk-actions button{width:10em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/user_settings/user_settings.vue","\n.image-cropper-img-input{display:none\n}\n.image-cropper-image-container{position:relative\n}\n.image-cropper-image-container img{display:block;max-width:100%\n}\n.image-cropper-buttons-wrapper{margin-top:10px\n}\n.image-cropper-buttons-wrapper button{margin-top:5px\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/image_cropper/image_cropper.vue","/*!\n * Cropper.js v1.4.3\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2018-10-24T13:07:11.429Z\n */\n\n.cropper-container {\n direction: ltr;\n font-size: 0;\n line-height: 0;\n position: relative;\n -ms-touch-action: none;\n touch-action: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cropper-container img {\n display: block;\n height: 100%;\n image-orientation: 0deg;\n max-height: none !important;\n max-width: none !important;\n min-height: 0 !important;\n min-width: 0 !important;\n width: 100%;\n}\n\n.cropper-wrap-box,\n.cropper-canvas,\n.cropper-drag-box,\n.cropper-crop-box,\n.cropper-modal {\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.cropper-wrap-box,\n.cropper-canvas {\n overflow: hidden;\n}\n\n.cropper-drag-box {\n background-color: #fff;\n opacity: 0;\n}\n\n.cropper-modal {\n background-color: #000;\n opacity: .5;\n}\n\n.cropper-view-box {\n display: block;\n height: 100%;\n outline-color: rgba(51, 153, 255, 0.75);\n outline: 1px solid #39f;\n overflow: hidden;\n width: 100%;\n}\n\n.cropper-dashed {\n border: 0 dashed #eee;\n display: block;\n opacity: .5;\n position: absolute;\n}\n\n.cropper-dashed.dashed-h {\n border-bottom-width: 1px;\n border-top-width: 1px;\n height: calc(100% / 3);\n left: 0;\n top: calc(100% / 3);\n width: 100%;\n}\n\n.cropper-dashed.dashed-v {\n border-left-width: 1px;\n border-right-width: 1px;\n height: 100%;\n left: calc(100% / 3);\n top: 0;\n width: calc(100% / 3);\n}\n\n.cropper-center {\n display: block;\n height: 0;\n left: 50%;\n opacity: .75;\n position: absolute;\n top: 50%;\n width: 0;\n}\n\n.cropper-center:before,\n.cropper-center:after {\n background-color: #eee;\n content: ' ';\n display: block;\n position: absolute;\n}\n\n.cropper-center:before {\n height: 1px;\n left: -3px;\n top: 0;\n width: 7px;\n}\n\n.cropper-center:after {\n height: 7px;\n left: 0;\n top: -3px;\n width: 1px;\n}\n\n.cropper-face,\n.cropper-line,\n.cropper-point {\n display: block;\n height: 100%;\n opacity: .1;\n position: absolute;\n width: 100%;\n}\n\n.cropper-face {\n background-color: #fff;\n left: 0;\n top: 0;\n}\n\n.cropper-line {\n background-color: #39f;\n}\n\n.cropper-line.line-e {\n cursor: ew-resize;\n right: -3px;\n top: 0;\n width: 5px;\n}\n\n.cropper-line.line-n {\n cursor: ns-resize;\n height: 5px;\n left: 0;\n top: -3px;\n}\n\n.cropper-line.line-w {\n cursor: ew-resize;\n left: -3px;\n top: 0;\n width: 5px;\n}\n\n.cropper-line.line-s {\n bottom: -3px;\n cursor: ns-resize;\n height: 5px;\n left: 0;\n}\n\n.cropper-point {\n background-color: #39f;\n height: 5px;\n opacity: .75;\n width: 5px;\n}\n\n.cropper-point.point-e {\n cursor: ew-resize;\n margin-top: -3px;\n right: -3px;\n top: 50%;\n}\n\n.cropper-point.point-n {\n cursor: ns-resize;\n left: 50%;\n margin-left: -3px;\n top: -3px;\n}\n\n.cropper-point.point-w {\n cursor: ew-resize;\n left: -3px;\n margin-top: -3px;\n top: 50%;\n}\n\n.cropper-point.point-s {\n bottom: -3px;\n cursor: s-resize;\n left: 50%;\n margin-left: -3px;\n}\n\n.cropper-point.point-ne {\n cursor: nesw-resize;\n right: -3px;\n top: -3px;\n}\n\n.cropper-point.point-nw {\n cursor: nwse-resize;\n left: -3px;\n top: -3px;\n}\n\n.cropper-point.point-sw {\n bottom: -3px;\n cursor: nesw-resize;\n left: -3px;\n}\n\n.cropper-point.point-se {\n bottom: -3px;\n cursor: nwse-resize;\n height: 20px;\n opacity: 1;\n right: -3px;\n width: 20px;\n}\n\n@media (min-width: 768px) {\n .cropper-point.point-se {\n height: 15px;\n width: 15px;\n }\n}\n\n@media (min-width: 992px) {\n .cropper-point.point-se {\n height: 10px;\n width: 10px;\n }\n}\n\n@media (min-width: 1200px) {\n .cropper-point.point-se {\n height: 5px;\n opacity: .75;\n width: 5px;\n }\n}\n\n.cropper-point.point-se:before {\n background-color: #39f;\n bottom: -50%;\n content: ' ';\n display: block;\n height: 200%;\n opacity: 0;\n position: absolute;\n right: -50%;\n width: 200%;\n}\n\n.cropper-invisible {\n opacity: 0;\n}\n\n.cropper-bg {\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');\n}\n\n.cropper-hide {\n display: block;\n height: 0;\n position: absolute;\n width: 0;\n}\n\n.cropper-hidden {\n display: none !important;\n}\n\n.cropper-move {\n cursor: move;\n}\n\n.cropper-crop {\n cursor: crosshair;\n}\n\n.cropper-disabled .cropper-drag-box,\n.cropper-disabled .cropper-face,\n.cropper-disabled .cropper-line,\n.cropper-disabled .cropper-point {\n cursor: not-allowed;\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///~/cropperjs/dist/cropper.css","\n.block-card-content-container{margin-top:0.5em;text-align:right\n}\n.block-card-content-container button{width:10em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/block_card/block_card.vue","\n.mute-card-content-container{margin-top:0.5em;text-align:right\n}\n.mute-card-content-container button{width:10em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/mute_card/mute_card.vue","\n.selectable-list-item-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center\n}\n.selectable-list-item-selected-inner{background-color:#151e2a;background-color:var(--lightBg, #151e2a)\n}\n.selectable-list-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0.6em 0;border-bottom:2px solid;border-bottom-color:#222;border-bottom-color:var(--border, #222)\n}\n.selectable-list-header-actions{-ms-flex:1;flex:1\n}\n.selectable-list-checkbox-wrapper{padding:0 10px;-ms-flex:none;flex:none\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/selectable_list/selectable_list.vue","\n.checkbox{position:relative;display:inline-block;padding-left:1.2em;min-height:1.2em\n}\n.checkbox-indicator::before{position:absolute;left:0;top:0;display:block;content:'✔';transition:color 200ms;width:1.1em;height:1.1em;border-radius:2px;border-radius:var(--checkboxRadius, 2px);box-shadow:0px 0px 2px black inset;box-shadow:var(--inputShadow);background-color:#182230;background-color:var(--input, #182230);vertical-align:top;text-align:center;line-height:1.1em;font-size:1.1em;color:transparent;overflow:hidden;box-sizing:border-box\n}\n.checkbox input[type=checkbox]{display:none\n}\n.checkbox input[type=checkbox]:checked+.checkbox-indicator::before{color:#b9b9ba;color:var(--text, #b9b9ba)\n}\n.checkbox input[type=checkbox]:indeterminate+.checkbox-indicator::before{content:'–';color:#b9b9ba;color:var(--text, #b9b9ba)\n}\n.checkbox input[type=checkbox]:disabled+.checkbox-indicator::before{opacity:.5\n}\n.checkbox>span{margin-left:.5em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/checkbox/checkbox.vue","\n.autosuggest{position:relative\n}\n.autosuggest-input{display:block;width:100%\n}\n.autosuggest-results{position:absolute;left:0;top:100%;right:0;max-height:400px;background-color:#151e2a;background-color:var(--lightBg, #151e2a);border-style:solid;border-width:1px;border-color:#222;border-color:var(--border, #222);border-radius:4px;border-radius:var(--inputRadius, 4px);border-top-left-radius:0;border-top-right-radius:0;box-shadow:1px 1px 4px rgba(0,0,0,0.6);box-shadow:var(--panelShadow);overflow-y:auto;z-index:1\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/autosuggest/autosuggest.vue",".with-subscription {\n &-loading {\n padding: 10px;\n text-align: center;\n\n .error {\n font-size: 14px;\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// webpack:///src/hocs/with_subscription/src/hocs/with_subscription/with_subscription.scss","\n.follow-request-card-content-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.follow-request-card-content-container button{margin-top:0.5em;margin-right:0.5em;-ms-flex:1 1;flex:1 1;max-width:12em;min-width:8em\n}\n.follow-request-card-content-container button:last-child{margin-right:0\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/follow_request_card/follow_request_card.vue","\n.user-search-input-container{margin:0.5em;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center\n}\n.user-search-input-container .search-button{margin-left:0.5em\n}\n.loading-icon{padding:1em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/user_search/user_search.vue","\n.notifications{padding-bottom:15em\n}\n.notifications .loadmore-error{color:#b9b9ba;color:var(--text, #b9b9ba)\n}\n.notifications .notification{position:relative\n}\n.notifications .notification .notification-overlay{position:absolute;top:0;right:0;left:0;bottom:0;pointer-events:none\n}\n.notifications .notification.unseen .notification-overlay{background-image:linear-gradient(135deg, var(--badgeNotification, red) 4px, transparent 10px)\n}\n.notification{box-sizing:border-box;display:-ms-flexbox;display:flex;border-bottom:1px solid;border-color:#222;border-color:var(--border, #222)\n}\n.notification:hover .animated.avatar canvas{display:none\n}\n.notification:hover .animated.avatar img{visibility:visible\n}\n.notification .non-mention{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-wrap:nowrap;flex-wrap:nowrap;padding:0.6em;min-width:0\n}\n.notification .non-mention .avatar-container{width:32px;height:32px\n}\n.notification .non-mention .status-el{padding:0\n}\n.notification .non-mention .status-el .status{padding:0.25em 0;color:rgba(185,185,186,0.5);color:var(--faint, rgba(185,185,186,0.5))\n}\n.notification .non-mention .status-el .status a{color:var(--faintLink)\n}\n.notification .non-mention .status-el .media-body{margin:0\n}\n.notification .follow-text{padding:0.5em 0\n}\n.notification .status-el{-ms-flex:1;flex:1\n}\n.notification time{white-space:nowrap\n}\n.notification .notification-right{-ms-flex:1;flex:1;padding-left:0.8em;min-width:0\n}\n.notification .notification-details{min-width:0px;word-wrap:break-word;line-height:18px;position:relative;overflow:hidden;width:100%;-ms-flex:1 1 0px;flex:1 1 0;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:justify;justify-content:space-between\n}\n.notification .notification-details .name-and-action{-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis\n}\n.notification .notification-details .username{font-weight:bolder;max-width:100%;text-overflow:ellipsis;white-space:nowrap\n}\n.notification .notification-details .username img{width:14px;height:14px;vertical-align:middle;object-fit:contain\n}\n.notification .notification-details .timeago{margin-right:.2em\n}\n.notification .notification-details .icon-retweet.lit{color:#0fa00f;color:var(--cGreen, #0fa00f)\n}\n.notification .notification-details .icon-user-plus.lit{color:#0095ff;color:var(--cBlue, #0095ff)\n}\n.notification .notification-details .icon-reply.lit{color:#0095ff;color:var(--cBlue, #0095ff)\n}\n.notification .notification-details .icon-star.lit{color:orange;color:orange;color:var(--cOrange, orange)\n}\n.notification .notification-details .status-content{margin:0;max-height:300px\n}\n.notification .notification-details h1{word-break:break-all;margin:0 0 0.3em;padding:0;font-size:1em;line-height:20px\n}\n.notification .notification-details h1 small{font-weight:lighter\n}\n.notification .notification-details p{margin:0;margin-top:0;margin-bottom:0.3em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/notifications/notifications.scss","\n.login-form .btn{min-height:28px;width:10em\n}\n.login-form .register{-ms-flex:1 1;flex:1 1\n}\n.login-form .login-bottom{margin-top:1.0em;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between\n}\n.login .error{text-align:center;animation-name:shakeError;animation-duration:0.4s;animation-timing-function:ease-in-out\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/login_form/login_form.vue","\n.floating-chat{position:fixed;right:0px;bottom:0px;z-index:1000;max-width:25em\n}\n.chat-heading{cursor:pointer\n}\n.chat-heading .icon-comment-empty{color:#b9b9ba;color:var(--text, #b9b9ba)\n}\n.chat-window{overflow-y:auto;overflow-x:hidden;max-height:20em\n}\n.chat-window-container{height:100%\n}\n.chat-message{display:-ms-flexbox;display:flex;padding:0.2em 0.5em\n}\n.chat-avatar img{height:24px;width:24px;border-radius:4px;border-radius:var(--avatarRadius, 4px);margin-right:0.5em;margin-top:0.25em\n}\n.chat-input{display:-ms-flexbox;display:flex\n}\n.chat-input textarea{-ms-flex:1;flex:1;margin:0.6em;min-height:3.5em;resize:none\n}\n.chat-panel .title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/chat_panel/chat_panel.vue","\n.features-panel li{line-height:24px\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/features_panel/features_panel.vue","\n.tos-content{margin:1em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/terms_of_service_panel/terms_of_service_panel.vue","\n#app{min-height:100vh;max-width:100%;overflow:hidden\n}\n.app-bg-wrapper{position:fixed;z-index:-1;height:100%;width:100%;background-size:cover;background-repeat:no-repeat;background-position:0 50%\n}\ni{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none\n}\nh4{margin:0\n}\n#content{box-sizing:border-box;padding-top:60px;margin:auto;min-height:100vh;max-width:980px;background-color:rgba(0,0,0,0.15);-ms-flex-line-pack:start;align-content:flex-start\n}\n.text-center{text-align:center\n}\nbody{font-family:sans-serif;font-family:var(--interfaceFont, sans-serif);font-size:14px;margin:0;color:#b9b9ba;color:var(--text, #b9b9ba);max-width:100vw;overflow-x:hidden\n}\na{text-decoration:none;color:#d8a070;color:var(--link, #d8a070)\n}\nbutton{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#b9b9ba;color:var(--btnText, #b9b9ba);background-color:#182230;background-color:var(--btn, #182230);border:none;border-radius:4px;border-radius:var(--btnRadius, 4px);cursor:pointer;box-shadow:0px 0px 2px 0px #000,0px 1px 0px 0px rgba(255,255,255,0.2) inset,0px -1px 0px 0px rgba(0,0,0,0.2) inset;box-shadow:var(--buttonShadow);font-size:14px;font-family:sans-serif;font-family:var(--interfaceFont, sans-serif)\n}\nbutton i[class*=icon-]{color:#b9b9ba;color:var(--btnText, #b9b9ba)\n}\nbutton::-moz-focus-inner{border:none\n}\nbutton:hover{box-shadow:0px 0px 4px rgba(255,255,255,0.3);box-shadow:var(--buttonHoverShadow)\n}\nbutton:active{box-shadow:0px 0px 4px 0px rgba(255,255,255,0.3),0px 1px 0px 0px rgba(0,0,0,0.2) inset,0px -1px 0px 0px rgba(255,255,255,0.2) inset;box-shadow:var(--buttonPressedShadow)\n}\nbutton:disabled{cursor:not-allowed;opacity:0.5\n}\nbutton.pressed{color:rgba(185,185,186,0.5);color:var(--faint, rgba(185,185,186,0.5));background-color:#121a24;background-color:var(--bg, #121a24)\n}\nbutton.danger{color:#b9b9ba;color:var(--alertErrorPanelText, #b9b9ba);background-color:rgba(211,16,20,0.5);background-color:var(--alertError, rgba(211,16,20,0.5))\n}\nlabel.select{padding:0\n}\ninput,textarea,.select{border:none;border-radius:4px;border-radius:var(--inputRadius, 4px);box-shadow:0px 1px 0px 0px rgba(0,0,0,0.2) inset,0px -1px 0px 0px rgba(255,255,255,0.2) inset,0px 0px 2px 0px #000 inset;box-shadow:var(--inputShadow);background-color:#182230;background-color:var(--input, #182230);color:#b9b9ba;color:var(--inputText, #b9b9ba);font-family:sans-serif;font-family:var(--inputFont, sans-serif);font-size:14px;padding:8px .5em;box-sizing:border-box;display:inline-block;position:relative;height:28px;line-height:16px;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none\n}\ninput:disabled,input[disabled=disabled],textarea:disabled,textarea[disabled=disabled],.select:disabled,.select[disabled=disabled]{cursor:not-allowed;opacity:0.5\n}\ninput .icon-down-open,textarea .icon-down-open,.select .icon-down-open{position:absolute;top:0;bottom:0;right:5px;height:100%;color:#b9b9ba;color:var(--text, #b9b9ba);line-height:28px;z-index:0;pointer-events:none\n}\ninput select,textarea select,.select select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:none;color:#b9b9ba;color:var(--inputText, --text, #b9b9ba);margin:0;padding:0 2em 0 .2em;font-family:sans-serif;font-family:var(--inputFont, sans-serif);font-size:14px;width:100%;z-index:1;height:28px;line-height:16px\n}\ninput[type=range],textarea[type=range],.select[type=range]{background:none;border:none;margin:0;box-shadow:none;-ms-flex:1;flex:1\n}\ninput[type=radio],input[type=checkbox],textarea[type=radio],textarea[type=checkbox],.select[type=radio],.select[type=checkbox]{display:none\n}\ninput[type=radio]:checked+label::before,input[type=checkbox]:checked+label::before,textarea[type=radio]:checked+label::before,textarea[type=checkbox]:checked+label::before,.select[type=radio]:checked+label::before,.select[type=checkbox]:checked+label::before{color:#b9b9ba;color:var(--text, #b9b9ba)\n}\ninput[type=radio]:disabled,input[type=radio]:disabled+label,input[type=radio]:disabled+label::before,input[type=checkbox]:disabled,input[type=checkbox]:disabled+label,input[type=checkbox]:disabled+label::before,textarea[type=radio]:disabled,textarea[type=radio]:disabled+label,textarea[type=radio]:disabled+label::before,textarea[type=checkbox]:disabled,textarea[type=checkbox]:disabled+label,textarea[type=checkbox]:disabled+label::before,.select[type=radio]:disabled,.select[type=radio]:disabled+label,.select[type=radio]:disabled+label::before,.select[type=checkbox]:disabled,.select[type=checkbox]:disabled+label,.select[type=checkbox]:disabled+label::before{opacity:.5\n}\ninput[type=radio]+label::before,input[type=checkbox]+label::before,textarea[type=radio]+label::before,textarea[type=checkbox]+label::before,.select[type=radio]+label::before,.select[type=checkbox]+label::before{display:inline-block;content:'✔';transition:color 200ms;width:1.1em;height:1.1em;border-radius:2px;border-radius:var(--checkboxRadius, 2px);box-shadow:0px 0px 2px black inset;box-shadow:var(--inputShadow);margin-right:.5em;background-color:#182230;background-color:var(--input, #182230);vertical-align:top;text-align:center;line-height:1.1em;font-size:1.1em;box-sizing:border-box;color:transparent;overflow:hidden;box-sizing:border-box\n}\noption{color:#b9b9ba;color:var(--text, #b9b9ba);background-color:#121a24;background-color:var(--bg, #121a24)\n}\ni[class*=icon-]{color:#666;color:var(--icon, #666)\n}\n.container{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0;padding:0 10px 0 10px\n}\n.item{-ms-flex:1;flex:1;line-height:50px;height:50px;overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.item .nav-icon{margin-left:0.4em\n}\n.item.right{-ms-flex-pack:end;justify-content:flex-end\n}\n.auto-size{-ms-flex:1;flex:1\n}\n.nav-bar{padding:0;width:100%;-ms-flex-align:center;align-items:center;position:fixed;height:50px\n}\n.nav-bar .logo{display:-ms-flexbox;display:flex;position:absolute;top:0;bottom:0;left:0;right:0;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:center;justify-content:center;-ms-flex:0 0 auto;flex:0 0 auto;z-index:-1;transition:opacity;transition-timing-function:ease-out;transition-duration:100ms\n}\n.nav-bar .logo .mask{-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:contain;mask-size:contain;background-color:#182230;background-color:var(--topBarText, #182230);position:absolute;top:0;bottom:0;left:0;right:0\n}\n.nav-bar .logo img{height:100%;object-fit:contain;display:block;-ms-flex:0;flex:0\n}\n.nav-bar .inner-nav{margin:auto;box-sizing:border-box;padding-left:10px;padding-right:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-preferred-size:970px;flex-basis:970px;height:50px\n}\n.nav-bar .inner-nav a,.nav-bar .inner-nav a i{color:#d8a070;color:var(--topBarLink, #d8a070)\n}\nmain-router{-ms-flex:1;flex:1\n}\n.status.compact{color:rgba(0,0,0,0.42);font-weight:300\n}\n.status.compact p{margin:0;font-size:0.8em\n}\n.panel{display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:column;flex-direction:column;margin:0.5em;background-color:#121a24;background-color:var(--bg, #121a24)\n}\n.panel::after,.panel{border-radius:10px;border-radius:var(--panelRadius, 10px)\n}\n.panel::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;box-shadow:1px 1px 4px rgba(0,0,0,0.6);box-shadow:var(--panelShadow)\n}\n.panel-body:empty::before{content:\"¯\\\\_(ツ)_/¯\";display:block;margin:1em;text-align:center\n}\n.panel-heading{display:-ms-flexbox;display:flex;border-radius:10px 10px 0 0;border-radius:var(--panelRadius, 10px) var(--panelRadius, 10px) 0 0;background-size:cover;padding:.6em .6em;text-align:left;line-height:28px;color:var(--panelText);background-color:#182230;background-color:var(--panel, #182230);-ms-flex-align:baseline;align-items:baseline;box-shadow:var(--panelHeaderShadow)\n}\n.panel-heading .title{-ms-flex:1 0 auto;flex:1 0 auto;font-size:1.3em\n}\n.panel-heading .faint{background-color:transparent;color:rgba(185,185,186,0.5);color:var(--panelFaint, rgba(185,185,186,0.5))\n}\n.panel-heading .alert{white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden\n}\n.panel-heading button{-ms-flex-negative:0;flex-shrink:0\n}\n.panel-heading button,.panel-heading .alert{line-height:21px;min-height:0;box-sizing:border-box;margin:0;margin-left:.25em;min-width:1px;-ms-flex-item-align:stretch;-ms-grid-row-align:stretch;align-self:stretch\n}\n.panel-heading a{color:#d8a070;color:var(--panelLink, #d8a070)\n}\n.panel-heading.stub{border-radius:10px;border-radius:var(--panelRadius, 10px)\n}\n.panel-footer{border-radius:0 0 10px 10px;border-radius:0 0 var(--panelRadius, 10px) var(--panelRadius, 10px)\n}\n.panel-footer .faint{color:rgba(185,185,186,0.5);color:var(--panelFaint, rgba(185,185,186,0.5))\n}\n.panel-footer a{color:#d8a070;color:var(--panelLink, #d8a070)\n}\n.panel-body>p{line-height:18px;padding:1em;margin:0\n}\n.container>*{min-width:0px\n}\n.fa{color:grey\n}\nnav{z-index:1000;color:var(--topBarText);background-color:#182230;background-color:var(--topBar, #182230);color:rgba(185,185,186,0.5);color:var(--faint, rgba(185,185,186,0.5));box-shadow:0px 0px 4px rgba(0,0,0,0.6);box-shadow:var(--topBarShadow)\n}\nnav .back-button{display:block;max-width:99px;transition-property:opacity, max-width;transition-duration:300ms;transition-timing-function:ease-out\n}\nnav .back-button i{margin:0 1em\n}\nnav .back-button.hidden{opacity:0;max-width:5px\n}\n.fade-enter-active,.fade-leave-active{transition:opacity .2s\n}\n.fade-enter,.fade-leave-active{opacity:0\n}\n.main{-ms-flex-preferred-size:50%;flex-basis:50%;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1\n}\n.sidebar-bounds{-ms-flex:0;flex:0;-ms-flex-preferred-size:35%;flex-basis:35%\n}\n.sidebar-flexer{-ms-flex:1;flex:1;-ms-flex-preferred-size:345px;flex-basis:345px;width:365px\n}\n.mobile-shown{display:none\n}\n@media all and (min-width: 800px){\nbody{overflow-y:scroll\n}\nnav .back-button{display:none\n}\n.sidebar-bounds{overflow:hidden;max-height:100vh;width:345px;position:fixed;margin-top:-10px\n}\n.sidebar-bounds .sidebar-scroller{height:96vh;width:365px;padding-top:10px;padding-right:50px;overflow-x:hidden;overflow-y:scroll\n}\n.sidebar-bounds .sidebar{width:345px\n}\n.sidebar-flexer{max-height:96vh;-ms-flex-negative:0;flex-shrink:0;-ms-flex-positive:0;flex-grow:0\n}\n}\n.badge{display:inline-block;border-radius:99px;min-width:22px;max-width:22px;min-height:22px;max-height:22px;font-size:15px;line-height:22px;text-align:center;vertical-align:middle;white-space:nowrap;padding:0\n}\n.badge.badge-notification{background-color:red;background-color:var(--badgeNotification, red);color:white;color:var(--badgeNotificationText, #fff)\n}\n.alert{margin:0.35em;padding:0.25em;border-radius:5px;border-radius:var(--tooltipRadius, 5px);min-height:28px;line-height:28px\n}\n.alert.error{background-color:rgba(211,16,20,0.5);background-color:var(--alertError, rgba(211,16,20,0.5));color:#b9b9ba;color:var(--alertErrorText, #b9b9ba)\n}\n.panel-heading .alert.error{color:#b9b9ba;color:var(--alertErrorPanelText, #b9b9ba)\n}\n.faint{color:rgba(185,185,186,0.5);color:var(--faint, rgba(185,185,186,0.5))\n}\n.faint-link{color:rgba(185,185,186,0.5);color:var(--faint, rgba(185,185,186,0.5))\n}\n.faint-link:hover{text-decoration:underline\n}\n@media all and (min-width: 800px){\n.logo{opacity:1 !important\n}\n}\n.item.right{text-align:right\n}\n.visibility-tray{font-size:1.2em;padding:3px;cursor:pointer\n}\n.visibility-tray .selected{color:#b9b9ba;color:var(--lightText, #b9b9ba)\n}\n.visibility-tray div{padding-top:5px\n}\n.visibility-notice{padding:.5em;border:1px solid rgba(185,185,186,0.5);border:1px solid var(--faint, rgba(185,185,186,0.5));border-radius:4px;border-radius:var(--inputRadius, 4px)\n}\n@keyframes modal-background-fadein{\nfrom{background-color:transparent\n}\nto{background-color:rgba(0,0,0,0.5)\n}\n}\n.modal-view{z-index:1000;position:fixed;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;overflow:auto;animation-duration:0.2s;background-color:rgba(0,0,0,0.5);animation-name:modal-background-fadein\n}\n.button-icon{font-size:1.2em\n}\n@keyframes shakeError{\n0%{transform:translateX(0)\n}\n15%{transform:translateX(0.375rem)\n}\n30%{transform:translateX(-0.375rem)\n}\n45%{transform:translateX(0.375rem)\n}\n60%{transform:translateX(-0.375rem)\n}\n75%{transform:translateX(0.375rem)\n}\n90%{transform:translateX(-0.375rem)\n}\n100%{transform:translateX(0)\n}\n}\n@media all and (max-width: 800px){\n.mobile-hidden{display:none\n}\n.panel-switcher{display:-ms-flexbox;display:flex\n}\n.container{padding:0\n}\n.panel{margin:0.5em 0 0.5em 0\n}\n.menu-button{display:block;margin-right:0.8em\n}\n}\n.login-hint{text-align:center\n}\n@media all and (min-width: 801px){\n.login-hint{display:none\n}\n}\n.login-hint a{display:inline-block;padding:1em 0px;width:100%\n}\n.btn.btn-default{min-height:28px\n}\n.autocomplete-panel{position:relative\n}\n.autocomplete-panel-body{margin:0 0.5em 0 0.5em;border-radius:5px;border-radius:var(--tooltipRadius, 5px);position:absolute;z-index:1;box-shadow:1px 2px 4px rgba(0,0,0,0.5);box-shadow:var(--popupShadow);min-width:75%;background:#121a24;background:var(--bg, #121a24);color:#b9b9ba;color:var(--lightText, #b9b9ba)\n}\n.autocomplete-item{cursor:pointer;padding:0.2em 0.4em 0.2em 0.4em;border-bottom:1px solid rgba(0,0,0,0.4);display:-ms-flexbox;display:flex\n}\n.autocomplete-item img{width:24px;height:24px;object-fit:contain\n}\n.autocomplete-item span{line-height:24px;margin:0 0.1em 0 0.2em\n}\n.autocomplete-item small{margin-left:.5em;color:rgba(185,185,186,0.5);color:var(--faint, rgba(185,185,186,0.5))\n}\n.autocomplete-item.highlighted{background-color:#182230;background-color:var(--lightBg, #182230)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/App.scss","\n.nav-panel .panel{overflow:hidden;box-shadow:var(--panelShadow)\n}\n.nav-panel ul{list-style:none;margin:0;padding:0\n}\n.follow-request-count{margin:-6px 10px;background-color:#121a24;background-color:var(--input, rgba(185,185,186,0.5))\n}\n.nav-panel li{border-bottom:1px solid;border-color:#222;border-color:var(--border, #222);padding:0\n}\n.nav-panel li:first-child a{border-top-right-radius:10px;border-top-right-radius:var(--panelRadius, 10px);border-top-left-radius:10px;border-top-left-radius:var(--panelRadius, 10px)\n}\n.nav-panel li:last-child a{border-bottom-right-radius:10px;border-bottom-right-radius:var(--panelRadius, 10px);border-bottom-left-radius:10px;border-bottom-left-radius:var(--panelRadius, 10px)\n}\n.nav-panel li:last-child{border:none\n}\n.nav-panel a{display:block;padding:0.8em 0.85em\n}\n.nav-panel a:hover{background-color:#151e2a;background-color:var(--lightBg, #151e2a)\n}\n.nav-panel a.router-link-active{font-weight:bolder;background-color:#151e2a;background-color:var(--lightBg, #151e2a)\n}\n.nav-panel a.router-link-active:hover{text-decoration:underline\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/nav_panel/nav_panel.vue","\n.user-finder-container{max-width:100%;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:baseline;align-items:baseline;vertical-align:baseline\n}\n.user-finder-container .user-finder-input,.user-finder-container .search-button{height:29px\n}\n.user-finder-container .user-finder-input{max-width:calc(100% - 30px - 30px - 20px)\n}\n.user-finder-container .search-button{margin-left:.5em;margin-right:.5em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/user_finder/user_finder.vue","\n.who-to-follow *{vertical-align:middle\n}\n.who-to-follow img{width:32px;height:32px\n}\n.who-to-follow{padding:0.5em 1em 0.5em 1em;margin:0px;line-height:40px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/who_to_follow_panel/who_to_follow_panel.vue","\n.media-modal-view:hover .modal-view-button-arrow{opacity:0.75\n}\n.media-modal-view:hover .modal-view-button-arrow:focus,.media-modal-view:hover .modal-view-button-arrow:hover{outline:none;box-shadow:none\n}\n.media-modal-view:hover .modal-view-button-arrow:hover{opacity:1\n}\n.modal-image{max-width:90%;max-height:90%;box-shadow:0px 5px 15px 0 rgba(0,0,0,0.5)\n}\n.modal-view-button-arrow{position:absolute;display:block;top:50%;margin-top:-50px;width:70px;height:100px;border:0;padding:0;opacity:0;box-shadow:none;background:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;overflow:visible;cursor:pointer;transition:opacity 333ms cubic-bezier(0.4, 0, 0.22, 1)\n}\n.modal-view-button-arrow .arrow-icon{position:absolute;top:35px;height:30px;width:32px;font-size:14px;line-height:30px;color:#FFF;text-align:center;background-color:rgba(0,0,0,0.3)\n}\n.modal-view-button-arrow--prev{left:0\n}\n.modal-view-button-arrow--prev .arrow-icon{left:6px\n}\n.modal-view-button-arrow--next{right:0\n}\n.modal-view-button-arrow--next .arrow-icon{right:6px\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/media_modal/media_modal.vue","\n.side-drawer-container{position:fixed;z-index:1000;top:0;left:0;width:100%;height:100%;display:-ms-flexbox;display:flex;-ms-flex-align:stretch;align-items:stretch;transition-duration:0s;transition-property:transform\n}\n.side-drawer-container-open{transform:translate(0%)\n}\n.side-drawer-container-closed{transition-delay:0.35s;transform:translate(-100%)\n}\n.side-drawer-darken{top:0;left:0;width:100vw;height:100vh;position:fixed;z-index:-1;transition:0.35s;transition-property:background-color;background-color:rgba(0,0,0,0.5)\n}\n.side-drawer-darken-closed{background-color:transparent\n}\n.side-drawer-click-outside{-ms-flex:1 1 100%;flex:1 1 100%\n}\n.side-drawer{overflow-x:hidden;transition-timing-function:cubic-bezier(0, 1, 0.5, 1);transition:0.35s;transition-property:transform;margin:0 0 0 -100px;padding:0 0 1em 100px;width:80%;max-width:20em;-ms-flex:0 0 80%;flex:0 0 80%;box-shadow:1px 1px 4px rgba(0,0,0,0.6);box-shadow:var(--panelShadow);background-color:#121a24;background-color:var(--bg, #121a24)\n}\n.side-drawer-logo-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0.85em\n}\n.side-drawer-logo-wrapper img{-ms-flex:none;flex:none;height:50px;margin-right:0.85em\n}\n.side-drawer-logo-wrapper span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap\n}\n.side-drawer-click-outside-closed{-ms-flex:0 0 0px;flex:0 0 0\n}\n.side-drawer-closed{transform:translate(-100%)\n}\n.side-drawer-heading{background:transparent;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch;display:-ms-flexbox;display:flex;padding:0;margin:0\n}\n.side-drawer ul{list-style:none;margin:0;padding:0;border-bottom:1px solid;border-color:#222;border-color:var(--border, #222);margin:0.2em 0\n}\n.side-drawer ul:last-child{border:0\n}\n.side-drawer li{padding:0\n}\n.side-drawer li a{display:block;padding:0.5em 0.85em\n}\n.side-drawer li a:hover{background-color:#151e2a;background-color:var(--lightBg, #151e2a)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/side_drawer/side_drawer.vue","\n.post-form-modal-view{max-height:100%;display:block\n}\n.post-form-modal-panel{-ms-flex-negative:0;flex-shrink:0;margin:25% 0 4em 0;width:100%\n}\n.new-status-button{width:5em;height:5em;border-radius:100%;position:fixed;bottom:1.5em;right:1.5em;background-color:#182230;background-color:var(--btn, #182230);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;box-shadow:0px 2px 2px rgba(0,0,0,0.3),0px 4px 6px rgba(0,0,0,0.3);z-index:10;transition:0.35s transform;transition-timing-function:cubic-bezier(0, 1, 0.5, 1)\n}\n.new-status-button.hidden{transform:translateY(150%)\n}\n.new-status-button i{font-size:1.5em;color:#b9b9ba;color:var(--text, #b9b9ba)\n}\n@media all and (min-width: 801px){\n.new-status-button{display:none\n}\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/mobile_post_status_modal/mobile_post_status_modal.vue","\n.mobile-inner-nav{width:100%;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center\n}\n.mobile-nav-button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;width:50px;position:relative;cursor:pointer\n}\n.alert-dot{border-radius:100%;height:8px;width:8px;position:absolute;left:calc(50% - 4px);top:calc(50% - 4px);margin-left:6px;margin-top:-6px;background-color:red;background-color:var(--badgeNotification, red)\n}\n.mobile-notifications-drawer{width:100%;height:100vh;overflow-x:hidden;position:fixed;top:0;left:0;box-shadow:1px 1px 4px rgba(0,0,0,0.6);box-shadow:var(--panelShadow);transition-property:transform;transition-duration:0.25s;transform:translateX(0)\n}\n.mobile-notifications-drawer.closed{transform:translateX(100%)\n}\n.mobile-notifications-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;z-index:1;width:100%;height:50px;line-height:50px;position:absolute;color:var(--topBarText);background-color:#182230;background-color:var(--topBar, #182230);box-shadow:0px 0px 4px rgba(0,0,0,0.6);box-shadow:var(--topBarShadow)\n}\n.mobile-notifications-header .title{font-size:1.3em;margin-left:0.6em\n}\n.mobile-notifications{margin-top:50px;width:100vw;height:calc(100vh - 50px);overflow-x:hidden;overflow-y:scroll;color:#b9b9ba;color:var(--text, #b9b9ba);background-color:#121a24;background-color:var(--bg, #121a24)\n}\n.mobile-notifications .notifications{padding:0;border-radius:0;box-shadow:none\n}\n.mobile-notifications .notifications .panel{border-radius:0;margin:0;box-shadow:none\n}\n.mobile-notifications .notifications .panel:after{border-radius:0\n}\n.mobile-notifications .notifications .panel .panel-heading{border-radius:0;box-shadow:none\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/mobile_nav/mobile_nav.vue"],"sourceRoot":""} \ No newline at end of file diff --git a/priv/static/static/css/app.ea66966b753e709d7ce58f910a2c003e.css b/priv/static/static/css/app.ea66966b753e709d7ce58f910a2c003e.css deleted file mode 100644 index 7cd3bda40..000000000 Binary files a/priv/static/static/css/app.ea66966b753e709d7ce58f910a2c003e.css and /dev/null differ diff --git a/priv/static/static/css/app.ea66966b753e709d7ce58f910a2c003e.css.map b/priv/static/static/css/app.ea66966b753e709d7ce58f910a2c003e.css.map deleted file mode 100644 index 94e03d028..000000000 --- a/priv/static/static/css/app.ea66966b753e709d7ce58f910a2c003e.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///webpack:///src/components/timeline/timeline.vue","webpack:///webpack:///src/components/status/status.vue","webpack:///webpack:///src/components/attachment/attachment.vue","webpack:///webpack:///src/components/still-image/still-image.vue","webpack:///webpack:///src/components/favorite_button/favorite_button.vue","webpack:///webpack:///src/components/retweet_button/retweet_button.vue","webpack:///webpack:///src/components/delete_button/delete_button.vue","webpack:///webpack:///src/components/post_status_form/post_status_form.vue","webpack:///webpack:///src/components/media_upload/media_upload.vue","webpack:///webpack:///src/components/user_card/user_card.vue","webpack:///webpack:///src/components/user_avatar/user_avatar.vue","webpack:///webpack:///src/components/gallery/gallery.vue","webpack:///webpack:///src/components/link-preview/link-preview.vue","webpack:///webpack:///src/components/status_or_conversation/status_or_conversation.vue","webpack:///webpack:///src/components/user_profile/user_profile.vue","webpack:///webpack:///src/components/follow_card/follow_card.vue","webpack:///webpack:///src/components/basic_user_card/basic_user_card.vue","webpack:///webpack:///src/hocs/with_load_more/src/hocs/with_load_more/with_load_more.scss","webpack:///webpack:///src/hocs/with_list/src/hocs/with_list/with_list.scss","webpack:///webpack:///src/components/settings/settings.vue","webpack:///webpack:///src/components/tab_switcher/src/components/tab_switcher/tab_switcher.scss","webpack:///webpack:///src/components/style_switcher/style_switcher.scss","webpack:///webpack:///src/components/color_input/color_input.vue","webpack:///webpack:///src/components/shadow_control/shadow_control.vue","webpack:///webpack:///src/components/font_control/font_control.vue","webpack:///webpack:///src/components/contrast_ratio/contrast_ratio.vue","webpack:///webpack:///src/components/export_import/export_import.vue","webpack:///webpack:///src/components/registration/registration.vue","webpack:///webpack:///src/components/user_settings/user_settings.vue","webpack:///webpack:///src/components/image_cropper/image_cropper.vue","webpack:///webpack:///~/cropperjs/dist/cropper.css","webpack:///webpack:///src/components/block_card/block_card.vue","webpack:///webpack:///src/hocs/with_subscription/src/hocs/with_subscription/with_subscription.scss","webpack:///webpack:///src/components/follow_request_card/follow_request_card.vue","webpack:///webpack:///src/components/user_search/user_search.vue","webpack:///webpack:///src/components/notifications/notifications.scss","webpack:///webpack:///src/components/login_form/login_form.vue","webpack:///webpack:///src/components/chat_panel/chat_panel.vue","webpack:///webpack:///src/components/features_panel/features_panel.vue","webpack:///webpack:///src/components/terms_of_service_panel/terms_of_service_panel.vue","webpack:///webpack:///src/App.scss","webpack:///webpack:///src/components/nav_panel/nav_panel.vue","webpack:///webpack:///src/components/user_finder/user_finder.vue","webpack:///webpack:///src/components/who_to_follow_panel/who_to_follow_panel.vue","webpack:///webpack:///src/components/media_modal/media_modal.vue","webpack:///webpack:///src/components/side_drawer/side_drawer.vue","webpack:///webpack:///src/components/mobile_post_status_modal/mobile_post_status_modal.vue"],"names":[],"mappings":"AACA,yBAAyB,SAAS,CAElC,yBAAyB,kBAAkB,gBAAgB,gBAAgB,qBAAuB,mBAAmB,gCAAiC,aAAa,UAAU,yBAAyB,qCAAsC,CCF5O,aAAa,WAAW,OAAO,WAAW,CAE1C,0BAA8D,kBAAkB,mCAAgC,CAEhH,0BAA0B,kBAAkB,cAAc,CAE1D,gBAAgB,kBAAkB,cAAc,oBAAoB,aAAa,yBAAyB,mCAAoC,kBAAkB,oCAAqE,kBAAkB,uCAAwC,sCAAuC,8BAA8B,iBAAkB,iBAAkB,UAAU,CAElZ,wBAAwB,WAAW,OAAO,SAAS,cAAc,CAEjE,wBAAwB,cAAc,eAAe,YAAY,kBAAkB,iBAAiB,kBAAkB,CAEtH,0BAA0B,aAAa,CAEvC,YAAY,kBAAkB,CAE9B,WAAW,qBAAqB,iBAAiB,aAAa,yBAAyB,qBAAqB,sBAAsB,oBAAsB,YAAY,kBAAkB,gCAAiC,oBAAoB,+BAAgC,CAE3Q,mBAAmB,yBAAyB,uCAAwC,CAEpF,qBAAqB,wBAAwB,yBAAyB,CAEtE,uBAAuB,WAAW,OAAO,SAAS,CAElD,4BAA4B,mBAAmB,CAE/C,sBAAsB,mBAAmB,eAAe,gBAAgB,oBAAoB,cAAc,cAAc,eAAgB,CAExI,0BAA0B,WAAW,YAAY,sBAAsB,kBAAkB,CAEzF,0BAA0B,UAAU,sBAAsB,6BAA6B,gBAAgB,kBAAmB,CAE1H,4BAA4B,qBA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B,iDAAqD,CAErb,0BAA0B,0BAA0B,CAEpD,qBAAqB,gBAAgB,cAAc,yBAA0B,CAE7E,yBACA,mBAAmB,YAAY,CAC9B","file":"static/css/app.ea66966b753e709d7ce58f910a2c003e.css","sourcesContent":["\n.timeline .loadmore-text{opacity:1\n}\n.new-status-notification{position:relative;margin-top:-1px;font-size:1.1em;border-width:1px 0 0 0;border-style:solid;border-color:var(--border, #222);padding:10px;z-index:1;background-color:#182230;background-color:var(--panel, #182230)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/timeline/timeline.vue","\n.status-body{-ms-flex:1;flex:1;min-width:0\n}\n.status-preview.status-el{border-style:solid;border-width:1px;border-color:#222;border-color:var(--border, #222)\n}\n.status-preview-container{position:relative;max-width:100%\n}\n.status-preview{position:absolute;max-width:95%;display:-ms-flexbox;display:flex;background-color:#121a24;background-color:var(--bg, #121a24);border-color:#222;border-color:var(--border, #222);border-style:solid;border-width:1px;border-radius:5px;border-radius:var(--tooltipRadius, 5px);box-shadow:2px 2px 3px rgba(0,0,0,0.5);box-shadow:var(--popupShadow);margin-top:0.25em;margin-left:0.5em;z-index:50\n}\n.status-preview .status{-ms-flex:1;flex:1;border:0;min-width:15em\n}\n.status-preview-loading{display:block;min-width:15em;padding:1em;text-align:center;border-width:1px;border-style:solid\n}\n.status-preview-loading i{font-size:2em\n}\n.media-left{margin-right:.75em\n}\n.status-el{-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;border-left-width:0px;min-width:0;border-color:#222;border-color:var(--border, #222);border-left:4px red;border-left:4px var(--cRed, red)\n}\n.status-el_focused{background-color:#151e2a;background-color:var(--lightBg, #151e2a)\n}\n.timeline .status-el{border-bottom-width:1px;border-bottom-style:solid\n}\n.status-el .media-body{-ms-flex:1;flex:1;padding:0\n}\n.status-el .status-usercard{margin-bottom:.75em\n}\n.status-el .user-name{white-space:nowrap;font-size:14px;overflow:hidden;-ms-flex-negative:0;flex-shrink:0;max-width:85%;font-weight:bold\n}\n.status-el .user-name img{width:14px;height:14px;vertical-align:middle;object-fit:contain\n}\n.status-el .media-heading{padding:0;vertical-align:bottom;-ms-flex-preferred-size:100%;flex-basis:100%;margin-bottom:0.5em\n}\n.status-el .media-heading a{display:inline-block;word-break:break-all\n}\n.status-el .media-heading small{font-weight:lighter\n}\n.status-el .media-heading .heading-name-row{padding:0;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;line-height:18px\n}\n.status-el .media-heading .heading-name-row .name-and-account-name{display:-ms-flexbox;display:flex;min-width:0\n}\n.status-el .media-heading .heading-name-row .user-name{-ms-flex-negative:1;flex-shrink:1;margin-right:0.4em;overflow:hidden;text-overflow:ellipsis\n}\n.status-el .media-heading .heading-name-row .account-name{min-width:1.6em;margin-right:0.4em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-ms-flex:1 1 0px;flex:1 1 0\n}\n.status-el .media-heading .heading-right{display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0\n}\n.status-el .media-heading .timeago{margin-right:0.2em\n}\n.status-el .media-heading .heading-reply-row{-ms-flex-line-pack:baseline;align-content:baseline;font-size:12px;line-height:18px;max-width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:stretch;align-items:stretch\n}\n.status-el .media-heading .heading-reply-row a{max-width:100%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap\n}\n.status-el .media-heading .reply-to-and-accountname{display:-ms-flexbox;display:flex;height:18px;margin-right:0.5em;overflow:hidden;max-width:100%\n}\n.status-el .media-heading .reply-to-and-accountname .icon-reply{transform:scaleX(-1)\n}\n.status-el .media-heading .reply-info{display:-ms-flexbox;display:flex\n}\n.status-el .media-heading .reply-to{display:-ms-flexbox;display:flex\n}\n.status-el .media-heading .reply-to-text{overflow:hidden;text-overflow:ellipsis;margin:0 0.4em 0 0.2em\n}\n.status-el .media-heading .replies-separator{margin-left:0.4em\n}\n.status-el .media-heading .replies{line-height:18px;font-size:12px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.status-el .media-heading .replies>*{margin-right:0.4em\n}\n.status-el .media-heading .reply-link{height:17px\n}\n.status-el .tall-status{position:relative;height:220px;overflow-x:hidden;overflow-y:hidden\n}\n.status-el .tall-status-hider{display:inline-block;word-break:break-all;position:absolute;height:70px;margin-top:150px;width:100%;text-align:center;line-height:110px;background:linear-gradient(to bottom, transparent, #121a24 80%);background:linear-gradient(to bottom, transparent, var(--bg, #121a24) 80%)\n}\n.status-el .tall-status-hider_focused{background:linear-gradient(to bottom, transparent, #151e2a 80%);background:linear-gradient(to bottom, transparent, var(--lightBg, #151e2a) 80%)\n}\n.status-el .status-unhider,.status-el .cw-status-hider{width:100%;text-align:center;display:inline-block;word-break:break-all\n}\n.status-el .status-content{font-family:var(--postFont, sans-serif);line-height:1.4em\n}\n.status-el .status-content img,.status-el .status-content video{max-width:100%;max-height:400px;vertical-align:middle;object-fit:contain\n}\n.status-el .status-content img.emoji,.status-el .status-content video.emoji{width:32px;height:32px\n}\n.status-el .status-content blockquote{margin:0.2em 0 0.2em 2em;font-style:italic\n}\n.status-el .status-content pre{overflow:auto\n}\n.status-el .status-content code,.status-el .status-content samp,.status-el .status-content kbd,.status-el .status-content var,.status-el .status-content pre{font-family:var(--postCodeFont, monospace)\n}\n.status-el .status-content p{margin:0 0 1em 0\n}\n.status-el .status-content p:last-child{margin:0 0 0 0\n}\n.status-el .status-content h1{font-size:1.1em;line-height:1.2em;margin:1.4em 0\n}\n.status-el .status-content h2{font-size:1.1em;margin:1.0em 0\n}\n.status-el .status-content h3{font-size:1em;margin:1.2em 0\n}\n.status-el .status-content h4{margin:1.1em 0\n}\n.status-el .retweet-info{padding:0.4em .75em;margin:0\n}\n.status-el .retweet-info .avatar.still-image{border-radius:10px;border-radius:var(--avatarAltRadius, 10px);margin-left:28px;width:20px;height:20px\n}\n.status-el .retweet-info .media-body{font-size:1em;line-height:22px;display:-ms-flexbox;display:flex;-ms-flex-line-pack:center;align-content:center;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.status-el .retweet-info .media-body .user-name{font-weight:bold;overflow:hidden;text-overflow:ellipsis\n}\n.status-el .retweet-info .media-body .user-name img{width:14px;height:14px;vertical-align:middle;object-fit:contain\n}\n.status-el .retweet-info .media-body i{padding:0 0.2em\n}\n.status-el .retweet-info .media-body a{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap\n}\n.status-fadein{animation-duration:0.4s;animation-name:fadein\n}\n@keyframes fadein{\nfrom{opacity:0\n}\nto{opacity:1\n}\n}\n.greentext{color:green\n}\n.status-conversation{border-left-style:solid\n}\n.status-actions{width:100%;display:-ms-flexbox;display:flex;margin-top:.75em\n}\n.status-actions div,.status-actions favorite-button{max-width:4em;-ms-flex:1;flex:1\n}\n.icon-reply:hover{color:#0095ff;color:var(--cBlue, #0095ff)\n}\n.icon-reply.icon-reply-active{color:#0095ff;color:var(--cBlue, #0095ff)\n}\n.status:hover .animated.avatar canvas{display:none\n}\n.status:hover .animated.avatar img{visibility:visible\n}\n.status{display:-ms-flexbox;display:flex;padding:.75em\n}\n.status.is-retweet{padding-top:0\n}\n.status-conversation:last-child{border-bottom:none\n}\n.muted{padding:0.25em 0.5em\n}\n.muted button{margin-left:auto\n}\n.muted .muteWords{margin-left:10px\n}\na.unmute{display:block;margin-left:auto\n}\n.reply-left{-ms-flex:0;flex:0;min-width:48px\n}\n.reply-body{-ms-flex:1;flex:1\n}\n.timeline>.status-el:last-child{border-radius:0 0 10px 10px;border-radius:0 0 var(--panelRadius, 10px) var(--panelRadius, 10px);border-bottom:none\n}\n@media all and (max-width: 800px){\n.status-el .retweet-info .avatar.still-image{margin-left:20px\n}\n.status{max-width:100%\n}\n.status .avatar.still-image{width:40px;height:40px\n}\n.status .avatar.still-image.avatar-compact{width:32px;height:32px\n}\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/status/status.vue","\n.attachments{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.attachments .attachment.media-upload-container{-ms-flex:0 0 auto;flex:0 0 auto;max-height:200px;max-width:100%;display:-ms-flexbox;display:flex\n}\n.attachments .attachment.media-upload-container video{max-width:100%\n}\n.attachments .placeholder{margin-right:8px;margin-bottom:4px\n}\n.attachments .nsfw-placeholder{cursor:pointer\n}\n.attachments .nsfw-placeholder.loading{cursor:progress\n}\n.attachments .attachment{position:relative;margin-top:0.5em;-ms-flex-item-align:start;align-self:flex-start;line-height:0;border-style:solid;border-width:1px;border-radius:10px;border-radius:var(--attachmentRadius, 10px);border-color:#222;border-color:var(--border, #222);overflow:hidden\n}\n.attachments .non-gallery.attachment.video{-ms-flex:1 0 40%;flex:1 0 40%\n}\n.attachments .non-gallery.attachment .nsfw{height:260px\n}\n.attachments .non-gallery.attachment .small{height:120px;-ms-flex-positive:0;flex-grow:0\n}\n.attachments .non-gallery.attachment .video{height:260px;display:-ms-flexbox;display:flex\n}\n.attachments .non-gallery.attachment video{max-height:100%;object-fit:contain\n}\n.attachments .fullwidth{-ms-flex-preferred-size:100%;flex-basis:100%\n}\n.attachments.video{line-height:0\n}\n.attachments .video-container{display:-ms-flexbox;display:flex;max-height:100%\n}\n.attachments .video{width:100%\n}\n.attachments .play-icon{position:absolute;font-size:64px;top:calc(50% - 32px);left:calc(50% - 32px);color:rgba(255,255,255,0.75);text-shadow:0 0 2px rgba(0,0,0,0.4)\n}\n.attachments .play-icon::before{margin:0\n}\n.attachments.html{-ms-flex-preferred-size:90%;flex-basis:90%;width:100%;display:-ms-flexbox;display:flex\n}\n.attachments .hider{position:absolute;right:0;white-space:nowrap;margin:10px;padding:5px;background:rgba(230,230,230,0.6);font-weight:bold;z-index:4;line-height:1;border-radius:5px;border-radius:var(--tooltipRadius, 5px)\n}\n.attachments video{z-index:0\n}\n.attachments audio{width:100%\n}\n.attachments img.media-upload{line-height:0;max-height:200px;max-width:100%\n}\n.attachments .oembed{line-height:1.2em;-ms-flex:1 0 100%;flex:1 0 100%;width:100%;margin-right:15px;display:-ms-flexbox;display:flex\n}\n.attachments .oembed img{width:100%\n}\n.attachments .oembed .image{-ms-flex:1;flex:1\n}\n.attachments .oembed .image img{border:0px;border-radius:5px;height:100%;object-fit:cover\n}\n.attachments .oembed .text{-ms-flex:2;flex:2;margin:8px;word-break:break-all\n}\n.attachments .oembed .text h1{font-size:14px;margin:0px\n}\n.attachments .image-attachment{width:100%;height:100%\n}\n.attachments .image-attachment.hidden{display:none\n}\n.attachments .image-attachment .nsfw{object-fit:cover;width:100%;height:100%\n}\n.attachments .image-attachment img{image-orientation:from-image\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/attachment/attachment.vue","\n.still-image{position:relative;line-height:0;overflow:hidden;width:100%;height:100%\n}\n.still-image:hover canvas{display:none\n}\n.still-image img{width:100%;height:100%;object-fit:contain\n}\n.still-image.animated:hover::before,.still-image.animated img{visibility:hidden\n}\n.still-image.animated:hover img{visibility:visible\n}\n.still-image.animated::before{content:'gif';position:absolute;line-height:10px;font-size:10px;top:5px;left:5px;background:rgba(127,127,127,0.5);color:#FFF;display:block;padding:2px 4px;border-radius:5px;border-radius:var(--tooltipRadius, 5px);z-index:2\n}\n.still-image canvas{position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:100%;object-fit:contain\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/still-image/still-image.vue","\n.fav-active{cursor:pointer;animation-duration:0.6s\n}\n.fav-active:hover{color:orange;color:var(--cOrange, orange)\n}\n.favorite-button.icon-star{color:orange;color:var(--cOrange, orange)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/favorite_button/favorite_button.vue","\n.rt-active{cursor:pointer;animation-duration:0.6s\n}\n.rt-active:hover{color:#0fa00f;color:var(--cGreen, #0fa00f)\n}\n.icon-retweet.retweeted{color:#0fa00f;color:var(--cGreen, #0fa00f)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/retweet_button/retweet_button.vue","\n.icon-cancel,.delete-status{cursor:pointer\n}\n.icon-cancel:hover,.delete-status:hover{color:red;color:var(--cRed, red)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/delete_button/delete_button.vue","\n.tribute-container ul{padding:0px\n}\n.tribute-container ul li{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center\n}\n.tribute-container img{padding:3px;width:16px;height:16px;border-radius:10px;border-radius:var(--avatarAltRadius, 10px)\n}\n.post-status-form .visibility-tray{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-direction:row-reverse;flex-direction:row-reverse\n}\n.post-status-form .form-bottom,.login .form-bottom{display:-ms-flexbox;display:flex;padding:0.5em;height:32px\n}\n.post-status-form .form-bottom button,.login .form-bottom button{width:10em\n}\n.post-status-form .form-bottom p,.login .form-bottom p{margin:0.35em;padding:0.35em;display:-ms-flexbox;display:flex\n}\n.post-status-form .error,.login .error{text-align:center\n}\n.post-status-form .media-upload-wrapper,.login .media-upload-wrapper{-ms-flex:0 0 auto;flex:0 0 auto;max-width:100%;min-width:50px;margin-right:.2em;margin-bottom:.5em\n}\n.post-status-form .media-upload-wrapper .icon-cancel,.login .media-upload-wrapper .icon-cancel{display:inline-block;position:static;margin:0;padding-bottom:0;margin-left:10px;margin-left:var(--attachmentRadius, 10px);background-color:#182230;background-color:var(--btn, #182230);border-bottom-left-radius:0;border-bottom-right-radius:0\n}\n.post-status-form .attachments,.login .attachments{padding:0 0.5em\n}\n.post-status-form .attachments .attachment,.login .attachments .attachment{margin:0;position:relative;-ms-flex:0 0 auto;flex:0 0 auto;border:1px solid #222;border:1px solid var(--border, #222);text-align:center\n}\n.post-status-form .attachments .attachment audio,.login .attachments .attachment audio{min-width:300px;-ms-flex:1 0 auto;flex:1 0 auto\n}\n.post-status-form .attachments .attachment a,.login .attachments .attachment a{display:block;text-align:left;line-height:1.2;padding:.5em\n}\n.post-status-form .attachments i,.login .attachments i{position:absolute;margin:10px;padding:5px;background:rgba(230,230,230,0.6);border-radius:10px;border-radius:var(--attachmentRadius, 10px);font-weight:bold\n}\n.post-status-form .btn,.login .btn{cursor:pointer\n}\n.post-status-form .btn[disabled],.login .btn[disabled]{cursor:not-allowed\n}\n.post-status-form form,.login form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:0.6em\n}\n.post-status-form .form-group,.login .form-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:0.3em 0.5em 0.6em;line-height:24px\n}\n.post-status-form form textarea.form-cw,.login form textarea.form-cw{line-height:16px;resize:none;overflow:hidden;transition:min-height 200ms 100ms;min-height:1px\n}\n.post-status-form form textarea.form-control,.login form textarea.form-control{line-height:16px;resize:none;overflow:hidden;transition:min-height 200ms 100ms;min-height:1px;box-sizing:content-box\n}\n.post-status-form form textarea.form-control:focus,.login form textarea.form-control:focus{min-height:48px\n}\n.post-status-form .btn,.login .btn{cursor:pointer\n}\n.post-status-form .btn[disabled],.login .btn[disabled]{cursor:not-allowed\n}\n.post-status-form .icon-cancel,.login .icon-cancel{cursor:pointer;z-index:4\n}\n.post-status-form .autocomplete-panel,.login .autocomplete-panel{margin:0 0.5em 0 0.5em;border-radius:5px;border-radius:var(--tooltipRadius, 5px);position:absolute;z-index:1;box-shadow:1px 2px 4px rgba(0,0,0,0.5);box-shadow:var(--popupShadow);min-width:75%;background:#121a24;background:var(--bg, #121a24);color:#b9b9ba;color:var(--lightText, #b9b9ba)\n}\n.post-status-form .autocomplete,.login .autocomplete{cursor:pointer;padding:0.2em 0.4em 0.2em 0.4em;border-bottom:1px solid rgba(0,0,0,0.4);display:-ms-flexbox;display:flex\n}\n.post-status-form .autocomplete img,.login .autocomplete img{width:24px;height:24px;border-radius:4px;border-radius:var(--avatarRadius, 4px);object-fit:contain\n}\n.post-status-form .autocomplete span,.login .autocomplete span{line-height:24px;margin:0 0.1em 0 0.2em\n}\n.post-status-form .autocomplete small,.login .autocomplete small{margin-left:.5em;color:rgba(185,185,186,0.5);color:var(--faint, rgba(185,185,186,0.5))\n}\n.post-status-form .autocomplete.highlighted,.login .autocomplete.highlighted{background-color:#182230;background-color:var(--lightBg, #182230)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/post_status_form/post_status_form.vue","\n.media-upload {\n font-size: 26px;\n -ms-flex: 1;\n flex: 1;\n}\n.icon-upload {\n cursor: pointer;\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/media_upload/media_upload.vue","\n.user-card{background-size:cover;overflow:hidden\n}\n.user-card .panel-heading{padding:.5em 0;text-align:center;box-shadow:none;background:transparent;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch\n}\n.user-card .panel-body{word-wrap:break-word;background:linear-gradient(to bottom, transparent, #121a24 80%);background:linear-gradient(to bottom, transparent, var(--bg, #121a24) 80%)\n}\n.user-card p{margin-bottom:0\n}\n.user-card-bio{text-align:center\n}\n.user-card-bio img{object-fit:contain;vertical-align:middle;max-width:100%;max-height:400px\n}\n.user-card-bio img .emoji{width:32px;height:32px\n}\n.user-card-rounded-t{border-top-left-radius:10px;border-top-left-radius:var(--panelRadius, 10px);border-top-right-radius:10px;border-top-right-radius:var(--panelRadius, 10px)\n}\n.user-card-rounded{border-radius:10px;border-radius:var(--panelRadius, 10px)\n}\n.user-card-bordered{border-width:1px;border-style:solid;border-color:#222;border-color:var(--border, #222)\n}\n.user-info{color:#b9b9ba;color:var(--lightText, #b9b9ba);padding:0 26px\n}\n.user-info .container{padding:16px 0 6px;display:-ms-flexbox;display:flex;max-height:56px\n}\n.user-info .container .avatar{-ms-flex:1 0 100%;flex:1 0 100%;width:56px;height:56px;box-shadow:0px 1px 8px rgba(0,0,0,0.75);box-shadow:var(--avatarShadow);object-fit:cover\n}\n.user-info:hover .animated.avatar canvas{display:none\n}\n.user-info:hover .animated.avatar img{visibility:visible\n}\n.user-info .usersettings{color:#b9b9ba;color:var(--lightText, #b9b9ba);opacity:.8\n}\n.user-info .name-and-screen-name{display:block;margin-left:0.6em;text-align:left;text-overflow:ellipsis;white-space:nowrap;-ms-flex:1 1 0px;flex:1 1 0;z-index:1\n}\n.user-info .name-and-screen-name img{width:26px;height:26px;vertical-align:middle;object-fit:contain\n}\n.user-info .name-and-screen-name .top-line{display:-ms-flexbox;display:flex\n}\n.user-info .user-name{text-overflow:ellipsis;overflow:hidden;-ms-flex:1 1 auto;flex:1 1 auto;margin-right:1em;font-size:15px\n}\n.user-info .user-name img{object-fit:contain;height:16px;width:16px;vertical-align:middle\n}\n.user-info .user-screen-name{color:#b9b9ba;color:var(--lightText, #b9b9ba);display:inline-block;font-weight:light;font-size:15px;padding-right:0.1em;width:100%;display:-ms-flexbox;display:flex\n}\n.user-info .user-screen-name .dailyAvg{min-width:1px;-ms-flex:0 0 auto;flex:0 0 auto;margin-left:1em;font-size:0.7em;color:#b9b9ba;color:var(--text, #b9b9ba)\n}\n.user-info .user-screen-name .handle{min-width:1px;-ms-flex:0 1 auto;flex:0 1 auto;text-overflow:ellipsis;overflow:hidden\n}\n.user-info .user-screen-name .staff{text-transform:capitalize;color:#b9b9ba;color:var(--btnText, #b9b9ba);background-color:#182230;background-color:var(--btn, #182230)\n}\n.user-info .user-meta{margin-bottom:.15em;display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;font-size:14px;line-height:22px;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.user-info .user-meta .following{-ms-flex:1 0 auto;flex:1 0 auto;margin:0;margin-bottom:.25em;text-align:left\n}\n.user-info .user-meta .highlighter{-ms-flex:0 1 auto;flex:0 1 auto;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-.5em;-ms-flex-item-align:start;align-self:start\n}\n.user-info .user-meta .highlighter .userHighlightCl{padding:2px 10px;-ms-flex:1 0 auto;flex:1 0 auto\n}\n.user-info .user-meta .highlighter .userHighlightSel,.user-info .user-meta .highlighter .userHighlightSel.select{padding-top:0;padding-bottom:0;-ms-flex:1 0 auto;flex:1 0 auto\n}\n.user-info .user-meta .highlighter .userHighlightSel.select i{line-height:22px\n}\n.user-info .user-meta .highlighter .userHighlightText{width:70px;-ms-flex:1 0 auto;flex:1 0 auto\n}\n.user-info .user-meta .highlighter .userHighlightCl,.user-info .user-meta .highlighter .userHighlightText,.user-info .user-meta .highlighter .userHighlightSel,.user-info .user-meta .highlighter .userHighlightSel.select{height:22px;vertical-align:top;margin-right:.5em;margin-bottom:.25em\n}\n.user-info .user-interactions{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-pack:justify;justify-content:space-between;margin-right:-.75em\n}\n.user-info .user-interactions div{-ms-flex:1 0 0px;flex:1 0 0;margin-right:.75em;margin-bottom:.6em;white-space:nowrap\n}\n.user-info .user-interactions .mute{max-width:220px;min-height:28px\n}\n.user-info .user-interactions .remote-follow{max-width:220px;min-height:28px\n}\n.user-info .user-interactions .follow{max-width:220px;min-height:28px\n}\n.user-info .user-interactions button{width:100%;height:100%;margin:0\n}\n.user-info .user-interactions .remote-button{height:28px !important;width:92%\n}\n.user-info .user-interactions .pressed{border-bottom-color:rgba(255,255,255,0.2);border-top-color:rgba(0,0,0,0.2)\n}\n.user-counts{display:-ms-flexbox;display:flex;line-height:16px;padding:.5em 1.5em 0em 1.5em;text-align:center;-ms-flex-pack:justify;justify-content:space-between;color:#b9b9ba;color:var(--lightText, #b9b9ba);-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.user-count{-ms-flex:1 0 auto;flex:1 0 auto;padding:.5em 0 .5em 0;margin:0 .5em\n}\n.user-count h5{font-size:1em;font-weight:bolder;margin:0 0 0.25em\n}\n.user-count a{text-decoration:none\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/user_card/user_card.vue","\n.avatar.still-image{width:48px;height:48px;box-shadow:var(--avatarStatusShadow);border-radius:4px;border-radius:var(--avatarRadius, 4px)\n}\n.avatar.still-image img{width:100%;height:100%\n}\n.avatar.still-image.better-shadow{box-shadow:var(--avatarStatusShadowInset);filter:var(--avatarStatusShadowFilter)\n}\n.avatar.still-image.animated::before{display:none\n}\n.avatar.still-image.avatar-compact{width:32px;height:32px;border-radius:10px;border-radius:var(--avatarAltRadius, 10px)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/user_avatar/user_avatar.vue","\n.gallery-row{height:200px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-line-pack:stretch;align-content:stretch;-ms-flex-positive:1;flex-grow:1;margin-top:0.5em\n}\n.gallery-row .attachments,.gallery-row .attachment{margin:0 0.5em 0 0;-ms-flex-positive:1;flex-grow:1;height:100%;box-sizing:border-box;min-width:2em\n}\n.gallery-row .attachments:last-child,.gallery-row .attachment:last-child{margin:0\n}\n.gallery-row .image-attachment{width:100%;height:100%\n}\n.gallery-row .video-container{height:100%\n}\n.gallery-row.contain-fit img,.gallery-row.contain-fit video{object-fit:contain\n}\n.gallery-row.cover-fit img,.gallery-row.cover-fit video{object-fit:cover\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/gallery/gallery.vue","\n.link-preview-card{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;cursor:pointer;overflow:hidden;margin-top:0.5em;color:#b9b9ba;color:var(--text, #b9b9ba);border-style:solid;border-width:1px;border-radius:10px;border-radius:var(--attachmentRadius, 10px);border-color:#222;border-color:var(--border, #222)\n}\n.link-preview-card .card-image{-ms-flex-negative:0;flex-shrink:0;width:120px;max-width:25%\n}\n.link-preview-card .card-image img{width:100%;height:100%;object-fit:cover;border-radius:10px;border-radius:var(--attachmentRadius, 10px)\n}\n.link-preview-card .small-image{width:80px\n}\n.link-preview-card .card-content{max-height:100%;margin:0.5em;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column\n}\n.link-preview-card .card-host{font-size:12px\n}\n.link-preview-card .card-description{margin:0.5em 0 0 0;overflow:hidden;text-overflow:ellipsis;word-break:break-word;line-height:1.2em;max-height:calc(1.2em * 3 - 1px)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/link-preview/link-preview.vue","\n.spacer{height:1em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/status_or_conversation/status_or_conversation.vue","\n.user-profile{-ms-flex:2;flex:2;-ms-flex-preferred-size:500px;flex-basis:500px\n}\n.user-profile .userlist-placeholder{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:middle;align-items:middle;padding:2em\n}\n.user-profile .timeline-heading{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center\n}\n.user-profile .timeline-heading .loadmore-button,.user-profile .timeline-heading .alert{-ms-flex:1;flex:1\n}\n.user-profile .timeline-heading .loadmore-button{height:28px;margin:10px .6em\n}\n.user-profile .timeline-heading .title,.user-profile .timeline-heading .loadmore-text{display:none\n}\n.user-profile-placeholder .panel-body{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:middle;align-items:middle;padding:7em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/user_profile/user_profile.vue","\n.follow-card-content-container{-ms-flex-negative:0;flex-shrink:0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:wrap;flex-wrap:wrap;line-height:1.5em\n}\n.follow-card-content-container .btn{margin-top:0.5em;margin-left:auto;width:10em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/follow_card/follow_card.vue","\n.basic-user-card{display:-ms-flexbox;display:flex;-ms-flex:1 0;flex:1 0;margin:0;padding-top:0.6em;padding-right:1em;padding-bottom:0.6em;padding-left:1em;border-bottom:1px solid;border-bottom-color:#222;border-bottom-color:var(--border, #222)\n}\n.basic-user-card-collapsed-content{margin-left:0.7em;text-align:left;-ms-flex:1;flex:1;min-width:0\n}\n.basic-user-card-user-name img{object-fit:contain;height:16px;width:16px;vertical-align:middle\n}\n.basic-user-card-expanded-content{-ms-flex:1;flex:1;margin-left:0.7em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/basic_user_card/basic_user_card.vue",".with-load-more {\n &-footer {\n padding: 10px;\n text-align: center;\n\n .error {\n font-size: 14px;\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// webpack:///src/hocs/with_load_more/src/hocs/with_load_more/with_load_more.scss",".with-list {\n &-empty-content {\n text-align: center;\n padding: 10px;\n }\n}\n\n\n// WEBPACK FOOTER //\n// webpack:///src/hocs/with_list/src/hocs/with_list/with_list.scss","\n.setting-item{border-bottom:2px solid var(--fg, #182230);margin:1em 1em 1.4em;padding-bottom:1.4em\n}\n.setting-item>div{margin-bottom:.5em\n}\n.setting-item>div:last-child{margin-bottom:0\n}\n.setting-item:last-child{border-bottom:none;padding-bottom:0;margin-bottom:1em\n}\n.setting-item select{min-width:10em\n}\n.setting-item textarea{width:100%;height:100px\n}\n.setting-item .unavailable,.setting-item .unavailable i{color:var(--cRed, red);color:red\n}\n.setting-item .btn{min-height:28px;min-width:10em;padding:0 2em\n}\n.setting-item .number-input{max-width:6em\n}\n.select-multiple{display:-ms-flexbox;display:flex\n}\n.select-multiple .option-list{margin:0;padding-left:.5em\n}\n.setting-list,.option-list{list-style-type:none;padding-left:2em\n}\n.setting-list li,.option-list li{margin-bottom:0.5em\n}\n.setting-list .suboptions,.option-list .suboptions{margin-top:0.3em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/settings/settings.vue","@import '../../_variables.scss';\n\n.tab-switcher {\n .contents {\n .hidden {\n display: none;\n }\n }\n .tabs {\n display: flex;\n position: relative;\n width: 100%;\n overflow-y: hidden;\n overflow-x: auto;\n padding-top: 5px;\n box-sizing: border-box;\n\n &::after, &::before {\n display: block;\n content: '';\n flex: 1 1 auto;\n border-bottom: 1px solid;\n border-bottom-color: $fallback--border;\n border-bottom-color: var(--border, $fallback--border);\n }\n\n .tab-wrapper {\n height: 28px;\n position: relative;\n display: flex;\n flex: 0 0 auto;\n\n .tab {\n width: 100%;\n min-width: 1px;\n position: relative;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n padding: 6px 1em;\n padding-bottom: 99px;\n margin-bottom: 6px - 99px;\n white-space: nowrap;\n\n &:not(.active) {\n z-index: 4;\n\n &:hover {\n z-index: 6;\n }\n }\n\n &.active {\n background: transparent;\n z-index: 5;\n }\n }\n\n &:not(.active) {\n &::after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 7;\n border-bottom: 1px solid;\n border-bottom-color: $fallback--border;\n border-bottom-color: var(--border, $fallback--border);\n }\n }\n }\n\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/tab_switcher/src/components/tab_switcher/tab_switcher.scss","\n.style-switcher .preset-switcher{margin-right:1em\n}\n.style-switcher .style-control{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;margin-bottom:5px\n}\n.style-switcher .style-control .label{-ms-flex:1;flex:1\n}\n.style-switcher .style-control.disabled input:not(.exclude-disabled),.style-switcher .style-control.disabled select:not(.exclude-disabled){opacity:.5\n}\n.style-switcher .style-control input,.style-switcher .style-control select{min-width:3em;margin:0;-ms-flex:0;flex:0\n}\n.style-switcher .style-control input[type=color],.style-switcher .style-control select[type=color]{padding:1px;cursor:pointer;height:29px;min-width:2em;border:none;-ms-flex-item-align:stretch;-ms-grid-row-align:stretch;align-self:stretch\n}\n.style-switcher .style-control input[type=number],.style-switcher .style-control select[type=number]{min-width:5em\n}\n.style-switcher .style-control input[type=range],.style-switcher .style-control select[type=range]{-ms-flex:1;flex:1;min-width:3em\n}\n.style-switcher .style-control input[type=checkbox]+label,.style-switcher .style-control select[type=checkbox]+label{margin:6px 0\n}\n.style-switcher .style-control input:not([type=number]):not([type=text]),.style-switcher .style-control select:not([type=number]):not([type=text]){-ms-flex-item-align:start;align-self:flex-start\n}\n.style-switcher .tab-switcher{margin:0 -1em\n}\n.style-switcher .reset-container{-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.style-switcher .fonts-container,.style-switcher .reset-container,.style-switcher .apply-container,.style-switcher .radius-container,.style-switcher .color-container{display:-ms-flexbox;display:flex\n}\n.style-switcher .fonts-container,.style-switcher .radius-container{-ms-flex-direction:column;flex-direction:column\n}\n.style-switcher .color-container{-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:justify;justify-content:space-between\n}\n.style-switcher .color-container>h4{width:99%\n}\n.style-switcher .fonts-container,.style-switcher .color-container,.style-switcher .shadow-container,.style-switcher .radius-container,.style-switcher .presets-container{margin:1em 1em 0\n}\n.style-switcher .tab-header{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline;width:100%;min-height:30px;margin-bottom:1em\n}\n.style-switcher .tab-header .btn{min-width:1px;-ms-flex:0 auto;flex:0 auto;padding:0 1em\n}\n.style-switcher .tab-header p{-ms-flex:1;flex:1;margin:0;margin-right:.5em\n}\n.style-switcher .shadow-selector .override{-ms-flex:1;flex:1;margin-left:.5em\n}\n.style-switcher .shadow-selector .select-container{margin-top:-4px;margin-bottom:-3px\n}\n.style-switcher .save-load,.style-switcher .save-load-options{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:baseline;align-items:baseline;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.style-switcher .save-load .presets,.style-switcher .save-load .import-export,.style-switcher .save-load-options .presets,.style-switcher .save-load-options .import-export{margin-bottom:.5em\n}\n.style-switcher .save-load .import-export,.style-switcher .save-load-options .import-export{display:-ms-flexbox;display:flex\n}\n.style-switcher .save-load .override,.style-switcher .save-load-options .override{margin-left:.5em\n}\n.style-switcher .save-load-options{-ms-flex-wrap:wrap;flex-wrap:wrap;margin-top:.5em;-ms-flex-pack:center;justify-content:center\n}\n.style-switcher .save-load-options .keep-option{margin:0 .5em .5em;min-width:25%\n}\n.style-switcher .preview-container{border-top:1px dashed;border-bottom:1px dashed;border-color:#222;border-color:var(--border, #222);margin:1em -1em 0;padding:1em;background:var(--body-background-image);background-size:cover;background-position:50% 50%\n}\n.style-switcher .preview-container .dummy .post{font-family:var(--postFont);display:-ms-flexbox;display:flex\n}\n.style-switcher .preview-container .dummy .post .content{-ms-flex:1;flex:1\n}\n.style-switcher .preview-container .dummy .post .content h4{margin-bottom:.25em\n}\n.style-switcher .preview-container .dummy .post .content .icons{margin-top:.5em;display:-ms-flexbox;display:flex\n}\n.style-switcher .preview-container .dummy .post .content .icons i{margin-right:1em\n}\n.style-switcher .preview-container .dummy .after-post{margin-top:1em;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center\n}\n.style-switcher .preview-container .dummy .avatar,.style-switcher .preview-container .dummy .avatar-alt{background:linear-gradient(135deg, #b8e1fc 0%, #a9d2f3 10%, #90bae4 25%, #90bcea 37%, #90bff0 50%, #6ba8e5 51%, #a2daf5 83%, #bdf3fd 100%);color:black;font-family:sans-serif;text-align:center;margin-right:1em\n}\n.style-switcher .preview-container .dummy .avatar-alt{-ms-flex:0 auto;flex:0 auto;margin-left:28px;font-size:12px;min-width:20px;min-height:20px;line-height:20px;border-radius:10px;border-radius:var(--avatarAltRadius, 10px)\n}\n.style-switcher .preview-container .dummy .avatar{-ms-flex:0 auto;flex:0 auto;width:48px;height:48px;font-size:14px;line-height:48px\n}\n.style-switcher .preview-container .dummy .actions{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline\n}\n.style-switcher .preview-container .dummy .actions .checkbox{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:baseline;align-items:baseline;margin-right:1em;-ms-flex:1;flex:1\n}\n.style-switcher .preview-container .dummy .separator{margin:1em;border-bottom:1px solid;border-color:#222;border-color:var(--border, #222)\n}\n.style-switcher .preview-container .dummy .panel-heading .badge,.style-switcher .preview-container .dummy .panel-heading .alert,.style-switcher .preview-container .dummy .panel-heading .btn,.style-switcher .preview-container .dummy .panel-heading .faint{margin-left:1em;white-space:nowrap\n}\n.style-switcher .preview-container .dummy .panel-heading .faint{text-overflow:ellipsis;min-width:2em;overflow-x:hidden\n}\n.style-switcher .preview-container .dummy .panel-heading .flex-spacer{-ms-flex:1;flex:1\n}\n.style-switcher .preview-container .dummy .btn{margin-left:0;padding:0 1em;min-width:3em;min-height:30px\n}\n.style-switcher .apply-container{-ms-flex-pack:center;justify-content:center\n}\n.style-switcher .radius-item,.style-switcher .color-item{min-width:20em;margin:5px 6px 0 0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1 1 0px;flex:1 1 0\n}\n.style-switcher .radius-item.wide,.style-switcher .color-item.wide{min-width:60%\n}\n.style-switcher .radius-item:not(.wide):nth-child(2n+1),.style-switcher .color-item:not(.wide):nth-child(2n+1){margin-right:7px\n}\n.style-switcher .radius-item .color,.style-switcher .radius-item .opacity,.style-switcher .color-item .color,.style-switcher .color-item .opacity{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline\n}\n.style-switcher .radius-item{-ms-flex-preferred-size:auto;flex-basis:auto\n}\n.style-switcher .theme-radius-rn,.style-switcher .theme-color-cl{border:0;box-shadow:none;background:transparent;color:var(--faint, rgba(185,185,186,0.5));-ms-flex-item-align:stretch;-ms-grid-row-align:stretch;align-self:stretch\n}\n.style-switcher .theme-color-cl,.style-switcher .theme-radius-in,.style-switcher .theme-color-in{margin-left:4px\n}\n.style-switcher .theme-radius-in{min-width:1em\n}\n.style-switcher .theme-radius-in{max-width:7em;-ms-flex:1;flex:1\n}\n.style-switcher .theme-radius-lb{max-width:50em\n}\n.style-switcher .theme-preview-content{padding:20px\n}\n.style-switcher .btn{margin-left:.25em;margin-right:.25em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/style_switcher/style_switcher.scss","\n.color-control input.text-input{max-width:7em;-ms-flex:1;flex:1\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/color_input/color_input.vue","\n.shadow-control{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin-bottom:1em\n}\n.shadow-control .shadow-preview-container,.shadow-control .shadow-tweak{margin:5px 6px 0 0\n}\n.shadow-control .shadow-preview-container{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.shadow-control .shadow-preview-container input[type=number]{width:5em;min-width:2em\n}\n.shadow-control .shadow-preview-container .x-shift-control,.shadow-control .shadow-preview-container .y-shift-control{display:-ms-flexbox;display:flex;-ms-flex:0;flex:0\n}\n.shadow-control .shadow-preview-container .x-shift-control[disabled=disabled] *,.shadow-control .shadow-preview-container .y-shift-control[disabled=disabled] *{opacity:.5\n}\n.shadow-control .shadow-preview-container .x-shift-control{-ms-flex-align:start;align-items:flex-start\n}\n.shadow-control .shadow-preview-container .x-shift-control .wrap,.shadow-control .shadow-preview-container input[type=range]{margin:0;width:15em;height:2em\n}\n.shadow-control .shadow-preview-container .y-shift-control{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:flex-end\n}\n.shadow-control .shadow-preview-container .y-shift-control .wrap{width:2em;height:15em\n}\n.shadow-control .shadow-preview-container .y-shift-control input[type=range]{transform-origin:1em 1em;transform:rotate(90deg)\n}\n.shadow-control .shadow-preview-container .preview-window{-ms-flex:1;flex:1;background-color:#999999;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-image:linear-gradient(45deg, #666 25%, transparent 25%),linear-gradient(-45deg, #666 25%, transparent 25%),linear-gradient(45deg, transparent 75%, #666 75%),linear-gradient(-45deg, transparent 75%, #666 75%);background-size:20px 20px;background-position:0 0, 0 10px, 10px -10px, -10px 0;border-radius:4px;border-radius:var(--inputRadius, 4px)\n}\n.shadow-control .shadow-preview-container .preview-window .preview-block{width:33%;height:33%;background-color:#121a24;background-color:var(--bg, #121a24);border-radius:10px;border-radius:var(--panelRadius, 10px)\n}\n.shadow-control .shadow-tweak{-ms-flex:1;flex:1;min-width:280px\n}\n.shadow-control .shadow-tweak .id-control{-ms-flex-align:stretch;align-items:stretch\n}\n.shadow-control .shadow-tweak .id-control .select,.shadow-control .shadow-tweak .id-control .btn{min-width:1px;margin-right:5px\n}\n.shadow-control .shadow-tweak .id-control .btn{padding:0 .4em;margin:0 .1em\n}\n.shadow-control .shadow-tweak .id-control .select{-ms-flex:1;flex:1\n}\n.shadow-control .shadow-tweak .id-control .select select{-ms-flex-item-align:initial;-ms-grid-row-align:initial;align-self:initial\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/shadow_control/shadow_control.vue","\n.font-control input.custom-font{min-width:10em\n}\n.font-control.custom .select{border-top-right-radius:0;border-bottom-right-radius:0\n}\n.font-control.custom .custom-font{border-top-left-radius:0;border-bottom-left-radius:0\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/font_control/font_control.vue","\n.contrast-ratio{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;margin-top:-4px;margin-bottom:5px\n}\n.contrast-ratio .label{margin-right:1em\n}\n.contrast-ratio .rating{display:inline-block;text-align:center\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/contrast_ratio/contrast_ratio.vue","\n.import-export-container{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:baseline;align-items:baseline;-ms-flex-pack:center;justify-content:center\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/export_import/export_import.vue","\n.registration-form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:0.6em\n}\n.registration-form .container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row\n}\n.registration-form .terms-of-service{-ms-flex:0 1 50%;flex:0 1 50%;margin:0.8em\n}\n.registration-form .text-fields{margin-top:0.6em;-ms-flex:1 0;flex:1 0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column\n}\n.registration-form textarea{min-height:100px\n}\n.registration-form .form-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:0.3em 0.0em 0.3em;line-height:24px;margin-bottom:1em\n}\n.registration-form .form-group--error{animation-name:shakeError;animation-duration:.6s;animation-timing-function:ease-in-out\n}\n.registration-form .form-group--error .form--label{color:#f04124;color:var(--cRed, #f04124)\n}\n.registration-form .form-error{margin-top:-0.7em;text-align:left\n}\n.registration-form .form-error span{font-size:12px\n}\n.registration-form .form-error ul{list-style:none;padding:0 0 0 5px;margin-top:0\n}\n.registration-form .form-error ul li::before{content:\"• \"\n}\n.registration-form form textarea{line-height:16px;resize:vertical\n}\n.registration-form .captcha{max-width:350px;margin-bottom:0.4em\n}\n.registration-form .btn{margin-top:0.6em;height:28px\n}\n.registration-form .error{text-align:center\n}\n@media all and (max-width: 800px){\n.registration-form .container{-ms-flex-direction:column-reverse;flex-direction:column-reverse\n}\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/registration/registration.vue","\n.profile-edit .bio{margin:0\n}\n.profile-edit input[type=file]{padding:5px;height:auto\n}\n.profile-edit .banner{max-width:100%\n}\n.profile-edit .uploading{font-size:1.5em;margin:0.25em\n}\n.profile-edit .name-changer{width:100%\n}\n.profile-edit .bg{max-width:100%\n}\n.profile-edit .current-avatar{display:block;width:150px;height:150px;border-radius:4px;border-radius:var(--avatarRadius, 4px)\n}\n.profile-edit .oauth-tokens{width:100%\n}\n.profile-edit .oauth-tokens th{text-align:left\n}\n.profile-edit .oauth-tokens .actions{text-align:right\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/user_settings/user_settings.vue","\n.image-cropper-img-input{display:none\n}\n.image-cropper-image-container{position:relative\n}\n.image-cropper-image-container img{display:block;max-width:100%\n}\n.image-cropper-buttons-wrapper{margin-top:15px\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/image_cropper/image_cropper.vue","/*!\n * Cropper.js v1.4.3\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2018-10-24T13:07:11.429Z\n */\n\n.cropper-container {\n direction: ltr;\n font-size: 0;\n line-height: 0;\n position: relative;\n -ms-touch-action: none;\n touch-action: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.cropper-container img {\n display: block;\n height: 100%;\n image-orientation: 0deg;\n max-height: none !important;\n max-width: none !important;\n min-height: 0 !important;\n min-width: 0 !important;\n width: 100%;\n}\n\n.cropper-wrap-box,\n.cropper-canvas,\n.cropper-drag-box,\n.cropper-crop-box,\n.cropper-modal {\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.cropper-wrap-box,\n.cropper-canvas {\n overflow: hidden;\n}\n\n.cropper-drag-box {\n background-color: #fff;\n opacity: 0;\n}\n\n.cropper-modal {\n background-color: #000;\n opacity: .5;\n}\n\n.cropper-view-box {\n display: block;\n height: 100%;\n outline-color: rgba(51, 153, 255, 0.75);\n outline: 1px solid #39f;\n overflow: hidden;\n width: 100%;\n}\n\n.cropper-dashed {\n border: 0 dashed #eee;\n display: block;\n opacity: .5;\n position: absolute;\n}\n\n.cropper-dashed.dashed-h {\n border-bottom-width: 1px;\n border-top-width: 1px;\n height: calc(100% / 3);\n left: 0;\n top: calc(100% / 3);\n width: 100%;\n}\n\n.cropper-dashed.dashed-v {\n border-left-width: 1px;\n border-right-width: 1px;\n height: 100%;\n left: calc(100% / 3);\n top: 0;\n width: calc(100% / 3);\n}\n\n.cropper-center {\n display: block;\n height: 0;\n left: 50%;\n opacity: .75;\n position: absolute;\n top: 50%;\n width: 0;\n}\n\n.cropper-center:before,\n.cropper-center:after {\n background-color: #eee;\n content: ' ';\n display: block;\n position: absolute;\n}\n\n.cropper-center:before {\n height: 1px;\n left: -3px;\n top: 0;\n width: 7px;\n}\n\n.cropper-center:after {\n height: 7px;\n left: 0;\n top: -3px;\n width: 1px;\n}\n\n.cropper-face,\n.cropper-line,\n.cropper-point {\n display: block;\n height: 100%;\n opacity: .1;\n position: absolute;\n width: 100%;\n}\n\n.cropper-face {\n background-color: #fff;\n left: 0;\n top: 0;\n}\n\n.cropper-line {\n background-color: #39f;\n}\n\n.cropper-line.line-e {\n cursor: ew-resize;\n right: -3px;\n top: 0;\n width: 5px;\n}\n\n.cropper-line.line-n {\n cursor: ns-resize;\n height: 5px;\n left: 0;\n top: -3px;\n}\n\n.cropper-line.line-w {\n cursor: ew-resize;\n left: -3px;\n top: 0;\n width: 5px;\n}\n\n.cropper-line.line-s {\n bottom: -3px;\n cursor: ns-resize;\n height: 5px;\n left: 0;\n}\n\n.cropper-point {\n background-color: #39f;\n height: 5px;\n opacity: .75;\n width: 5px;\n}\n\n.cropper-point.point-e {\n cursor: ew-resize;\n margin-top: -3px;\n right: -3px;\n top: 50%;\n}\n\n.cropper-point.point-n {\n cursor: ns-resize;\n left: 50%;\n margin-left: -3px;\n top: -3px;\n}\n\n.cropper-point.point-w {\n cursor: ew-resize;\n left: -3px;\n margin-top: -3px;\n top: 50%;\n}\n\n.cropper-point.point-s {\n bottom: -3px;\n cursor: s-resize;\n left: 50%;\n margin-left: -3px;\n}\n\n.cropper-point.point-ne {\n cursor: nesw-resize;\n right: -3px;\n top: -3px;\n}\n\n.cropper-point.point-nw {\n cursor: nwse-resize;\n left: -3px;\n top: -3px;\n}\n\n.cropper-point.point-sw {\n bottom: -3px;\n cursor: nesw-resize;\n left: -3px;\n}\n\n.cropper-point.point-se {\n bottom: -3px;\n cursor: nwse-resize;\n height: 20px;\n opacity: 1;\n right: -3px;\n width: 20px;\n}\n\n@media (min-width: 768px) {\n .cropper-point.point-se {\n height: 15px;\n width: 15px;\n }\n}\n\n@media (min-width: 992px) {\n .cropper-point.point-se {\n height: 10px;\n width: 10px;\n }\n}\n\n@media (min-width: 1200px) {\n .cropper-point.point-se {\n height: 5px;\n opacity: .75;\n width: 5px;\n }\n}\n\n.cropper-point.point-se:before {\n background-color: #39f;\n bottom: -50%;\n content: ' ';\n display: block;\n height: 200%;\n opacity: 0;\n position: absolute;\n right: -50%;\n width: 200%;\n}\n\n.cropper-invisible {\n opacity: 0;\n}\n\n.cropper-bg {\n background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');\n}\n\n.cropper-hide {\n display: block;\n height: 0;\n position: absolute;\n width: 0;\n}\n\n.cropper-hidden {\n display: none !important;\n}\n\n.cropper-move {\n cursor: move;\n}\n\n.cropper-crop {\n cursor: crosshair;\n}\n\n.cropper-disabled .cropper-drag-box,\n.cropper-disabled .cropper-face,\n.cropper-disabled .cropper-line,\n.cropper-disabled .cropper-point {\n cursor: not-allowed;\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///~/cropperjs/dist/cropper.css","\n.block-card-content-container{margin-top:0.5em;text-align:right\n}\n.block-card-content-container button{width:10em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/block_card/block_card.vue",".with-subscription {\n &-loading {\n padding: 10px;\n text-align: center;\n\n .error {\n font-size: 14px;\n }\n }\n}\n\n\n// WEBPACK FOOTER //\n// webpack:///src/hocs/with_subscription/src/hocs/with_subscription/with_subscription.scss","\n.follow-request-card-content-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.follow-request-card-content-container button{margin-top:0.5em;margin-right:0.5em;-ms-flex:1 1;flex:1 1;max-width:12em;min-width:8em\n}\n.follow-request-card-content-container button:last-child{margin-right:0\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/follow_request_card/follow_request_card.vue","\n.user-search-input-container{margin:0.5em;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center\n}\n.user-search-input-container .search-button{margin-left:0.5em\n}\n.loading-icon{padding:1em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/user_search/user_search.vue","\n.notifications{padding-bottom:15em\n}\n.notifications .loadmore-error{color:#b9b9ba;color:var(--text, #b9b9ba)\n}\n.notifications .notification{position:relative\n}\n.notifications .notification .notification-overlay{position:absolute;top:0;right:0;left:0;bottom:0;pointer-events:none\n}\n.notifications .notification.unseen .notification-overlay{background-image:linear-gradient(135deg, var(--badgeNotification, red) 4px, transparent 10px)\n}\n.notification{box-sizing:border-box;display:-ms-flexbox;display:flex;border-bottom:1px solid;border-color:#222;border-color:var(--border, #222)\n}\n.notification:hover .animated.avatar canvas{display:none\n}\n.notification:hover .animated.avatar img{visibility:visible\n}\n.notification .non-mention{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-wrap:nowrap;flex-wrap:nowrap;padding:0.6em;min-width:0\n}\n.notification .non-mention .avatar-container{width:32px;height:32px\n}\n.notification .non-mention .status-el{padding:0\n}\n.notification .non-mention .status-el .status{padding:0.25em 0;color:rgba(185,185,186,0.5);color:var(--faint, rgba(185,185,186,0.5))\n}\n.notification .non-mention .status-el .status a{color:var(--faintLink)\n}\n.notification .non-mention .status-el .media-body{margin:0\n}\n.notification .follow-text{padding:0.5em 0\n}\n.notification .status-el{-ms-flex:1;flex:1\n}\n.notification time{white-space:nowrap\n}\n.notification .notification-right{-ms-flex:1;flex:1;padding-left:0.8em;min-width:0\n}\n.notification .notification-details{min-width:0px;word-wrap:break-word;line-height:18px;position:relative;overflow:hidden;width:100%;-ms-flex:1 1 0px;flex:1 1 0;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:justify;justify-content:space-between\n}\n.notification .notification-details .name-and-action{-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis\n}\n.notification .notification-details .username{font-weight:bolder;max-width:100%;text-overflow:ellipsis;white-space:nowrap\n}\n.notification .notification-details .username img{width:14px;height:14px;vertical-align:middle;object-fit:contain\n}\n.notification .notification-details .timeago{margin-right:.2em\n}\n.notification .notification-details .icon-retweet.lit{color:#0fa00f;color:var(--cGreen, #0fa00f)\n}\n.notification .notification-details .icon-user-plus.lit{color:#0095ff;color:var(--cBlue, #0095ff)\n}\n.notification .notification-details .icon-reply.lit{color:#0095ff;color:var(--cBlue, #0095ff)\n}\n.notification .notification-details .icon-star.lit{color:orange;color:orange;color:var(--cOrange, orange)\n}\n.notification .notification-details .status-content{margin:0;max-height:300px\n}\n.notification .notification-details h1{word-break:break-all;margin:0 0 0.3em;padding:0;font-size:1em;line-height:20px\n}\n.notification .notification-details h1 small{font-weight:lighter\n}\n.notification .notification-details p{margin:0;margin-top:0;margin-bottom:0.3em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/notifications/notifications.scss","\n.login-form .btn{min-height:28px;width:10em\n}\n.login-form .register{-ms-flex:1 1;flex:1 1\n}\n.login-form .login-bottom{margin-top:1.0em;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between\n}\n.login .error{text-align:center;animation-name:shakeError;animation-duration:0.4s;animation-timing-function:ease-in-out\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/login_form/login_form.vue","\n.floating-chat{position:fixed;right:0px;bottom:0px;z-index:1000;max-width:25em\n}\n.chat-heading{cursor:pointer\n}\n.chat-heading .icon-comment-empty{color:#b9b9ba;color:var(--text, #b9b9ba)\n}\n.chat-window{overflow-y:auto;overflow-x:hidden;max-height:20em\n}\n.chat-window-container{height:100%\n}\n.chat-message{display:-ms-flexbox;display:flex;padding:0.2em 0.5em\n}\n.chat-avatar img{height:24px;width:24px;border-radius:4px;border-radius:var(--avatarRadius, 4px);margin-right:0.5em;margin-top:0.25em\n}\n.chat-input{display:-ms-flexbox;display:flex\n}\n.chat-input textarea{-ms-flex:1;flex:1;margin:0.6em;min-height:3.5em;resize:none\n}\n.chat-panel .title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/chat_panel/chat_panel.vue","\n.features-panel li{line-height:24px\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/features_panel/features_panel.vue","\n.tos-content{margin:1em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/terms_of_service_panel/terms_of_service_panel.vue","\n#app{min-height:100vh;max-width:100%;overflow:hidden\n}\n.app-bg-wrapper{position:fixed;z-index:-1;height:100%;width:100%;background-size:cover;background-repeat:no-repeat;background-position:0 50%\n}\ni{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none\n}\nh4{margin:0\n}\n#content{box-sizing:border-box;padding-top:60px;margin:auto;min-height:100vh;max-width:980px;background-color:rgba(0,0,0,0.15);-ms-flex-line-pack:start;align-content:flex-start\n}\n.text-center{text-align:center\n}\nbody{font-family:sans-serif;font-family:var(--interfaceFont, sans-serif);font-size:14px;margin:0;color:#b9b9ba;color:var(--text, #b9b9ba);max-width:100vw;overflow-x:hidden\n}\na{text-decoration:none;color:#d8a070;color:var(--link, #d8a070)\n}\nbutton{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#b9b9ba;color:var(--btnText, #b9b9ba);background-color:#182230;background-color:var(--btn, #182230);border:none;border-radius:4px;border-radius:var(--btnRadius, 4px);cursor:pointer;box-shadow:0px 0px 2px 0px #000,0px 1px 0px 0px rgba(255,255,255,0.2) inset,0px -1px 0px 0px rgba(0,0,0,0.2) inset;box-shadow:var(--buttonShadow);font-size:14px;font-family:sans-serif;font-family:var(--interfaceFont, sans-serif)\n}\nbutton i[class*=icon-]{color:#b9b9ba;color:var(--btnText, #b9b9ba)\n}\nbutton::-moz-focus-inner{border:none\n}\nbutton:hover{box-shadow:0px 0px 4px rgba(255,255,255,0.3);box-shadow:var(--buttonHoverShadow)\n}\nbutton:active{box-shadow:0px 0px 4px 0px rgba(255,255,255,0.3),0px 1px 0px 0px rgba(0,0,0,0.2) inset,0px -1px 0px 0px rgba(255,255,255,0.2) inset;box-shadow:var(--buttonPressedShadow)\n}\nbutton:disabled{cursor:not-allowed;opacity:0.5\n}\nbutton.pressed{color:rgba(185,185,186,0.5);color:var(--faint, rgba(185,185,186,0.5));background-color:#121a24;background-color:var(--bg, #121a24)\n}\nlabel.select{padding:0\n}\ninput,textarea,.select{border:none;border-radius:4px;border-radius:var(--inputRadius, 4px);box-shadow:0px 1px 0px 0px rgba(0,0,0,0.2) inset,0px -1px 0px 0px rgba(255,255,255,0.2) inset,0px 0px 2px 0px #000 inset;box-shadow:var(--inputShadow);background-color:#182230;background-color:var(--input, #182230);color:#b9b9ba;color:var(--inputText, #b9b9ba);font-family:sans-serif;font-family:var(--inputFont, sans-serif);font-size:14px;padding:8px .5em;box-sizing:border-box;display:inline-block;position:relative;height:28px;line-height:16px;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none\n}\ninput:disabled,input[disabled=disabled],textarea:disabled,textarea[disabled=disabled],.select:disabled,.select[disabled=disabled]{cursor:not-allowed;opacity:0.5\n}\ninput .icon-down-open,textarea .icon-down-open,.select .icon-down-open{position:absolute;top:0;bottom:0;right:5px;height:100%;color:#b9b9ba;color:var(--text, #b9b9ba);line-height:28px;z-index:0;pointer-events:none\n}\ninput select,textarea select,.select select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:none;color:#b9b9ba;color:var(--text, #b9b9ba);margin:0;padding:0 2em 0 .2em;font-family:sans-serif;font-family:var(--inputFont, sans-serif);font-size:14px;width:100%;z-index:1;height:28px;line-height:16px\n}\ninput[type=range],textarea[type=range],.select[type=range]{background:none;border:none;margin:0;box-shadow:none;-ms-flex:1;flex:1\n}\ninput[type=radio],input[type=checkbox],textarea[type=radio],textarea[type=checkbox],.select[type=radio],.select[type=checkbox]{display:none\n}\ninput[type=radio]:checked+label::before,input[type=checkbox]:checked+label::before,textarea[type=radio]:checked+label::before,textarea[type=checkbox]:checked+label::before,.select[type=radio]:checked+label::before,.select[type=checkbox]:checked+label::before{color:#b9b9ba;color:var(--text, #b9b9ba)\n}\ninput[type=radio]:disabled,input[type=radio]:disabled+label,input[type=radio]:disabled+label::before,input[type=checkbox]:disabled,input[type=checkbox]:disabled+label,input[type=checkbox]:disabled+label::before,textarea[type=radio]:disabled,textarea[type=radio]:disabled+label,textarea[type=radio]:disabled+label::before,textarea[type=checkbox]:disabled,textarea[type=checkbox]:disabled+label,textarea[type=checkbox]:disabled+label::before,.select[type=radio]:disabled,.select[type=radio]:disabled+label,.select[type=radio]:disabled+label::before,.select[type=checkbox]:disabled,.select[type=checkbox]:disabled+label,.select[type=checkbox]:disabled+label::before{opacity:.5\n}\ninput[type=radio]+label::before,input[type=checkbox]+label::before,textarea[type=radio]+label::before,textarea[type=checkbox]+label::before,.select[type=radio]+label::before,.select[type=checkbox]+label::before{display:inline-block;content:'✔';transition:color 200ms;width:1.1em;height:1.1em;border-radius:2px;border-radius:var(--checkboxRadius, 2px);box-shadow:0px 0px 2px black inset;box-shadow:var(--inputShadow);margin-right:.5em;background-color:#182230;background-color:var(--input, #182230);vertical-align:top;text-align:center;line-height:1.1em;font-size:1.1em;box-sizing:border-box;color:transparent;overflow:hidden;box-sizing:border-box\n}\noption{color:#b9b9ba;color:var(--text, #b9b9ba);background-color:#121a24;background-color:var(--bg, #121a24)\n}\ni[class*=icon-]{color:#666;color:var(--icon, #666)\n}\n.container{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0;padding:0 10px 0 10px\n}\n.item{-ms-flex:1;flex:1;line-height:50px;height:50px;overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap\n}\n.item .nav-icon{margin-left:0.4em\n}\n.item.right{-ms-flex-pack:end;justify-content:flex-end\n}\n.auto-size{-ms-flex:1;flex:1\n}\n.nav-bar{padding:0;width:100%;-ms-flex-align:center;align-items:center;position:fixed;height:50px\n}\n.nav-bar .logo{display:-ms-flexbox;display:flex;position:absolute;top:0;bottom:0;left:0;right:0;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:center;justify-content:center;-ms-flex:0 0 auto;flex:0 0 auto;z-index:-1;transition:opacity;transition-timing-function:ease-out;transition-duration:100ms\n}\n.nav-bar .logo .mask{-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-size:contain;mask-size:contain;background-color:#182230;background-color:var(--topBarText, #182230);position:absolute;top:0;bottom:0;left:0;right:0\n}\n.nav-bar .logo img{height:100%;object-fit:contain;display:block;-ms-flex:0;flex:0\n}\n.nav-bar .inner-nav{margin:auto;box-sizing:border-box;padding-left:10px;padding-right:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-preferred-size:970px;flex-basis:970px;height:50px\n}\n.nav-bar .inner-nav a,.nav-bar .inner-nav a i{color:#d8a070;color:var(--topBarLink, #d8a070)\n}\nmain-router{-ms-flex:1;flex:1\n}\n.status.compact{color:rgba(0,0,0,0.42);font-weight:300\n}\n.status.compact p{margin:0;font-size:0.8em\n}\n.panel{display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:column;flex-direction:column;margin:0.5em;background-color:#121a24;background-color:var(--bg, #121a24)\n}\n.panel::after,.panel{border-radius:10px;border-radius:var(--panelRadius, 10px)\n}\n.panel::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;box-shadow:1px 1px 4px rgba(0,0,0,0.6);box-shadow:var(--panelShadow)\n}\n.panel-body:empty::before{content:\"¯\\\\_(ツ)_/¯\";display:block;margin:1em;text-align:center\n}\n.panel-heading{display:-ms-flexbox;display:flex;border-radius:10px 10px 0 0;border-radius:var(--panelRadius, 10px) var(--panelRadius, 10px) 0 0;background-size:cover;padding:.6em .6em;text-align:left;line-height:28px;color:var(--panelText);background-color:#182230;background-color:var(--panel, #182230);-ms-flex-align:baseline;align-items:baseline;box-shadow:var(--panelHeaderShadow)\n}\n.panel-heading .title{-ms-flex:1 0 auto;flex:1 0 auto;font-size:1.3em\n}\n.panel-heading .faint{background-color:transparent;color:rgba(185,185,186,0.5);color:var(--panelFaint, rgba(185,185,186,0.5))\n}\n.panel-heading .alert{white-space:nowrap;text-overflow:ellipsis;overflow-x:hidden\n}\n.panel-heading button{-ms-flex-negative:0;flex-shrink:0\n}\n.panel-heading button,.panel-heading .alert{line-height:21px;min-height:0;box-sizing:border-box;margin:0;margin-left:.25em;min-width:1px;-ms-flex-item-align:stretch;-ms-grid-row-align:stretch;align-self:stretch\n}\n.panel-heading a{color:#d8a070;color:var(--panelLink, #d8a070)\n}\n.panel-heading.stub{border-radius:10px;border-radius:var(--panelRadius, 10px)\n}\n.panel-footer{border-radius:0 0 10px 10px;border-radius:0 0 var(--panelRadius, 10px) var(--panelRadius, 10px)\n}\n.panel-footer .faint{color:rgba(185,185,186,0.5);color:var(--panelFaint, rgba(185,185,186,0.5))\n}\n.panel-footer a{color:#d8a070;color:var(--panelLink, #d8a070)\n}\n.panel-body>p{line-height:18px;padding:1em;margin:0\n}\n.container>*{min-width:0px\n}\n.fa{color:grey\n}\nnav{z-index:1000;color:var(--topBarText);background-color:#182230;background-color:var(--topBar, #182230);color:rgba(185,185,186,0.5);color:var(--faint, rgba(185,185,186,0.5));box-shadow:0px 0px 4px rgba(0,0,0,0.6);box-shadow:var(--topBarShadow)\n}\nnav .back-button{display:block;max-width:99px;transition-property:opacity, max-width;transition-duration:300ms;transition-timing-function:ease-out\n}\nnav .back-button i{margin:0 1em\n}\nnav .back-button.hidden{opacity:0;max-width:5px\n}\n.menu-button{display:none;position:relative\n}\n.alert-dot{border-radius:100%;height:8px;width:8px;position:absolute;left:calc(50% - 4px);top:calc(50% - 4px);margin-left:6px;margin-top:-6px;background-color:red;background-color:var(--badgeNotification, red)\n}\n.fade-enter-active,.fade-leave-active{transition:opacity .2s\n}\n.fade-enter,.fade-leave-active{opacity:0\n}\n.main{-ms-flex-preferred-size:50%;flex-basis:50%;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1\n}\n.sidebar-bounds{-ms-flex:0;flex:0;-ms-flex-preferred-size:35%;flex-basis:35%\n}\n.sidebar-flexer{-ms-flex:1;flex:1;-ms-flex-preferred-size:345px;flex-basis:345px;width:365px\n}\n.mobile-shown{display:none\n}\n.panel-switcher{display:none;width:100%;height:46px\n}\n.panel-switcher button{display:block;-ms-flex:1;flex:1;max-height:32px;margin:0.5em;padding:0.5em\n}\n@media all and (min-width: 800px){\nbody{overflow-y:scroll\n}\nnav .back-button{display:none\n}\n.sidebar-bounds{overflow:hidden;max-height:100vh;width:345px;position:fixed;margin-top:-10px\n}\n.sidebar-bounds .sidebar-scroller{height:96vh;width:365px;padding-top:10px;padding-right:50px;overflow-x:hidden;overflow-y:scroll\n}\n.sidebar-bounds .sidebar{width:345px\n}\n.sidebar-flexer{max-height:96vh;-ms-flex-negative:0;flex-shrink:0;-ms-flex-positive:0;flex-grow:0\n}\n}\n.badge{display:inline-block;border-radius:99px;min-width:22px;max-width:22px;min-height:22px;max-height:22px;font-size:15px;line-height:22px;text-align:center;vertical-align:middle;white-space:nowrap;padding:0\n}\n.badge.badge-notification{background-color:red;background-color:var(--badgeNotification, red);color:white;color:var(--badgeNotificationText, #fff)\n}\n.alert{margin:0.35em;padding:0.25em;border-radius:5px;border-radius:var(--tooltipRadius, 5px);min-height:28px;line-height:28px\n}\n.alert.error{background-color:rgba(211,16,20,0.5);background-color:var(--alertError, rgba(211,16,20,0.5));color:#b9b9ba;color:var(--alertErrorText, #b9b9ba)\n}\n.panel-heading .alert.error{color:#b9b9ba;color:var(--alertErrorPanelText, #b9b9ba)\n}\n.faint{color:rgba(185,185,186,0.5);color:var(--faint, rgba(185,185,186,0.5))\n}\n.faint-link{color:rgba(185,185,186,0.5);color:var(--faint, rgba(185,185,186,0.5))\n}\n.faint-link:hover{text-decoration:underline\n}\n@media all and (min-width: 800px){\n.logo{opacity:1 !important\n}\n}\n.item.right{text-align:right\n}\n.visibility-tray{font-size:1.2em;padding:3px;cursor:pointer\n}\n.visibility-tray .selected{color:#b9b9ba;color:var(--lightText, #b9b9ba)\n}\n.visibility-tray div{padding-top:5px\n}\n.visibility-notice{padding:.5em;border:1px solid rgba(185,185,186,0.5);border:1px solid var(--faint, rgba(185,185,186,0.5));border-radius:4px;border-radius:var(--inputRadius, 4px)\n}\n@keyframes modal-background-fadein{\nfrom{background-color:transparent\n}\nto{background-color:rgba(0,0,0,0.5)\n}\n}\n.modal-view{z-index:1000;position:fixed;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;overflow:auto;animation-duration:0.2s;background-color:rgba(0,0,0,0.5);animation-name:modal-background-fadein\n}\n.button-icon{font-size:1.2em\n}\n@keyframes shakeError{\n0%{transform:translateX(0)\n}\n15%{transform:translateX(0.375rem)\n}\n30%{transform:translateX(-0.375rem)\n}\n45%{transform:translateX(0.375rem)\n}\n60%{transform:translateX(-0.375rem)\n}\n75%{transform:translateX(0.375rem)\n}\n90%{transform:translateX(-0.375rem)\n}\n100%{transform:translateX(0)\n}\n}\n@media all and (max-width: 800px){\n.mobile-hidden{display:none\n}\n.panel-switcher{display:-ms-flexbox;display:flex\n}\n.container{padding:0\n}\n.panel{margin:0.5em 0 0.5em 0\n}\n.menu-button{display:block;margin-right:0.8em\n}\n}\n.login-hint{text-align:center\n}\n@media all and (min-width: 801px){\n.login-hint{display:none\n}\n}\n.login-hint a{display:inline-block;padding:1em 0px;width:100%\n}\n.btn.btn-default{min-height:28px\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/App.scss","\n.nav-panel .panel{overflow:hidden;box-shadow:var(--panelShadow)\n}\n.nav-panel ul{list-style:none;margin:0;padding:0\n}\n.follow-request-count{margin:-6px 10px;background-color:#121a24;background-color:var(--input, rgba(185,185,186,0.5))\n}\n.nav-panel li{border-bottom:1px solid;border-color:#222;border-color:var(--border, #222);padding:0\n}\n.nav-panel li:first-child a{border-top-right-radius:10px;border-top-right-radius:var(--panelRadius, 10px);border-top-left-radius:10px;border-top-left-radius:var(--panelRadius, 10px)\n}\n.nav-panel li:last-child a{border-bottom-right-radius:10px;border-bottom-right-radius:var(--panelRadius, 10px);border-bottom-left-radius:10px;border-bottom-left-radius:var(--panelRadius, 10px)\n}\n.nav-panel li:last-child{border:none\n}\n.nav-panel a{display:block;padding:0.8em 0.85em\n}\n.nav-panel a:hover{background-color:#151e2a;background-color:var(--lightBg, #151e2a)\n}\n.nav-panel a.router-link-active{font-weight:bolder;background-color:#151e2a;background-color:var(--lightBg, #151e2a)\n}\n.nav-panel a.router-link-active:hover{text-decoration:underline\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/nav_panel/nav_panel.vue","\n.user-finder-container{max-width:100%;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:baseline;align-items:baseline;vertical-align:baseline\n}\n.user-finder-container .user-finder-input,.user-finder-container .search-button{height:29px\n}\n.user-finder-container .user-finder-input{max-width:calc(100% - 30px - 30px - 20px)\n}\n.user-finder-container .search-button{margin-left:.5em;margin-right:.5em\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/user_finder/user_finder.vue","\n.who-to-follow *{vertical-align:middle\n}\n.who-to-follow img{width:32px;height:32px\n}\n.who-to-follow{padding:0.5em 1em 0.5em 1em;margin:0px;line-height:40px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/who_to_follow_panel/who_to_follow_panel.vue","\n.media-modal-view:hover .modal-view-button-arrow{opacity:0.75\n}\n.media-modal-view:hover .modal-view-button-arrow:focus,.media-modal-view:hover .modal-view-button-arrow:hover{outline:none;box-shadow:none\n}\n.media-modal-view:hover .modal-view-button-arrow:hover{opacity:1\n}\n.modal-image{max-width:90%;max-height:90%;box-shadow:0px 5px 15px 0 rgba(0,0,0,0.5)\n}\n.modal-view-button-arrow{position:absolute;display:block;top:50%;margin-top:-50px;width:70px;height:100px;border:0;padding:0;opacity:0;box-shadow:none;background:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;overflow:visible;cursor:pointer;transition:opacity 333ms cubic-bezier(0.4, 0, 0.22, 1)\n}\n.modal-view-button-arrow .arrow-icon{position:absolute;top:35px;height:30px;width:32px;font-size:14px;line-height:30px;color:#FFF;text-align:center;background-color:rgba(0,0,0,0.3)\n}\n.modal-view-button-arrow--prev{left:0\n}\n.modal-view-button-arrow--prev .arrow-icon{left:6px\n}\n.modal-view-button-arrow--next{right:0\n}\n.modal-view-button-arrow--next .arrow-icon{right:6px\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/media_modal/media_modal.vue","\n.side-drawer-container{position:fixed;z-index:1000;top:0;left:0;width:100%;height:100%;display:-ms-flexbox;display:flex;-ms-flex-align:stretch;align-items:stretch\n}\n.side-drawer-container-open{transition:0.35s;transition-property:background-color;background-color:rgba(0,0,0,0.5)\n}\n.side-drawer-container-closed{left:-100%;background-color:transparent\n}\n.side-drawer-click-outside{-ms-flex:1 1 100%;flex:1 1 100%\n}\n.side-drawer{overflow-x:hidden;transition:0.35s;transition-timing-function:cubic-bezier(0, 1, 0.5, 1);margin:0 0 0 -100px;padding:0 0 1em 100px;width:80%;max-width:20em;-ms-flex:0 0 80%;flex:0 0 80%;box-shadow:1px 1px 4px rgba(0,0,0,0.6);box-shadow:var(--panelShadow);background-color:#121a24;background-color:var(--bg, #121a24)\n}\n.side-drawer-logo-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0.85em\n}\n.side-drawer-logo-wrapper img{-ms-flex:none;flex:none;height:50px;margin-right:0.85em\n}\n.side-drawer-logo-wrapper span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap\n}\n.side-drawer-click-outside-closed{-ms-flex:0 0 0px;flex:0 0 0\n}\n.side-drawer-closed{transform:translate(-100%)\n}\n.side-drawer-heading{background:transparent;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch;display:-ms-flexbox;display:flex;padding:0;margin:0\n}\n.side-drawer ul{list-style:none;margin:0;padding:0;border-bottom:1px solid;border-color:#222;border-color:var(--border, #222);margin:0.2em 0\n}\n.side-drawer ul:last-child{border:0\n}\n.side-drawer li{padding:0\n}\n.side-drawer li a{display:block;padding:0.5em 0.85em\n}\n.side-drawer li a:hover{background-color:#151e2a;background-color:var(--lightBg, #151e2a)\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/side_drawer/side_drawer.vue","\n.post-form-modal-view{max-height:100%;display:block\n}\n.post-form-modal-panel{-ms-flex-negative:0;flex-shrink:0;margin:25% 0 4em 0;width:100%\n}\n.new-status-button{width:5em;height:5em;border-radius:100%;position:fixed;bottom:1.5em;right:1.5em;background-color:#182230;background-color:var(--btn, #182230);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;box-shadow:0px 2px 2px rgba(0,0,0,0.3),0px 4px 6px rgba(0,0,0,0.3);z-index:10;transition:0.35s transform;transition-timing-function:cubic-bezier(0, 1, 0.5, 1)\n}\n.new-status-button.hidden{transform:translateY(150%)\n}\n.new-status-button i{font-size:1.5em;color:#b9b9ba;color:var(--text, #b9b9ba)\n}\n@media all and (min-width: 801px){\n.new-status-button{display:none\n}\n}\n\n\n\n// WEBPACK FOOTER //\n// webpack:///src/components/mobile_post_status_modal/mobile_post_status_modal.vue"],"sourceRoot":""} \ No newline at end of file diff --git a/priv/static/static/font/LICENSE.txt b/priv/static/static/font/LICENSE.txt old mode 100755 new mode 100644 diff --git a/priv/static/static/font/README.txt b/priv/static/static/font/README.txt old mode 100755 new mode 100644 diff --git a/priv/static/static/font/config.json b/priv/static/static/font/config.json old mode 100755 new mode 100644 index d72b622c0..b73f2ad40 --- a/priv/static/static/font/config.json +++ b/priv/static/static/font/config.json @@ -239,6 +239,18 @@ "css": "pencil", "code": 59416, "src": "fontawesome" + }, + { + "uid": "671f29fa10dda08074a4c6a341bb4f39", + "css": "bell-alt", + "code": 61683, + "src": "fontawesome" + }, + { + "uid": "5bb103cd29de77e0e06a52638527b575", + "css": "wrench", + "code": 59418, + "src": "fontawesome" } ] } \ No newline at end of file diff --git a/priv/static/static/font/css/fontello-codes.css b/priv/static/static/font/css/fontello-codes.css index 49175c8fe..b57c56203 100755 Binary files a/priv/static/static/font/css/fontello-codes.css and b/priv/static/static/font/css/fontello-codes.css differ diff --git a/priv/static/static/font/css/fontello-embedded.css b/priv/static/static/font/css/fontello-embedded.css index c43ad321d..c69c8b9f6 100755 Binary files a/priv/static/static/font/css/fontello-embedded.css and b/priv/static/static/font/css/fontello-embedded.css differ diff --git a/priv/static/static/font/css/fontello-ie7-codes.css b/priv/static/static/font/css/fontello-ie7-codes.css index 56e114470..981463a84 100755 Binary files a/priv/static/static/font/css/fontello-ie7-codes.css and b/priv/static/static/font/css/fontello-ie7-codes.css differ diff --git a/priv/static/static/font/css/fontello-ie7.css b/priv/static/static/font/css/fontello-ie7.css index edced9cb6..c2e8bc242 100755 Binary files a/priv/static/static/font/css/fontello-ie7.css and b/priv/static/static/font/css/fontello-ie7.css differ diff --git a/priv/static/static/font/css/fontello.css b/priv/static/static/font/css/fontello.css index 64a7a938e..fc23c41aa 100755 Binary files a/priv/static/static/font/css/fontello.css and b/priv/static/static/font/css/fontello.css differ diff --git a/priv/static/static/font/demo.html b/priv/static/static/font/demo.html index 2c89a505d..1a1147afd 100755 --- a/priv/static/static/font/demo.html +++ b/priv/static/static/font/demo.html @@ -229,11 +229,11 @@ body { } @font-face { font-family: 'fontello'; - src: url('./font/fontello.eot?50378338'); - src: url('./font/fontello.eot?50378338#iefix') format('embedded-opentype'), - url('./font/fontello.woff?50378338') format('woff'), - url('./font/fontello.ttf?50378338') format('truetype'), - url('./font/fontello.svg?50378338#fontello') format('svg'); + src: url('./font/fontello.eot?60799712'); + src: url('./font/fontello.eot?60799712#iefix') format('embedded-opentype'), + url('./font/fontello.woff?60799712') format('woff'), + url('./font/fontello.ttf?60799712') format('truetype'), + url('./font/fontello.svg?60799712#fontello') format('svg'); font-weight: normal; font-style: normal; } @@ -335,24 +335,29 @@ body {
icon-pencil0xe818
+
icon-verified0xe819
+
icon-wrench0xe81a
icon-spin30xe832
+
+
icon-spin40xe834
icon-link-ext0xf08e
-
-
icon-link-ext-alt0xf08f
icon-menu0xf0c9
-
icon-mail-alt0xf0e0
-
icon-comment-empty0xf0e5
+
icon-mail-alt0xf0e0
+
icon-comment-empty0xf0e5
+
icon-bell-alt0xf0f3
icon-plus-squared0xf0fe
+
+
icon-reply0xf112
icon-lock-open-alt0xf13e
icon-play-circled0xf144
+
icon-thumbs-up-alt0xf164
-
icon-thumbs-up-alt0xf164
icon-binoculars0xf1e5
icon-user-plus0xf234
diff --git a/priv/static/static/font/font/fontello.eot b/priv/static/static/font/font/fontello.eot index a72671b0d..b9cdfcb5d 100755 Binary files a/priv/static/static/font/font/fontello.eot and b/priv/static/static/font/font/fontello.eot differ diff --git a/priv/static/static/font/font/fontello.svg b/priv/static/static/font/font/fontello.svg index 91aba5ef6..0e460ea5e 100755 --- a/priv/static/static/font/font/fontello.svg +++ b/priv/static/static/font/font/fontello.svg @@ -56,6 +56,10 @@ + + + + @@ -70,6 +74,8 @@ + + diff --git a/priv/static/static/font/font/fontello.ttf b/priv/static/static/font/font/fontello.ttf index 9d36bc118..f1b9f19d2 100755 Binary files a/priv/static/static/font/font/fontello.ttf and b/priv/static/static/font/font/fontello.ttf differ diff --git a/priv/static/static/font/font/fontello.woff b/priv/static/static/font/font/fontello.woff index 35eea15d7..141abc65a 100755 Binary files a/priv/static/static/font/font/fontello.woff and b/priv/static/static/font/font/fontello.woff differ diff --git a/priv/static/static/font/font/fontello.woff2 b/priv/static/static/font/font/fontello.woff2 index c88c4b24f..efed5cf73 100755 Binary files a/priv/static/static/font/font/fontello.woff2 and b/priv/static/static/font/font/fontello.woff2 differ diff --git a/priv/static/static/img/nsfw.74818f9.png b/priv/static/static/img/nsfw.74818f9.png index e32525aa5..d25137767 100644 Binary files a/priv/static/static/img/nsfw.74818f9.png and b/priv/static/static/img/nsfw.74818f9.png differ diff --git a/priv/static/static/js/app.77434de4e756a5d79672.js b/priv/static/static/js/app.77434de4e756a5d79672.js deleted file mode 100644 index df6755cb4..000000000 Binary files a/priv/static/static/js/app.77434de4e756a5d79672.js and /dev/null differ diff --git a/priv/static/static/js/app.77434de4e756a5d79672.js.map b/priv/static/static/js/app.77434de4e756a5d79672.js.map deleted file mode 100644 index 5f68977a7..000000000 Binary files a/priv/static/static/js/app.77434de4e756a5d79672.js.map and /dev/null differ diff --git a/priv/static/static/js/app.c914d9a57d5da7aa5553.js b/priv/static/static/js/app.c914d9a57d5da7aa5553.js new file mode 100644 index 000000000..e7b09c97e Binary files /dev/null and b/priv/static/static/js/app.c914d9a57d5da7aa5553.js differ diff --git a/priv/static/static/js/app.c914d9a57d5da7aa5553.js.map b/priv/static/static/js/app.c914d9a57d5da7aa5553.js.map new file mode 100644 index 000000000..f469d271c Binary files /dev/null and b/priv/static/static/js/app.c914d9a57d5da7aa5553.js.map differ diff --git a/priv/static/static/js/manifest.0b2f423dda42f0dbbf65.js b/priv/static/static/js/manifest.0b2f423dda42f0dbbf65.js deleted file mode 100644 index ecc4a13d3..000000000 Binary files a/priv/static/static/js/manifest.0b2f423dda42f0dbbf65.js and /dev/null differ diff --git a/priv/static/static/js/manifest.bf15f24d205c8cf4ee4a.js b/priv/static/static/js/manifest.bf15f24d205c8cf4ee4a.js new file mode 100644 index 000000000..b6de44a86 Binary files /dev/null and b/priv/static/static/js/manifest.bf15f24d205c8cf4ee4a.js differ diff --git a/priv/static/static/js/manifest.0b2f423dda42f0dbbf65.js.map b/priv/static/static/js/manifest.bf15f24d205c8cf4ee4a.js.map similarity index 92% rename from priv/static/static/js/manifest.0b2f423dda42f0dbbf65.js.map rename to priv/static/static/js/manifest.bf15f24d205c8cf4ee4a.js.map index 8aabe15dd..c0cd90ac0 100644 Binary files a/priv/static/static/js/manifest.0b2f423dda42f0dbbf65.js.map and b/priv/static/static/js/manifest.bf15f24d205c8cf4ee4a.js.map differ diff --git a/priv/static/static/js/vendor.0d1eeaf25aa1d2fc51b0.js b/priv/static/static/js/vendor.0d1eeaf25aa1d2fc51b0.js new file mode 100644 index 000000000..7e0119cc8 Binary files /dev/null and b/priv/static/static/js/vendor.0d1eeaf25aa1d2fc51b0.js differ diff --git a/priv/static/static/js/vendor.0d1eeaf25aa1d2fc51b0.js.map b/priv/static/static/js/vendor.0d1eeaf25aa1d2fc51b0.js.map new file mode 100644 index 000000000..ddc023b43 Binary files /dev/null and b/priv/static/static/js/vendor.0d1eeaf25aa1d2fc51b0.js.map differ diff --git a/priv/static/static/js/vendor.e4475fde034685231799.js b/priv/static/static/js/vendor.e4475fde034685231799.js deleted file mode 100644 index 989b44b7a..000000000 Binary files a/priv/static/static/js/vendor.e4475fde034685231799.js and /dev/null differ diff --git a/priv/static/static/js/vendor.e4475fde034685231799.js.map b/priv/static/static/js/vendor.e4475fde034685231799.js.map deleted file mode 100644 index 6813973f8..000000000 Binary files a/priv/static/static/js/vendor.e4475fde034685231799.js.map and /dev/null differ diff --git a/priv/static/static/logo.png b/priv/static/static/logo.png index c3c92914b..7744b1acc 100644 Binary files a/priv/static/static/logo.png and b/priv/static/static/logo.png differ diff --git a/priv/static/sw-pleroma.js b/priv/static/sw-pleroma.js index b69b1b7e7..3c00d22d5 100644 Binary files a/priv/static/sw-pleroma.js and b/priv/static/sw-pleroma.js differ diff --git a/test/bookmark_test.exs b/test/bookmark_test.exs new file mode 100644 index 000000000..b81c102ef --- /dev/null +++ b/test/bookmark_test.exs @@ -0,0 +1,52 @@ +defmodule Pleroma.BookmarkTest do + use Pleroma.DataCase + import Pleroma.Factory + alias Pleroma.Bookmark + alias Pleroma.Web.CommonAPI + + describe "create/2" do + test "with valid params" do + user = insert(:user) + {:ok, activity} = CommonAPI.post(user, %{"status" => "Some cool information"}) + {:ok, bookmark} = Bookmark.create(user.id, activity.id) + assert bookmark.user_id == user.id + assert bookmark.activity_id == activity.id + end + + test "with invalid params" do + {:error, changeset} = Bookmark.create(nil, "") + refute changeset.valid? + + assert changeset.errors == [ + user_id: {"can't be blank", [validation: :required]}, + activity_id: {"can't be blank", [validation: :required]} + ] + end + end + + describe "destroy/2" do + test "with valid params" do + user = insert(:user) + + {:ok, activity} = CommonAPI.post(user, %{"status" => "Some cool information"}) + {:ok, _bookmark} = Bookmark.create(user.id, activity.id) + + {:ok, _deleted_bookmark} = Bookmark.destroy(user.id, activity.id) + end + end + + describe "get/2" do + test "gets a bookmark" do + user = insert(:user) + + {:ok, activity} = + CommonAPI.post(user, %{ + "status" => + "Scientists Discover The Secret Behind Tenshi Eating A Corndog Being So Cute – Science Daily" + }) + + {:ok, bookmark} = Bookmark.create(user.id, activity.id) + assert bookmark == Bookmark.get(user.id, activity.id) + end + end +end diff --git a/test/emoji_test.exs b/test/emoji_test.exs index cb1d62d00..2eaa26be6 100644 --- a/test/emoji_test.exs +++ b/test/emoji_test.exs @@ -15,7 +15,7 @@ test "first emoji", %{emoji_list: emoji_list} do assert tuple_size(emoji) == 3 assert is_binary(code) assert is_binary(path) - assert is_binary(tags) + assert is_list(tags) end test "random emoji", %{emoji_list: emoji_list} do @@ -25,7 +25,7 @@ test "random emoji", %{emoji_list: emoji_list} do assert tuple_size(emoji) == 3 assert is_binary(code) assert is_binary(path) - assert is_binary(tags) + assert is_list(tags) end end diff --git a/test/formatter_test.exs b/test/formatter_test.exs index e74985c4e..97eb2f583 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -245,10 +245,10 @@ test "it can parse mentions and return the relevant users" do end test "it adds cool emoji" do - text = "I love :moominmamma:" + text = "I love :firefox:" expected_result = - "I love \"moominmamma\"" + "I love \"firefox\"" assert Formatter.emojify(text) == expected_result end @@ -269,10 +269,10 @@ test "it does not add XSS emoji" do end test "it returns the emoji used in the text" do - text = "I love :moominmamma:" + text = "I love :firefox:" assert Formatter.get_emoji(text) == [ - {"moominmamma", "/finmoji/128px/moominmamma-128.png", "Finmoji"} + {"firefox", "/emoji/Firefox.gif", ["Gif", "Fun"]} ] end diff --git a/test/healthcheck_test.exs b/test/healthcheck_test.exs new file mode 100644 index 000000000..e05061220 --- /dev/null +++ b/test/healthcheck_test.exs @@ -0,0 +1,22 @@ +defmodule Pleroma.HealthcheckTest do + use Pleroma.DataCase + alias Pleroma.Healthcheck + + test "system_info/0" do + result = Healthcheck.system_info() |> Map.from_struct() + + assert Map.keys(result) == [:active, :healthy, :idle, :memory_used, :pool_size] + end + + describe "check_health/1" do + test "pool size equals active connections" do + result = Healthcheck.check_health(%Healthcheck{pool_size: 10, active: 10}) + refute result.healthy + end + + test "chech_health/1" do + result = Healthcheck.check_health(%Healthcheck{pool_size: 10, active: 9}) + assert result.healthy + end + end +end diff --git a/test/html_test.exs b/test/html_test.exs index 0b5d3d892..08738276e 100644 --- a/test/html_test.exs +++ b/test/html_test.exs @@ -20,6 +20,18 @@ defmodule Pleroma.HTMLTest do """ + @html_span_class_sample """ + hi + """ + + @html_span_microformats_sample """ + @foo + """ + + @html_span_invalid_microformats_sample """ + @foo + """ + describe "StripTags scrubber" do test "works as expected" do expected = """ @@ -64,6 +76,36 @@ test "does not allow attribute-based XSS" do assert expected == HTML.filter_tags(@html_onerror_sample, Pleroma.HTML.Scrubber.TwitterText) end + + test "does not allow spans with invalid classes" do + expected = """ + hi + """ + + assert expected == + HTML.filter_tags(@html_span_class_sample, Pleroma.HTML.Scrubber.TwitterText) + end + + test "does allow microformats" do + expected = """ + @foo + """ + + assert expected == + HTML.filter_tags(@html_span_microformats_sample, Pleroma.HTML.Scrubber.TwitterText) + end + + test "filters invalid microformats markup" do + expected = """ + @foo + """ + + assert expected == + HTML.filter_tags( + @html_span_invalid_microformats_sample, + Pleroma.HTML.Scrubber.TwitterText + ) + end end describe "default scrubber" do @@ -88,5 +130,34 @@ test "does not allow attribute-based XSS" do assert expected == HTML.filter_tags(@html_onerror_sample, Pleroma.HTML.Scrubber.Default) end + + test "does not allow spans with invalid classes" do + expected = """ + hi + """ + + assert expected == HTML.filter_tags(@html_span_class_sample, Pleroma.HTML.Scrubber.Default) + end + + test "does allow microformats" do + expected = """ + @foo + """ + + assert expected == + HTML.filter_tags(@html_span_microformats_sample, Pleroma.HTML.Scrubber.Default) + end + + test "filters invalid microformats markup" do + expected = """ + @foo + """ + + assert expected == + HTML.filter_tags( + @html_span_invalid_microformats_sample, + Pleroma.HTML.Scrubber.Default + ) + end end end diff --git a/test/media_proxy_test.exs b/test/media_proxy_test.exs index ddbadfbf5..a4331478e 100644 --- a/test/media_proxy_test.exs +++ b/test/media_proxy_test.exs @@ -177,4 +177,13 @@ defp decode_result(encoded) do {:ok, decoded} = decode_url(sig, base64) decoded end + + test "mediaproxy whitelist" do + Pleroma.Config.put([:media_proxy, :enabled], true) + Pleroma.Config.put([:media_proxy, :whitelist], ["google.com", "feld.me"]) + url = "https://feld.me/foo.png" + + unencoded = url(url) + assert unencoded == url + end end diff --git a/test/notification_test.exs b/test/notification_test.exs index c3db77b6c..581db58a8 100644 --- a/test/notification_test.exs +++ b/test/notification_test.exs @@ -46,7 +46,7 @@ test "it creates a notification for subscribed users" do describe "create_notification" do test "it doesn't create a notification for user if the user blocks the activity author" do activity = insert(:note_activity) - author = User.get_by_ap_id(activity.data["actor"]) + author = User.get_cached_by_ap_id(activity.data["actor"]) user = insert(:user) {:ok, user} = User.block(user, author) @@ -124,7 +124,7 @@ test "it disables notifications from people the user follows" do test "it doesn't create a notification for user if he is the activity author" do activity = insert(:note_activity) - author = User.get_by_ap_id(activity.data["actor"]) + author = User.get_cached_by_ap_id(activity.data["actor"]) assert nil == Notification.create_notification(activity, author) end diff --git a/test/object/containment_test.exs b/test/object/containment_test.exs new file mode 100644 index 000000000..452064093 --- /dev/null +++ b/test/object/containment_test.exs @@ -0,0 +1,58 @@ +defmodule Pleroma.Object.ContainmentTest do + use Pleroma.DataCase + + alias Pleroma.Object.Containment + alias Pleroma.User + + import Pleroma.Factory + + describe "general origin containment" do + test "contain_origin_from_id() catches obvious spoofing attempts" do + data = %{ + "id" => "http://example.com/~alyssa/activities/1234.json" + } + + :error = + Containment.contain_origin_from_id( + "http://example.org/~alyssa/activities/1234.json", + data + ) + end + + test "contain_origin_from_id() allows alternate IDs within the same origin domain" do + data = %{ + "id" => "http://example.com/~alyssa/activities/1234.json" + } + + :ok = + Containment.contain_origin_from_id( + "http://example.com/~alyssa/activities/1234", + data + ) + end + + test "contain_origin_from_id() allows matching IDs" do + data = %{ + "id" => "http://example.com/~alyssa/activities/1234.json" + } + + :ok = + Containment.contain_origin_from_id( + "http://example.com/~alyssa/activities/1234.json", + data + ) + end + + test "users cannot be collided through fake direction spoofing attempts" do + _user = + insert(:user, %{ + nickname: "rye@niu.moe", + local: false, + ap_id: "https://niu.moe/users/rye", + follower_address: User.ap_followers(%User{nickname: "rye@niu.moe"}) + }) + + {:error, _} = User.get_or_fetch_by_ap_id("https://n1u.moe/users/rye") + end + end +end diff --git a/test/object/fetcher_test.exs b/test/object/fetcher_test.exs new file mode 100644 index 000000000..72f616782 --- /dev/null +++ b/test/object/fetcher_test.exs @@ -0,0 +1,90 @@ +defmodule Pleroma.Object.FetcherTest do + use Pleroma.DataCase + + alias Pleroma.Activity + alias Pleroma.Object + alias Pleroma.Object.Fetcher + import Tesla.Mock + + setup do + mock(fn env -> apply(HttpRequestMock, :request, [env]) end) + :ok + end + + describe "actor origin containment" do + test "it rejects objects with a bogus origin" do + {:error, _} = Fetcher.fetch_object_from_id("https://info.pleroma.site/activity.json") + end + + test "it rejects objects when attributedTo is wrong (variant 1)" do + {:error, _} = Fetcher.fetch_object_from_id("https://info.pleroma.site/activity2.json") + end + + test "it rejects objects when attributedTo is wrong (variant 2)" do + {:error, _} = Fetcher.fetch_object_from_id("https://info.pleroma.site/activity3.json") + end + end + + describe "fetching an object" do + test "it fetches an object" do + {:ok, object} = + Fetcher.fetch_object_from_id("http://mastodon.example.org/@admin/99541947525187367") + + assert activity = Activity.get_create_by_object_ap_id(object.data["id"]) + assert activity.data["id"] + + {:ok, object_again} = + Fetcher.fetch_object_from_id("http://mastodon.example.org/@admin/99541947525187367") + + assert [attachment] = object.data["attachment"] + assert is_list(attachment["url"]) + + assert object == object_again + end + + test "it works with objects only available via Ostatus" do + {:ok, object} = Fetcher.fetch_object_from_id("https://shitposter.club/notice/2827873") + assert activity = Activity.get_create_by_object_ap_id(object.data["id"]) + assert activity.data["id"] + + {:ok, object_again} = Fetcher.fetch_object_from_id("https://shitposter.club/notice/2827873") + + assert object == object_again + end + + test "it correctly stitches up conversations between ostatus and ap" do + last = "https://mstdn.io/users/mayuutann/statuses/99568293732299394" + {:ok, object} = Fetcher.fetch_object_from_id(last) + + object = Object.get_by_ap_id(object.data["inReplyTo"]) + assert object + end + end + + describe "implementation quirks" do + test "it can fetch plume articles" do + {:ok, object} = + Fetcher.fetch_object_from_id( + "https://baptiste.gelez.xyz/~/PlumeDevelopment/this-month-in-plume-june-2018/" + ) + + assert object + end + + test "it can fetch peertube videos" do + {:ok, object} = + Fetcher.fetch_object_from_id( + "https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3" + ) + + assert object + end + + test "all objects with fake directions are rejected by the object fetcher" do + {:error, _} = + Fetcher.fetch_and_contain_remote_object_from_id( + "https://info.pleroma.site/activity4.json" + ) + end + end +end diff --git a/test/object_test.exs b/test/object_test.exs index 911757d57..d138ee091 100644 --- a/test/object_test.exs +++ b/test/object_test.exs @@ -5,9 +5,15 @@ defmodule Pleroma.ObjectTest do use Pleroma.DataCase import Pleroma.Factory + import Tesla.Mock alias Pleroma.Object alias Pleroma.Repo + setup do + mock(fn env -> apply(HttpRequestMock, :request, [env]) end) + :ok + end + test "returns an object by it's AP id" do object = insert(:note) found_object = Object.get_by_ap_id(object.data["id"]) @@ -58,4 +64,26 @@ test "ensures cache is cleared for the object" do assert cached_object.data["type"] == "Tombstone" end end + + describe "normalizer" do + test "fetches unknown objects by default" do + %Object{} = + object = Object.normalize("http://mastodon.example.org/@admin/99541947525187367") + + assert object.data["url"] == "http://mastodon.example.org/@admin/99541947525187367" + end + + test "fetches unknown objects when fetch_remote is explicitly true" do + %Object{} = + object = Object.normalize("http://mastodon.example.org/@admin/99541947525187367", true) + + assert object.data["url"] == "http://mastodon.example.org/@admin/99541947525187367" + end + + test "does not fetch unknown objects when fetch_remote is false" do + assert is_nil( + Object.normalize("http://mastodon.example.org/@admin/99541947525187367", false) + ) + end + end end diff --git a/test/scheduled_activity_worker_test.exs b/test/scheduled_activity_worker_test.exs index b9c91dda6..e3ad1244e 100644 --- a/test/scheduled_activity_worker_test.exs +++ b/test/scheduled_activity_worker_test.exs @@ -14,6 +14,6 @@ test "creates a status from the scheduled activity" do refute Repo.get(ScheduledActivity, scheduled_activity.id) activity = Repo.all(Pleroma.Activity) |> Enum.find(&(&1.actor == user.ap_id)) - assert activity.data["object"]["content"] == "hi" + assert Pleroma.Object.normalize(activity).data["content"] == "hi" end end diff --git a/test/tasks/instance.exs b/test/tasks/instance.exs new file mode 100644 index 000000000..6917a2376 --- /dev/null +++ b/test/tasks/instance.exs @@ -0,0 +1,62 @@ +defmodule Pleroma.InstanceTest do + use ExUnit.Case, async: true + + setup do + File.mkdir_p!(tmp_path()) + on_exit(fn -> File.rm_rf(tmp_path()) end) + :ok + end + + defp tmp_path do + "/tmp/generated_files/" + end + + test "running gen" do + mix_task = fn -> + Mix.Tasks.Pleroma.Instance.run([ + "gen", + "--output", + tmp_path() <> "generated_config.exs", + "--output-psql", + tmp_path() <> "setup.psql", + "--domain", + "test.pleroma.social", + "--instance-name", + "Pleroma", + "--admin-email", + "admin@example.com", + "--notify-email", + "notify@example.com", + "--dbhost", + "dbhost", + "--dbname", + "dbname", + "--dbuser", + "dbuser", + "--dbpass", + "dbpass", + "--indexable", + "y" + ]) + end + + ExUnit.CaptureIO.capture_io(fn -> + mix_task.() + end) + + generated_config = File.read!(tmp_path() <> "generated_config.exs") + assert generated_config =~ "host: \"test.pleroma.social\"" + assert generated_config =~ "name: \"Pleroma\"" + assert generated_config =~ "email: \"admin@example.com\"" + assert generated_config =~ "notify_email: \"notify@example.com\"" + assert generated_config =~ "hostname: \"dbhost\"" + assert generated_config =~ "database: \"dbname\"" + assert generated_config =~ "username: \"dbuser\"" + assert generated_config =~ "password: \"dbpass\"" + assert File.read!(tmp_path() <> "setup.psql") == generated_setup_psql() + end + + defp generated_setup_psql do + ~s(CREATE USER dbuser WITH ENCRYPTED PASSWORD 'dbpass';\nCREATE DATABASE dbname OWNER dbuser;\n\\c dbname;\n--Extensions made by ecto.migrate that need superuser access\nCREATE EXTENSION IF NOT EXISTS citext;\nCREATE EXTENSION IF NOT EXISTS pg_trgm;\nCREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";\n) + end +end diff --git a/test/tasks/relay_test.exs b/test/tasks/relay_test.exs index 535dc3756..9d260da3e 100644 --- a/test/tasks/relay_test.exs +++ b/test/tasks/relay_test.exs @@ -31,7 +31,7 @@ test "relay is followed" do local_user = Relay.get_actor() assert local_user.ap_id =~ "/relay" - target_user = User.get_by_ap_id(target_instance) + target_user = User.get_cached_by_ap_id(target_instance) refute target_user.local activity = Utils.fetch_latest_follow(local_user, target_user) @@ -48,7 +48,7 @@ test "relay is unfollowed" do Mix.Tasks.Pleroma.Relay.run(["follow", target_instance]) %User{ap_id: follower_id} = local_user = Relay.get_actor() - target_user = User.get_by_ap_id(target_instance) + target_user = User.get_cached_by_ap_id(target_instance) follow_activity = Utils.fetch_latest_follow(local_user, target_user) Mix.Tasks.Pleroma.Relay.run(["unfollow", target_instance]) diff --git a/test/tasks/user_test.exs b/test/tasks/user_test.exs index 242265da5..eaf4ecf84 100644 --- a/test/tasks/user_test.exs +++ b/test/tasks/user_test.exs @@ -50,7 +50,7 @@ test "user is created" do assert_received {:mix_shell, :info, [message]} assert message =~ "created" - user = User.get_by_nickname(unsaved.nickname) + user = User.get_cached_by_nickname(unsaved.nickname) assert user.name == unsaved.name assert user.email == unsaved.email assert user.bio == unsaved.bio @@ -75,7 +75,7 @@ test "user is not created" do assert_received {:mix_shell, :info, [message]} assert message =~ "will not be created" - refute User.get_by_nickname(unsaved.nickname) + refute User.get_cached_by_nickname(unsaved.nickname) end end @@ -88,7 +88,7 @@ test "user is deleted" do assert_received {:mix_shell, :info, [message]} assert message =~ " deleted" - user = User.get_by_nickname(user.nickname) + user = User.get_cached_by_nickname(user.nickname) assert user.info.deactivated end @@ -109,7 +109,7 @@ test "user is deactivated" do assert_received {:mix_shell, :info, [message]} assert message =~ " deactivated" - user = User.get_by_nickname(user.nickname) + user = User.get_cached_by_nickname(user.nickname) assert user.info.deactivated end @@ -121,7 +121,7 @@ test "user is activated" do assert_received {:mix_shell, :info, [message]} assert message =~ " activated" - user = User.get_by_nickname(user.nickname) + user = User.get_cached_by_nickname(user.nickname) refute user.info.deactivated end @@ -150,7 +150,7 @@ test "user is unsubscribed" do assert_received {:mix_shell, :info, [message]} assert message =~ "Successfully unsubscribed" - user = User.get_by_nickname(user.nickname) + user = User.get_cached_by_nickname(user.nickname) assert Enum.empty?(user.following) assert user.info.deactivated end @@ -178,7 +178,7 @@ test "All statuses set" do assert_received {:mix_shell, :info, [message]} assert message =~ ~r/Admin status .* true/ - user = User.get_by_nickname(user.nickname) + user = User.get_cached_by_nickname(user.nickname) assert user.info.is_moderator assert user.info.locked assert user.info.is_admin @@ -204,7 +204,7 @@ test "All statuses unset" do assert_received {:mix_shell, :info, [message]} assert message =~ ~r/Admin status .* false/ - user = User.get_by_nickname(user.nickname) + user = User.get_cached_by_nickname(user.nickname) refute user.info.is_moderator refute user.info.locked refute user.info.is_admin diff --git a/test/user_test.exs b/test/user_test.exs index d2167a970..7be47e5fb 100644 --- a/test/user_test.exs +++ b/test/user_test.exs @@ -5,6 +5,7 @@ defmodule Pleroma.UserTest do alias Pleroma.Activity alias Pleroma.Builders.UserBuilder + alias Pleroma.Object alias Pleroma.Repo alias Pleroma.User alias Pleroma.Web.CommonAPI @@ -122,9 +123,9 @@ test "follow takes a user and another user" do {:ok, user} = User.follow(user, followed) - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) - followed = User.get_by_ap_id(followed.ap_id) + followed = User.get_cached_by_ap_id(followed.ap_id) assert followed.info.follower_count == 1 assert User.ap_followers(followed) in user.following @@ -187,7 +188,7 @@ test "unfollow takes a user and another user" do {:ok, user, _activity} = User.unfollow(user, followed) - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) assert user.following == [] end @@ -197,7 +198,7 @@ test "unfollow doesn't unfollow yourself" do {:error, _} = User.unfollow(user, user) - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) assert user.following == [user.ap_id] end @@ -256,7 +257,7 @@ test "it sends a welcome message if it is set" do activity = Repo.one(Pleroma.Activity) assert registered_user.ap_id in activity.recipients - assert activity.data["object"]["content"] =~ "cool site" + assert Object.normalize(activity).data["content"] =~ "cool site" assert activity.actor == welcome_user.ap_id Pleroma.Config.put([:instance, :welcome_user_nickname], nil) @@ -555,8 +556,8 @@ test "gets all friends (followed users) for a given user" do {:ok, res} = User.get_friends(user) - followed_one = User.get_by_ap_id(followed_one.ap_id) - followed_two = User.get_by_ap_id(followed_two.ap_id) + followed_one = User.get_cached_by_ap_id(followed_one.ap_id) + followed_two = User.get_cached_by_ap_id(followed_two.ap_id) assert Enum.member?(res, followed_one) assert Enum.member?(res, followed_two) refute Enum.member?(res, not_followed) @@ -567,7 +568,7 @@ test "gets all friends (followed users) for a given user" do test "it sets the info->note_count property" do note = insert(:note) - user = User.get_by_ap_id(note.data["actor"]) + user = User.get_cached_by_ap_id(note.data["actor"]) assert user.info.note_count == 0 @@ -578,7 +579,7 @@ test "it sets the info->note_count property" do test "it increases the info->note_count property" do note = insert(:note) - user = User.get_by_ap_id(note.data["actor"]) + user = User.get_cached_by_ap_id(note.data["actor"]) assert user.info.note_count == 0 @@ -593,7 +594,7 @@ test "it increases the info->note_count property" do test "it decreases the info->note_count property" do note = insert(:note) - user = User.get_by_ap_id(note.data["actor"]) + user = User.get_cached_by_ap_id(note.data["actor"]) assert user.info.note_count == 0 @@ -695,7 +696,7 @@ test "blocks tear down cyclical follow relationships" do assert User.following?(blocked, blocker) {:ok, blocker} = User.block(blocker, blocked) - blocked = User.get_by_id(blocked.id) + blocked = User.get_cached_by_id(blocked.id) assert User.blocks?(blocker, blocked) @@ -713,7 +714,7 @@ test "blocks tear down blocker->blocked follow relationships" do refute User.following?(blocked, blocker) {:ok, blocker} = User.block(blocker, blocked) - blocked = User.get_by_id(blocked.id) + blocked = User.get_cached_by_id(blocked.id) assert User.blocks?(blocker, blocked) @@ -731,7 +732,7 @@ test "blocks tear down blocked->blocker follow relationships" do assert User.following?(blocked, blocker) {:ok, blocker} = User.block(blocker, blocked) - blocked = User.get_by_id(blocked.id) + blocked = User.get_cached_by_id(blocked.id) assert User.blocks?(blocker, blocked) @@ -851,9 +852,9 @@ test ".delete deactivates a user, all follow relationships and all create activi {:ok, _} = User.delete(user) - followed = User.get_by_id(followed.id) - follower = User.get_by_id(follower.id) - user = User.get_by_id(user.id) + followed = User.get_cached_by_id(followed.id) + follower = User.get_cached_by_id(follower.id) + user = User.get_cached_by_id(user.id) assert user.info.deactivated @@ -1007,7 +1008,7 @@ test "works with URIs" do results = User.search("http://mastodon.example.org/users/admin", resolve: true) result = results |> List.first() - user = User.get_by_ap_id("http://mastodon.example.org/users/admin") + user = User.get_cached_by_ap_id("http://mastodon.example.org/users/admin") assert length(results) == 1 assert user == result |> Map.put(:search_rank, nil) |> Map.put(:search_type, nil) @@ -1124,33 +1125,6 @@ test "Adds rel=me on linkbacked urls" do end end - test "bookmarks" do - user = insert(:user) - - {:ok, activity1} = - CommonAPI.post(user, %{ - "status" => "heweoo!" - }) - - id1 = activity1.data["object"]["id"] - - {:ok, activity2} = - CommonAPI.post(user, %{ - "status" => "heweoo!" - }) - - id2 = activity2.data["object"]["id"] - - assert {:ok, user_state1} = User.bookmark(user, id1) - assert user_state1.bookmarks == [id1] - - assert {:ok, user_state2} = User.unbookmark(user, id1) - assert user_state2.bookmarks == [] - - assert {:ok, user_state3} = User.bookmark(user, id2) - assert user_state3.bookmarks == [id2] - end - test "follower count is updated when a follower is blocked" do user = insert(:user) follower = insert(:user) diff --git a/test/web/activity_pub/activity_pub_controller_test.exs b/test/web/activity_pub/activity_pub_controller_test.exs index 8dd8e7e0a..30adfda36 100644 --- a/test/web/activity_pub/activity_pub_controller_test.exs +++ b/test/web/activity_pub/activity_pub_controller_test.exs @@ -50,7 +50,7 @@ test "it returns a json representation of the user with accept application/json" |> put_req_header("accept", "application/json") |> get("/users/#{user.nickname}") - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) assert json_response(conn, 200) == UserView.render("user.json", %{user: user}) end @@ -65,7 +65,7 @@ test "it returns a json representation of the user with accept application/activ |> put_req_header("accept", "application/activity+json") |> get("/users/#{user.nickname}") - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) assert json_response(conn, 200) == UserView.render("user.json", %{user: user}) end @@ -83,7 +83,7 @@ test "it returns a json representation of the user with accept application/ld+js ) |> get("/users/#{user.nickname}") - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) assert json_response(conn, 200) == UserView.render("user.json", %{user: user}) end @@ -253,6 +253,36 @@ test "it inserts an incoming activity into the database", %{conn: conn} do assert Activity.get_by_ap_id(data["id"]) end + test "it accepts messages from actors that are followed by the user", %{conn: conn} do + recipient = insert(:user) + actor = insert(:user, %{ap_id: "http://mastodon.example.org/users/actor"}) + + {:ok, recipient} = User.follow(recipient, actor) + + data = + File.read!("test/fixtures/mastodon-post-activity.json") + |> Poison.decode!() + + object = + data["object"] + |> Map.put("attributedTo", actor.ap_id) + + data = + data + |> Map.put("actor", actor.ap_id) + |> Map.put("object", object) + + conn = + conn + |> assign(:valid_signature, true) + |> put_req_header("content-type", "application/activity+json") + |> post("/users/#{recipient.nickname}/inbox", data) + + assert "ok" == json_response(conn, 200) + :timer.sleep(500) + assert Activity.get_by_ap_id(data["id"]) + end + test "it rejects reads from other users", %{conn: conn} do user = insert(:user) otheruser = insert(:user) @@ -542,7 +572,7 @@ test "it works for more than 10 users", %{conn: conn} do user = insert(:user) Enum.each(1..15, fn _ -> - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) other_user = insert(:user) User.follow(user, other_user) end) diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs index 17fec05b1..f8e987e58 100644 --- a/test/web/activity_pub/activity_pub_test.exs +++ b/test/web/activity_pub/activity_pub_test.exs @@ -84,17 +84,21 @@ test "it fetches the appropriate tag-restricted posts" do {:ok, status_two} = CommonAPI.post(user, %{"status" => ". #essais"}) {:ok, status_three} = CommonAPI.post(user, %{"status" => ". #test #reject"}) - fetch_one = ActivityPub.fetch_activities([], %{"tag" => "test"}) - fetch_two = ActivityPub.fetch_activities([], %{"tag" => ["test", "essais"]}) + fetch_one = ActivityPub.fetch_activities([], %{"type" => "Create", "tag" => "test"}) + + fetch_two = + ActivityPub.fetch_activities([], %{"type" => "Create", "tag" => ["test", "essais"]}) fetch_three = ActivityPub.fetch_activities([], %{ + "type" => "Create", "tag" => ["test", "essais"], "tag_reject" => ["reject"] }) fetch_four = ActivityPub.fetch_activities([], %{ + "type" => "Create", "tag" => ["test"], "tag_all" => ["test", "reject"] }) @@ -192,8 +196,10 @@ test "adds an id to a given object if it lacks one and is a note and inserts it } {:ok, %Activity{} = activity} = ActivityPub.insert(data) - assert is_binary(activity.data["object"]["id"]) - assert %Object{} = Object.get_by_ap_id(activity.data["object"]["id"]) + object = Object.normalize(activity.data["object"]) + + assert is_binary(object.data["id"]) + assert %Object{} = Object.get_by_ap_id(activity.data["object"]) end end @@ -206,7 +212,11 @@ test "removes doubled 'to' recipients" do to: ["user1", "user1", "user2"], actor: user, context: "", - object: %{} + object: %{ + "to" => ["user1", "user1", "user2"], + "type" => "Note", + "content" => "testing" + } }) assert activity.data["to"] == ["user1", "user2"] @@ -218,18 +228,30 @@ test "increases user note count only for public activities" do user = insert(:user) {:ok, _} = - CommonAPI.post(User.get_by_id(user.id), %{"status" => "1", "visibility" => "public"}) + CommonAPI.post(User.get_cached_by_id(user.id), %{ + "status" => "1", + "visibility" => "public" + }) {:ok, _} = - CommonAPI.post(User.get_by_id(user.id), %{"status" => "2", "visibility" => "unlisted"}) + CommonAPI.post(User.get_cached_by_id(user.id), %{ + "status" => "2", + "visibility" => "unlisted" + }) {:ok, _} = - CommonAPI.post(User.get_by_id(user.id), %{"status" => "2", "visibility" => "private"}) + CommonAPI.post(User.get_cached_by_id(user.id), %{ + "status" => "2", + "visibility" => "private" + }) {:ok, _} = - CommonAPI.post(User.get_by_id(user.id), %{"status" => "3", "visibility" => "direct"}) + CommonAPI.post(User.get_cached_by_id(user.id), %{ + "status" => "3", + "visibility" => "direct" + }) - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) assert user.info.note_count == 2 end @@ -244,25 +266,21 @@ test "increases replies count" do # public {:ok, _} = CommonAPI.post(user2, Map.put(reply_data, "visibility", "public")) assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id) - assert data["object"]["repliesCount"] == 1 assert object.data["repliesCount"] == 1 # unlisted {:ok, _} = CommonAPI.post(user2, Map.put(reply_data, "visibility", "unlisted")) assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id) - assert data["object"]["repliesCount"] == 2 assert object.data["repliesCount"] == 2 # private {:ok, _} = CommonAPI.post(user2, Map.put(reply_data, "visibility", "private")) assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id) - assert data["object"]["repliesCount"] == 2 assert object.data["repliesCount"] == 2 # direct {:ok, _} = CommonAPI.post(user2, Map.put(reply_data, "visibility", "direct")) assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id) - assert data["object"]["repliesCount"] == 2 assert object.data["repliesCount"] == 2 end end @@ -341,6 +359,51 @@ test "doesn't return blocked activities" do assert Enum.member?(activities, activity_one) end + test "doesn't return transitive interactions concerning blocked users" do + blocker = insert(:user) + blockee = insert(:user) + friend = insert(:user) + + {:ok, blocker} = User.block(blocker, blockee) + + {:ok, activity_one} = CommonAPI.post(friend, %{"status" => "hey!"}) + + {:ok, activity_two} = CommonAPI.post(friend, %{"status" => "hey! @#{blockee.nickname}"}) + + {:ok, activity_three} = CommonAPI.post(blockee, %{"status" => "hey! @#{friend.nickname}"}) + + {:ok, activity_four} = CommonAPI.post(blockee, %{"status" => "hey! @#{blocker.nickname}"}) + + activities = ActivityPub.fetch_activities([], %{"blocking_user" => blocker}) + + assert Enum.member?(activities, activity_one) + refute Enum.member?(activities, activity_two) + refute Enum.member?(activities, activity_three) + refute Enum.member?(activities, activity_four) + end + + test "doesn't return announce activities concerning blocked users" do + blocker = insert(:user) + blockee = insert(:user) + friend = insert(:user) + + {:ok, blocker} = User.block(blocker, blockee) + + {:ok, activity_one} = CommonAPI.post(friend, %{"status" => "hey!"}) + + {:ok, activity_two} = CommonAPI.post(blockee, %{"status" => "hey! @#{friend.nickname}"}) + + {:ok, activity_three, _} = CommonAPI.repeat(activity_two.id, friend) + + activities = + ActivityPub.fetch_activities([], %{"blocking_user" => blocker}) + |> Enum.map(fn act -> act.id end) + + assert Enum.member?(activities, activity_one.id) + refute Enum.member?(activities, activity_two.id) + refute Enum.member?(activities, activity_three.id) + end + test "doesn't return muted activities" do activity_one = insert(:note_activity) activity_two = insert(:note_activity) @@ -635,40 +698,13 @@ test "works with base64 encoded images" do end end - describe "fetching an object" do - test "it fetches an object" do - {:ok, object} = - ActivityPub.fetch_object_from_id("http://mastodon.example.org/@admin/99541947525187367") + describe "fetch the latest Follow" do + test "fetches the latest Follow activity" do + %Activity{data: %{"type" => "Follow"}} = activity = insert(:follow_activity) + follower = Repo.get_by(User, ap_id: activity.data["actor"]) + followed = Repo.get_by(User, ap_id: activity.data["object"]) - assert activity = Activity.get_create_by_object_ap_id(object.data["id"]) - assert activity.data["id"] - - {:ok, object_again} = - ActivityPub.fetch_object_from_id("http://mastodon.example.org/@admin/99541947525187367") - - assert [attachment] = object.data["attachment"] - assert is_list(attachment["url"]) - - assert object == object_again - end - - test "it works with objects only available via Ostatus" do - {:ok, object} = ActivityPub.fetch_object_from_id("https://shitposter.club/notice/2827873") - assert activity = Activity.get_create_by_object_ap_id(object.data["id"]) - assert activity.data["id"] - - {:ok, object_again} = - ActivityPub.fetch_object_from_id("https://shitposter.club/notice/2827873") - - assert object == object_again - end - - test "it correctly stitches up conversations between ostatus and ap" do - last = "https://mstdn.io/users/mayuutann/statuses/99568293732299394" - {:ok, object} = ActivityPub.fetch_object_from_id(last) - - object = Object.get_by_ap_id(object.data["inReplyTo"]) - assert object + assert activity == Utils.fetch_latest_follow(follower, followed) end end @@ -748,23 +784,35 @@ test "decrements user note count only for public activities" do user = insert(:user, info: %{note_count: 10}) {:ok, a1} = - CommonAPI.post(User.get_by_id(user.id), %{"status" => "yeah", "visibility" => "public"}) + CommonAPI.post(User.get_cached_by_id(user.id), %{ + "status" => "yeah", + "visibility" => "public" + }) {:ok, a2} = - CommonAPI.post(User.get_by_id(user.id), %{"status" => "yeah", "visibility" => "unlisted"}) + CommonAPI.post(User.get_cached_by_id(user.id), %{ + "status" => "yeah", + "visibility" => "unlisted" + }) {:ok, a3} = - CommonAPI.post(User.get_by_id(user.id), %{"status" => "yeah", "visibility" => "private"}) + CommonAPI.post(User.get_cached_by_id(user.id), %{ + "status" => "yeah", + "visibility" => "private" + }) {:ok, a4} = - CommonAPI.post(User.get_by_id(user.id), %{"status" => "yeah", "visibility" => "direct"}) + CommonAPI.post(User.get_cached_by_id(user.id), %{ + "status" => "yeah", + "visibility" => "direct" + }) - {:ok, _} = a1.data["object"]["id"] |> Object.get_by_ap_id() |> ActivityPub.delete() - {:ok, _} = a2.data["object"]["id"] |> Object.get_by_ap_id() |> ActivityPub.delete() - {:ok, _} = a3.data["object"]["id"] |> Object.get_by_ap_id() |> ActivityPub.delete() - {:ok, _} = a4.data["object"]["id"] |> Object.get_by_ap_id() |> ActivityPub.delete() + {:ok, _} = Object.normalize(a1) |> ActivityPub.delete() + {:ok, _} = Object.normalize(a2) |> ActivityPub.delete() + {:ok, _} = Object.normalize(a3) |> ActivityPub.delete() + {:ok, _} = Object.normalize(a4) |> ActivityPub.delete() - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) assert user.info.note_count == 10 end @@ -804,22 +852,18 @@ test "decreases reply count" do _ = CommonAPI.delete(direct_reply.id, user2) assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id) - assert data["object"]["repliesCount"] == 2 assert object.data["repliesCount"] == 2 _ = CommonAPI.delete(private_reply.id, user2) assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id) - assert data["object"]["repliesCount"] == 2 assert object.data["repliesCount"] == 2 _ = CommonAPI.delete(public_reply.id, user2) assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id) - assert data["object"]["repliesCount"] == 1 assert object.data["repliesCount"] == 1 _ = CommonAPI.delete(unlisted_reply.id, user2) assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id) - assert data["object"]["repliesCount"] == 0 assert object.data["repliesCount"] == 0 end end @@ -861,7 +905,10 @@ test "it filters broken threads" do activities = ActivityPub.fetch_activities([user1.ap_id | user1.following]) private_activity_1 = Activity.get_by_ap_id_with_object(private_activity_1.data["id"]) - assert [public_activity, private_activity_1, private_activity_3] == activities + + assert [public_activity, private_activity_1, private_activity_3] == + activities + assert length(activities) == 3 activities = ActivityPub.contain_timeline(activities, user1) @@ -871,15 +918,6 @@ test "it filters broken threads" do end end - test "it can fetch plume articles" do - {:ok, object} = - ActivityPub.fetch_object_from_id( - "https://baptiste.gelez.xyz/~/PlumeDevelopment/this-month-in-plume-june-2018/" - ) - - assert object - end - describe "update" do test "it creates an update activity with the new user data" do user = insert(:user) @@ -901,15 +939,6 @@ test "it creates an update activity with the new user data" do end end - test "it can fetch peertube videos" do - {:ok, object} = - ActivityPub.fetch_object_from_id( - "https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3" - ) - - assert object - end - test "returned pinned statuses" do Pleroma.Config.put([:instance, :max_pinned_statuses], 3) user = insert(:user) diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs index 47cffe257..78429c7c6 100644 --- a/test/web/activity_pub/transmogrifier_test.exs +++ b/test/web/activity_pub/transmogrifier_test.exs @@ -6,6 +6,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do use Pleroma.DataCase alias Pleroma.Activity alias Pleroma.Object + alias Pleroma.Object.Fetcher alias Pleroma.Repo alias Pleroma.User alias Pleroma.Web.ActivityPub.ActivityPub @@ -50,16 +51,14 @@ test "it fetches replied-to activities if we don't have them" do |> Map.put("object", object) {:ok, returned_activity} = Transmogrifier.handle_incoming(data) + returned_object = Object.normalize(returned_activity.data["object"]) assert activity = Activity.get_create_by_object_ap_id( "tag:shitposter.club,2017-05-05:noticeId=2827873:objectType=comment" ) - assert returned_activity.data["object"]["inReplyToAtomUri"] == - "https://shitposter.club/notice/2827873" - - assert returned_activity.data["object"]["inReplyToStatusId"] == activity.id + assert returned_object.data["inReplyToAtomUri"] == "https://shitposter.club/notice/2827873" end test "it works for incoming notices" do @@ -82,7 +81,7 @@ test "it works for incoming notices" do assert data["actor"] == "http://mastodon.example.org/users/admin" - object = data["object"] + object = Object.normalize(data["object"]).data assert object["id"] == "http://mastodon.example.org/users/admin/statuses/99512778738411822" assert object["to"] == ["https://www.w3.org/ns/activitystreams#Public"] @@ -100,7 +99,7 @@ test "it works for incoming notices" do assert object["sensitive"] == true - user = User.get_by_ap_id(object["actor"]) + user = User.get_cached_by_ap_id(object["actor"]) assert user.info.note_count == 1 end @@ -109,7 +108,9 @@ test "it works for incoming notices with hashtags" do data = File.read!("test/fixtures/mastodon-post-activity-hashtag.json") |> Poison.decode!() {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) - assert Enum.at(data["object"]["tag"], 2) == "moo" + object = Object.normalize(data["object"]) + + assert Enum.at(object.data["tag"], 2) == "moo" end test "it works for incoming notices with contentMap" do @@ -117,8 +118,9 @@ test "it works for incoming notices with contentMap" do File.read!("test/fixtures/mastodon-post-activity-contentmap.json") |> Poison.decode!() {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) + object = Object.normalize(data["object"]) - assert data["object"]["content"] == + assert object.data["content"] == "

@lain

" end @@ -126,8 +128,9 @@ test "it works for incoming notices with to/cc not being an array (kroeg)" do data = File.read!("test/fixtures/kroeg-post-activity.json") |> Poison.decode!() {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) + object = Object.normalize(data["object"]) - assert data["object"]["content"] == + assert object.data["content"] == "

henlo from my Psion netBook

message sent from my Psion netBook

" end @@ -143,24 +146,27 @@ test "it works for incoming notices with tag not being an array (kroeg)" do data = File.read!("test/fixtures/kroeg-array-less-emoji.json") |> Poison.decode!() {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) + object = Object.normalize(data["object"]) - assert data["object"]["emoji"] == %{ + assert object.data["emoji"] == %{ "icon_e_smile" => "https://puckipedia.com/forum/images/smilies/icon_e_smile.png" } data = File.read!("test/fixtures/kroeg-array-less-hashtag.json") |> Poison.decode!() {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) + object = Object.normalize(data["object"]) - assert "test" in data["object"]["tag"] + assert "test" in object.data["tag"] end test "it works for incoming notices with url not being a string (prismo)" do data = File.read!("test/fixtures/prismo-url-map.json") |> Poison.decode!() {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) + object = Object.normalize(data["object"]) - assert data["object"]["url"] == "https://prismo.news/posts/83" + assert object.data["url"] == "https://prismo.news/posts/83" end test "it cleans up incoming notices which are not really DMs" do @@ -182,15 +188,15 @@ test "it cleans up incoming notices which are not really DMs" do data = Map.put(data, "object", object) - {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) + {:ok, %Activity{data: data, local: false} = activity} = Transmogrifier.handle_incoming(data) assert data["to"] == [] assert data["cc"] == to - object = data["object"] + object_data = Object.normalize(activity).data - assert object["to"] == [] - assert object["cc"] == to + assert object_data["to"] == [] + assert object_data["cc"] == to end test "it works for incoming follow requests" do @@ -206,7 +212,27 @@ test "it works for incoming follow requests" do assert data["actor"] == "http://mastodon.example.org/users/admin" assert data["type"] == "Follow" assert data["id"] == "http://mastodon.example.org/users/admin#follows/2" - assert User.following?(User.get_by_ap_id(data["actor"]), user) + assert User.following?(User.get_cached_by_ap_id(data["actor"]), user) + end + + test "it rejects incoming follow requests from blocked users when deny_follow_blocked is enabled" do + Pleroma.Config.put([:user, :deny_follow_blocked], true) + + user = insert(:user) + target = User.get_or_fetch("http://mastodon.example.org/users/admin") + + {:ok, user} = User.block(user, target) + + data = + File.read!("test/fixtures/mastodon-follow-activity.json") + |> Poison.decode!() + |> Map.put("object", user.ap_id) + + {:ok, %Activity{data: %{"id" => id}}} = Transmogrifier.handle_incoming(data) + + %Activity{} = activity = Activity.get_by_ap_id(id) + + assert activity.data["state"] == "reject" end test "it works for incoming follow requests from hubzilla" do @@ -223,7 +249,7 @@ test "it works for incoming follow requests from hubzilla" do assert data["actor"] == "https://hubzilla.example.org/channel/kaniini" assert data["type"] == "Follow" assert data["id"] == "https://hubzilla.example.org/channel/kaniini#follows/2" - assert User.following?(User.get_by_ap_id(data["actor"]), user) + assert User.following?(User.get_cached_by_ap_id(data["actor"]), user) end test "it works for incoming likes" do @@ -233,14 +259,14 @@ test "it works for incoming likes" do data = File.read!("test/fixtures/mastodon-like.json") |> Poison.decode!() - |> Map.put("object", activity.data["object"]["id"]) + |> Map.put("object", activity.data["object"]) {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) assert data["actor"] == "http://mastodon.example.org/users/admin" assert data["type"] == "Like" assert data["id"] == "http://mastodon.example.org/users/admin#likes/2" - assert data["object"] == activity.data["object"]["id"] + assert data["object"] == activity.data["object"] end test "it returns an error for incoming unlikes wihout a like activity" do @@ -250,7 +276,7 @@ test "it returns an error for incoming unlikes wihout a like activity" do data = File.read!("test/fixtures/mastodon-undo-like.json") |> Poison.decode!() - |> Map.put("object", activity.data["object"]["id"]) + |> Map.put("object", activity.data["object"]) assert Transmogrifier.handle_incoming(data) == :error end @@ -262,7 +288,7 @@ test "it works for incoming unlikes with an existing like activity" do like_data = File.read!("test/fixtures/mastodon-like.json") |> Poison.decode!() - |> Map.put("object", activity.data["object"]["id"]) + |> Map.put("object", activity.data["object"]) {:ok, %Activity{data: like_data, local: false}} = Transmogrifier.handle_incoming(like_data) @@ -304,7 +330,7 @@ test "it works for incoming announces with an existing activity" do data = File.read!("test/fixtures/mastodon-announce.json") |> Poison.decode!() - |> Map.put("object", activity.data["object"]["id"]) + |> Map.put("object", activity.data["object"]) {:ok, %Activity{data: data, local: false}} = Transmogrifier.handle_incoming(data) @@ -314,7 +340,7 @@ test "it works for incoming announces with an existing activity" do assert data["id"] == "http://mastodon.example.org/users/admin/statuses/99542391527669785/activity" - assert data["object"] == activity.data["object"]["id"] + assert data["object"] == activity.data["object"] assert Activity.get_create_by_object_ap_id(data["object"]).id == activity.id end @@ -326,7 +352,7 @@ test "it does not clobber the addressing on announce activities" do data = File.read!("test/fixtures/mastodon-announce.json") |> Poison.decode!() - |> Map.put("object", activity.data["object"]["id"]) + |> Map.put("object", Object.normalize(activity).data["id"]) |> Map.put("to", ["http://mastodon.example.org/users/admin/followers"]) |> Map.put("cc", []) @@ -452,7 +478,7 @@ test "it works for incoming deletes" do object = data["object"] - |> Map.put("id", activity.data["object"]["id"]) + |> Map.put("id", activity.data["object"]) data = data @@ -473,7 +499,7 @@ test "it fails for incoming deletes with spoofed origin" do object = data["object"] - |> Map.put("id", activity.data["object"]["id"]) + |> Map.put("id", activity.data["object"]) data = data @@ -491,7 +517,7 @@ test "it works for incoming unannounces with an existing notice" do announce_data = File.read!("test/fixtures/mastodon-announce.json") |> Poison.decode!() - |> Map.put("object", activity.data["object"]["id"]) + |> Map.put("object", activity.data["object"]) {:ok, %Activity{data: announce_data, local: false}} = Transmogrifier.handle_incoming(announce_data) @@ -506,7 +532,7 @@ test "it works for incoming unannounces with an existing notice" do assert data["type"] == "Undo" assert data["object"]["type"] == "Announce" - assert data["object"]["object"] == activity.data["object"]["id"] + assert data["object"]["object"] == activity.data["object"] assert data["object"]["id"] == "http://mastodon.example.org/users/admin/statuses/99542391527669785/activity" @@ -534,7 +560,7 @@ test "it works for incomming unfollows with an existing follow" do assert data["object"]["object"] == user.ap_id assert data["actor"] == "http://mastodon.example.org/users/admin" - refute User.following?(User.get_by_ap_id(data["actor"]), user) + refute User.following?(User.get_cached_by_ap_id(data["actor"]), user) end test "it works for incoming blocks" do @@ -551,7 +577,7 @@ test "it works for incoming blocks" do assert data["object"] == user.ap_id assert data["actor"] == "http://mastodon.example.org/users/admin" - blocker = User.get_by_ap_id(data["actor"]) + blocker = User.get_cached_by_ap_id(data["actor"]) assert User.blocks?(blocker, user) end @@ -578,8 +604,8 @@ test "incoming blocks successfully tear down any follow relationship" do assert data["object"] == blocked.ap_id assert data["actor"] == blocker.ap_id - blocker = User.get_by_ap_id(data["actor"]) - blocked = User.get_by_ap_id(data["object"]) + blocker = User.get_cached_by_ap_id(data["actor"]) + blocked = User.get_cached_by_ap_id(data["object"]) assert User.blocks?(blocker, blocked) @@ -608,7 +634,7 @@ test "it works for incoming unblocks with an existing block" do assert data["object"]["object"] == user.ap_id assert data["actor"] == "http://mastodon.example.org/users/admin" - blocker = User.get_by_ap_id(data["actor"]) + blocker = User.get_cached_by_ap_id(data["actor"]) refute User.blocks?(blocker, user) end @@ -639,7 +665,7 @@ test "it works for incoming accepts which were pre-accepted" do assert activity.data["object"] == follow_activity.data["id"] - follower = User.get_by_id(follower.id) + follower = User.get_cached_by_id(follower.id) assert User.following?(follower, followed) == true end @@ -661,7 +687,7 @@ test "it works for incoming accepts which were orphaned" do {:ok, activity} = Transmogrifier.handle_incoming(accept_data) assert activity.data["object"] == follow_activity.data["id"] - follower = User.get_by_id(follower.id) + follower = User.get_cached_by_id(follower.id) assert User.following?(follower, followed) == true end @@ -681,7 +707,7 @@ test "it works for incoming accepts which are referenced by IRI only" do {:ok, activity} = Transmogrifier.handle_incoming(accept_data) assert activity.data["object"] == follow_activity.data["id"] - follower = User.get_by_id(follower.id) + follower = User.get_cached_by_id(follower.id) assert User.following?(follower, followed) == true end @@ -700,7 +726,7 @@ test "it fails for incoming accepts which cannot be correlated" do :error = Transmogrifier.handle_incoming(accept_data) - follower = User.get_by_id(follower.id) + follower = User.get_cached_by_id(follower.id) refute User.following?(follower, followed) == true end @@ -719,7 +745,7 @@ test "it fails for incoming rejects which cannot be correlated" do :error = Transmogrifier.handle_incoming(accept_data) - follower = User.get_by_id(follower.id) + follower = User.get_cached_by_id(follower.id) refute User.following?(follower, followed) == true end @@ -744,7 +770,7 @@ test "it works for incoming rejects which are orphaned" do {:ok, activity} = Transmogrifier.handle_incoming(reject_data) refute activity.local - follower = User.get_by_id(follower.id) + follower = User.get_cached_by_id(follower.id) assert User.following?(follower, followed) == false end @@ -766,7 +792,7 @@ test "it works for incoming rejects which are referenced by IRI only" do {:ok, %Activity{data: _}} = Transmogrifier.handle_incoming(reject_data) - follower = User.get_by_id(follower.id) + follower = User.get_cached_by_id(follower.id) assert User.following?(follower, followed) == false end @@ -785,7 +811,7 @@ test "it rejects activities without a valid ID" do test "it remaps video URLs as attachments if necessary" do {:ok, object} = - ActivityPub.fetch_object_from_id( + Fetcher.fetch_object_from_id( "https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3" ) @@ -940,7 +966,7 @@ test "it strips internal hashtag data" do test "it strips internal fields" do user = insert(:user) - {:ok, activity} = CommonAPI.post(user, %{"status" => "#2hu :moominmamma:"}) + {:ok, activity} = CommonAPI.post(user, %{"status" => "#2hu :firefox:"}) {:ok, modified} = Transmogrifier.prepare_outgoing(activity.data) @@ -1020,7 +1046,7 @@ test "it upgrades a user to activitypub" do {:ok, unrelated_activity} = CommonAPI.post(user_two, %{"status" => "test"}) assert "http://localhost:4001/users/rye@niu.moe/followers" in activity.recipients - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) assert user.info.note_count == 1 {:ok, user} = Transmogrifier.upgrade_user_from_ap_id("https://niu.moe/users/rye") @@ -1028,7 +1054,7 @@ test "it upgrades a user to activitypub" do assert user.info.note_count == 1 assert user.follower_address == "https://niu.moe/users/rye/followers" - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) assert user.info.note_count == 1 activity = Activity.get_by_id(activity.id) @@ -1057,7 +1083,7 @@ test "it upgrades a user to activitypub" do unrelated_activity = Activity.get_by_id(unrelated_activity.id) refute user.follower_address in unrelated_activity.recipients - user_two = User.get_by_id(user_two.id) + user_two = User.get_cached_by_id(user_two.id) assert user.follower_address in user_two.following refute "..." in user_two.following end @@ -1090,10 +1116,6 @@ test "it fixes the actor URL property to be a proper URI" do end describe "actor origin containment" do - test "it rejects objects with a bogus origin" do - {:error, _} = ActivityPub.fetch_object_from_id("https://info.pleroma.site/activity.json") - end - test "it rejects activities which reference objects with bogus origins" do data = %{ "@context" => "https://www.w3.org/ns/activitystreams", @@ -1107,10 +1129,6 @@ test "it rejects activities which reference objects with bogus origins" do :error = Transmogrifier.handle_incoming(data) end - test "it rejects objects when attributedTo is wrong (variant 1)" do - {:error, _} = ActivityPub.fetch_object_from_id("https://info.pleroma.site/activity2.json") - end - test "it rejects activities which reference objects that have an incorrect attribution (variant 1)" do data = %{ "@context" => "https://www.w3.org/ns/activitystreams", @@ -1124,10 +1142,6 @@ test "it rejects activities which reference objects that have an incorrect attri :error = Transmogrifier.handle_incoming(data) end - test "it rejects objects when attributedTo is wrong (variant 2)" do - {:error, _} = ActivityPub.fetch_object_from_id("https://info.pleroma.site/activity3.json") - end - test "it rejects activities which reference objects that have an incorrect attribution (variant 2)" do data = %{ "@context" => "https://www.w3.org/ns/activitystreams", @@ -1142,62 +1156,6 @@ test "it rejects activities which reference objects that have an incorrect attri end end - describe "general origin containment" do - test "contain_origin_from_id() catches obvious spoofing attempts" do - data = %{ - "id" => "http://example.com/~alyssa/activities/1234.json" - } - - :error = - Transmogrifier.contain_origin_from_id( - "http://example.org/~alyssa/activities/1234.json", - data - ) - end - - test "contain_origin_from_id() allows alternate IDs within the same origin domain" do - data = %{ - "id" => "http://example.com/~alyssa/activities/1234.json" - } - - :ok = - Transmogrifier.contain_origin_from_id( - "http://example.com/~alyssa/activities/1234", - data - ) - end - - test "contain_origin_from_id() allows matching IDs" do - data = %{ - "id" => "http://example.com/~alyssa/activities/1234.json" - } - - :ok = - Transmogrifier.contain_origin_from_id( - "http://example.com/~alyssa/activities/1234.json", - data - ) - end - - test "users cannot be collided through fake direction spoofing attempts" do - insert(:user, %{ - nickname: "rye@niu.moe", - local: false, - ap_id: "https://niu.moe/users/rye", - follower_address: User.ap_followers(%User{nickname: "rye@niu.moe"}) - }) - - {:error, _} = User.get_or_fetch_by_ap_id("https://n1u.moe/users/rye") - end - - test "all objects with fake directions are rejected by the object fetcher" do - {:error, _} = - ActivityPub.fetch_and_contain_remote_object_from_id( - "https://info.pleroma.site/activity4.json" - ) - end - end - describe "reserialization" do test "successfully reserializes a message with inReplyTo == nil" do user = insert(:user) diff --git a/test/web/activity_pub/utils_test.exs b/test/web/activity_pub/utils_test.exs index 758214e68..c57fae437 100644 --- a/test/web/activity_pub/utils_test.exs +++ b/test/web/activity_pub/utils_test.exs @@ -1,7 +1,6 @@ defmodule Pleroma.Web.ActivityPub.UtilsTest do use Pleroma.DataCase alias Pleroma.Activity - alias Pleroma.Repo alias Pleroma.User alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.Utils @@ -12,8 +11,8 @@ defmodule Pleroma.Web.ActivityPub.UtilsTest do describe "fetch the latest Follow" do test "fetches the latest Follow activity" do %Activity{data: %{"type" => "Follow"}} = activity = insert(:follow_activity) - follower = Repo.get_by(User, ap_id: activity.data["actor"]) - followed = Repo.get_by(User, ap_id: activity.data["object"]) + follower = User.get_cached_by_ap_id(activity.data["actor"]) + followed = User.get_cached_by_ap_id(activity.data["object"]) assert activity == Utils.fetch_latest_follow(follower, followed) end diff --git a/test/web/admin_api/admin_api_controller_test.exs b/test/web/admin_api/admin_api_controller_test.exs index d44392c9d..b89c42327 100644 --- a/test/web/admin_api/admin_api_controller_test.exs +++ b/test/web/admin_api/admin_api_controller_test.exs @@ -89,8 +89,8 @@ test "allows to force-follow another user" do "followed" => user.nickname }) - user = User.get_by_id(user.id) - follower = User.get_by_id(follower.id) + user = User.get_cached_by_id(user.id) + follower = User.get_cached_by_id(follower.id) assert User.following?(follower, user) end @@ -112,8 +112,8 @@ test "allows to force-unfollow another user" do "followed" => user.nickname }) - user = User.get_by_id(user.id) - follower = User.get_by_id(follower.id) + user = User.get_cached_by_id(user.id) + follower = User.get_cached_by_id(follower.id) refute User.following?(follower, user) end @@ -145,13 +145,13 @@ test "it appends specified tags to users with specified nicknames", %{ user2: user2 } do assert json_response(conn, :no_content) - assert User.get_by_id(user1.id).tags == ["x", "foo", "bar"] - assert User.get_by_id(user2.id).tags == ["y", "foo", "bar"] + assert User.get_cached_by_id(user1.id).tags == ["x", "foo", "bar"] + assert User.get_cached_by_id(user2.id).tags == ["y", "foo", "bar"] end test "it does not modify tags of not specified users", %{conn: conn, user3: user3} do assert json_response(conn, :no_content) - assert User.get_by_id(user3.id).tags == ["unchanged"] + assert User.get_cached_by_id(user3.id).tags == ["unchanged"] end end @@ -181,13 +181,13 @@ test "it removes specified tags from users with specified nicknames", %{ user2: user2 } do assert json_response(conn, :no_content) - assert User.get_by_id(user1.id).tags == [] - assert User.get_by_id(user2.id).tags == ["y"] + assert User.get_cached_by_id(user1.id).tags == [] + assert User.get_cached_by_id(user2.id).tags == ["y"] end test "it does not modify tags of not specified users", %{conn: conn, user3: user3} do assert json_response(conn, :no_content) - assert User.get_by_id(user3.id).tags == ["unchanged"] + assert User.get_cached_by_id(user3.id).tags == ["unchanged"] end end @@ -257,7 +257,7 @@ test "deactivates the user", %{conn: conn} do conn |> put("/api/pleroma/admin/activation_status/#{user.nickname}", %{status: false}) - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) assert user.info.deactivated == true assert json_response(conn, :no_content) end @@ -269,7 +269,7 @@ test "activates the user", %{conn: conn} do conn |> put("/api/pleroma/admin/activation_status/#{user.nickname}", %{status: true}) - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) assert user.info.deactivated == false assert json_response(conn, :no_content) end @@ -317,13 +317,21 @@ test "sends invitation and returns 204", %{conn: conn, user: user} do assert token_record refute token_record.used - Swoosh.TestAssertions.assert_email_sent( - Pleroma.UserEmail.user_invitation_email( + notify_email = Pleroma.Config.get([:instance, :notify_email]) + instance_name = Pleroma.Config.get([:instance, :name]) + + email = + Pleroma.Emails.UserEmail.user_invitation_email( user, token_record, recipient_email, recipient_name ) + + Swoosh.TestAssertions.assert_email_sent( + from: {instance_name, notify_email}, + to: {recipient_name, recipient_email}, + html_body: email.html_body ) end diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 34aa5bf18..a5b07c446 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -5,6 +5,7 @@ defmodule Pleroma.Web.CommonAPITest do use Pleroma.DataCase alias Pleroma.Activity + alias Pleroma.Object alias Pleroma.User alias Pleroma.Web.CommonAPI @@ -32,24 +33,26 @@ test "it de-duplicates tags" do user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{"status" => "#2hu #2HU"}) - assert activity.data["object"]["tag"] == ["2hu"] + object = Object.normalize(activity.data["object"]) + + assert object.data["tag"] == ["2hu"] end test "it adds emoji in the object" do user = insert(:user) - {:ok, activity} = CommonAPI.post(user, %{"status" => ":moominmamma:"}) + {:ok, activity} = CommonAPI.post(user, %{"status" => ":firefox:"}) - assert activity.data["object"]["emoji"]["moominmamma"] + assert Object.normalize(activity).data["emoji"]["firefox"] end test "it adds emoji when updating profiles" do - user = insert(:user, %{name: ":karjalanpiirakka:"}) + user = insert(:user, %{name: ":firefox:"}) CommonAPI.update(user) user = User.get_cached_by_ap_id(user.ap_id) - [karjalanpiirakka] = user.info.source_data["tag"] + [firefox] = user.info.source_data["tag"] - assert karjalanpiirakka["name"] == ":karjalanpiirakka:" + assert firefox["name"] == ":firefox:" end describe "posting" do @@ -64,8 +67,9 @@ test "it filters out obviously bad tags when accepting a post as HTML" do "content_type" => "text/html" }) - content = activity.data["object"]["content"] - assert content == "

2hu

alert('xss')" + object = Object.normalize(activity.data["object"]) + + assert object.data["content"] == "

2hu

alert('xss')" end test "it filters out obviously bad tags when accepting a post as Markdown" do @@ -79,8 +83,9 @@ test "it filters out obviously bad tags when accepting a post as Markdown" do "content_type" => "text/markdown" }) - content = activity.data["object"]["content"] - assert content == "

2hu

alert('xss')" + object = Object.normalize(activity.data["object"]) + + assert object.data["content"] == "

2hu

alert('xss')" end end diff --git a/test/web/common_api/common_api_utils_test.exs b/test/web/common_api/common_api_utils_test.exs index f0c59d5c3..ab4c62b35 100644 --- a/test/web/common_api/common_api_utils_test.exs +++ b/test/web/common_api/common_api_utils_test.exs @@ -37,21 +37,21 @@ test "correct password given" do end test "parses emoji from name and bio" do - {:ok, user} = UserBuilder.insert(%{name: ":karjalanpiirakka:", bio: ":perkele:"}) + {:ok, user} = UserBuilder.insert(%{name: ":blank:", bio: ":firefox:"}) expected = [ %{ "type" => "Emoji", - "icon" => %{"type" => "Image", "url" => "#{Endpoint.url()}/finmoji/128px/perkele-128.png"}, - "name" => ":perkele:" + "icon" => %{"type" => "Image", "url" => "#{Endpoint.url()}/emoji/Firefox.gif"}, + "name" => ":firefox:" }, %{ "type" => "Emoji", "icon" => %{ "type" => "Image", - "url" => "#{Endpoint.url()}/finmoji/128px/karjalanpiirakka-128.png" + "url" => "#{Endpoint.url()}/emoji/blank.png" }, - "name" => ":karjalanpiirakka:" + "name" => ":blank:" } ] @@ -119,6 +119,31 @@ test "works for bare text/markdown" do assert output == expected end + test "works for bare text/bbcode" do + text = "[b]hello world[/b]" + expected = "hello world" + + {output, [], []} = Utils.format_input(text, "text/bbcode") + + assert output == expected + + text = "[b]hello world![/b]\n\nsecond paragraph!" + expected = "hello world!
\n
\nsecond paragraph!" + + {output, [], []} = Utils.format_input(text, "text/bbcode") + + assert output == expected + + text = "[b]hello world![/b]\n\nsecond paragraph!" + + expected = + "hello world!
\n
\n<strong>second paragraph!</strong>" + + {output, [], []} = Utils.format_input(text, "text/bbcode") + + assert output == expected + end + test "works for text/markdown with mentions" do {:ok, user} = UserBuilder.insert(%{nickname: "user__test", ap_id: "http://foo.com/user__test"}) diff --git a/test/web/mastodon_api/account_view_test.exs b/test/web/mastodon_api/account_view_test.exs index d7487bed9..a24f2a050 100644 --- a/test/web/mastodon_api/account_view_test.exs +++ b/test/web/mastodon_api/account_view_test.exs @@ -56,14 +56,17 @@ test "Represent a user account" do bot: false, source: %{ note: "", - privacy: "public", - sensitive: false + sensitive: false, + pleroma: %{} }, pleroma: %{ confirmation_pending: false, tags: [], is_admin: false, is_moderator: false, + hide_favorites: true, + hide_followers: false, + hide_follows: false, relationship: %{} } } @@ -81,8 +84,12 @@ test "Represent the user account for the account owner" do "follows" => true } - assert %{pleroma: %{notification_settings: ^notification_settings}} = - AccountView.render("account.json", %{user: user, for: user}) + privacy = user.info.default_scope + + assert %{ + pleroma: %{notification_settings: ^notification_settings}, + source: %{privacy: ^privacy} + } = AccountView.render("account.json", %{user: user, for: user}) end test "Represent a Service(bot) account" do @@ -114,14 +121,17 @@ test "Represent a Service(bot) account" do bot: true, source: %{ note: "", - privacy: "public", - sensitive: false + sensitive: false, + pleroma: %{} }, pleroma: %{ confirmation_pending: false, tags: [], is_admin: false, is_moderator: false, + hide_favorites: true, + hide_followers: false, + hide_follows: false, relationship: %{} } } @@ -169,15 +179,15 @@ test "represent a relationship" do test "represent an embedded relationship" do user = insert(:user, %{ - info: %{note_count: 5, follower_count: 3, source_data: %{"type" => "Service"}}, + info: %{note_count: 5, follower_count: 0, source_data: %{"type" => "Service"}}, nickname: "shp@shitposter.club", inserted_at: ~N[2017-08-15 15:47:06.597036] }) other_user = insert(:user) - {:ok, other_user} = User.follow(other_user, user) {:ok, other_user} = User.block(other_user, user) + {:ok, _} = User.follow(insert(:user), user) expected = %{ id: to_string(user.id), @@ -186,7 +196,7 @@ test "represent an embedded relationship" do display_name: user.name, locked: false, created_at: "2017-08-15T15:47:06.000Z", - followers_count: 3, + followers_count: 1, following_count: 0, statuses_count: 5, note: user.bio, @@ -200,14 +210,17 @@ test "represent an embedded relationship" do bot: true, source: %{ note: "", - privacy: "public", - sensitive: false + sensitive: false, + pleroma: %{} }, pleroma: %{ confirmation_pending: false, tags: [], is_admin: false, is_moderator: false, + hide_favorites: true, + hide_followers: false, + hide_follows: false, relationship: %{ id: to_string(user.id), following: false, diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 3ac5c37a6..c2a12d3c7 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -342,7 +342,7 @@ test "replying to a status", %{conn: conn} do activity = Activity.get_by_id(id) assert activity.data["context"] == replied_to.data["context"] - assert activity.data["object"]["inReplyToStatusId"] == replied_to.id + assert Activity.get_in_reply_to_activity(activity).id == replied_to.id end test "posting a status with an invalid in_reply_to_id", %{conn: conn} do @@ -445,7 +445,7 @@ test "get a status", %{conn: conn} do describe "deleting a status" do test "when you created it", %{conn: conn} do activity = insert(:note_activity) - author = User.get_by_ap_id(activity.data["actor"]) + author = User.get_cached_by_ap_id(activity.data["actor"]) conn = conn @@ -944,6 +944,58 @@ test "filters notifications using exclude_types", %{conn: conn} do assert [%{"id" => ^reblog_notification_id}] = json_response(conn_res, 200) end + + test "destroy multiple", %{conn: conn} do + user = insert(:user) + other_user = insert(:user) + + {:ok, activity1} = CommonAPI.post(other_user, %{"status" => "hi @#{user.nickname}"}) + {:ok, activity2} = CommonAPI.post(other_user, %{"status" => "hi @#{user.nickname}"}) + {:ok, activity3} = CommonAPI.post(user, %{"status" => "hi @#{other_user.nickname}"}) + {:ok, activity4} = CommonAPI.post(user, %{"status" => "hi @#{other_user.nickname}"}) + + notification1_id = Repo.get_by(Notification, activity_id: activity1.id).id |> to_string() + notification2_id = Repo.get_by(Notification, activity_id: activity2.id).id |> to_string() + notification3_id = Repo.get_by(Notification, activity_id: activity3.id).id |> to_string() + notification4_id = Repo.get_by(Notification, activity_id: activity4.id).id |> to_string() + + conn = + conn + |> assign(:user, user) + + conn_res = + conn + |> get("/api/v1/notifications") + + result = json_response(conn_res, 200) + assert [%{"id" => ^notification2_id}, %{"id" => ^notification1_id}] = result + + conn2 = + conn + |> assign(:user, other_user) + + conn_res = + conn2 + |> get("/api/v1/notifications") + + result = json_response(conn_res, 200) + assert [%{"id" => ^notification4_id}, %{"id" => ^notification3_id}] = result + + conn_destroy = + conn + |> delete("/api/v1/notifications/destroy_multiple", %{ + "ids" => [notification1_id, notification2_id] + }) + + assert json_response(conn_destroy, 200) == %{} + + conn_res = + conn2 + |> get("/api/v1/notifications") + + result = json_response(conn_res, 200) + assert [%{"id" => ^notification4_id}, %{"id" => ^notification3_id}] = result + end end describe "reblogging" do @@ -956,8 +1008,47 @@ test "reblogs and returns the reblogged status", %{conn: conn} do |> assign(:user, user) |> post("/api/v1/statuses/#{activity.id}/reblog") - assert %{"reblog" => %{"id" => id, "reblogged" => true, "reblogs_count" => 1}} = - json_response(conn, 200) + assert %{ + "reblog" => %{"id" => id, "reblogged" => true, "reblogs_count" => 1}, + "reblogged" => true + } = json_response(conn, 200) + + assert to_string(activity.id) == id + end + + test "reblogged status for another user", %{conn: conn} do + activity = insert(:note_activity) + user1 = insert(:user) + user2 = insert(:user) + user3 = insert(:user) + CommonAPI.favorite(activity.id, user2) + {:ok, _bookmark} = Pleroma.Bookmark.create(user2.id, activity.id) + {:ok, reblog_activity1, _object} = CommonAPI.repeat(activity.id, user1) + {:ok, _, _object} = CommonAPI.repeat(activity.id, user2) + + conn_res = + conn + |> assign(:user, user3) + |> get("/api/v1/statuses/#{reblog_activity1.id}") + + assert %{ + "reblog" => %{"id" => id, "reblogged" => false, "reblogs_count" => 2}, + "reblogged" => false, + "favourited" => false, + "bookmarked" => false + } = json_response(conn_res, 200) + + conn_res = + conn + |> assign(:user, user2) + |> get("/api/v1/statuses/#{reblog_activity1.id}") + + assert %{ + "reblog" => %{"id" => id, "reblogged" => true, "reblogs_count" => 2}, + "reblogged" => true, + "favourited" => true, + "bookmarked" => true + } = json_response(conn_res, 200) assert to_string(activity.id) == id end @@ -1076,7 +1167,7 @@ test "gets a users statuses", %{conn: conn} do test "unimplemented pinned statuses feature", %{conn: conn} do note = insert(:note_activity) - user = User.get_by_ap_id(note.data["actor"]) + user = User.get_cached_by_ap_id(note.data["actor"]) conn = conn @@ -1087,7 +1178,7 @@ test "unimplemented pinned statuses feature", %{conn: conn} do test "gets an users media", %{conn: conn} do note = insert(:note_activity) - user = User.get_by_ap_id(note.data["actor"]) + user = User.get_cached_by_ap_id(note.data["actor"]) file = %Plug.Upload{ content_type: "image/jpg", @@ -1162,8 +1253,8 @@ test "/api/v1/follow_requests works" do {:ok, _activity} = ActivityPub.follow(other_user, user) - user = User.get_by_id(user.id) - other_user = User.get_by_id(other_user.id) + user = User.get_cached_by_id(user.id) + other_user = User.get_cached_by_id(other_user.id) assert User.following?(other_user, user) == false @@ -1182,8 +1273,8 @@ test "/api/v1/follow_requests/:id/authorize works" do {:ok, _activity} = ActivityPub.follow(other_user, user) - user = User.get_by_id(user.id) - other_user = User.get_by_id(other_user.id) + user = User.get_cached_by_id(user.id) + other_user = User.get_cached_by_id(other_user.id) assert User.following?(other_user, user) == false @@ -1195,8 +1286,8 @@ test "/api/v1/follow_requests/:id/authorize works" do assert relationship = json_response(conn, 200) assert to_string(other_user.id) == relationship["id"] - user = User.get_by_id(user.id) - other_user = User.get_by_id(other_user.id) + user = User.get_cached_by_id(user.id) + other_user = User.get_cached_by_id(other_user.id) assert User.following?(other_user, user) == true end @@ -1219,7 +1310,7 @@ test "/api/v1/follow_requests/:id/reject works" do {:ok, _activity} = ActivityPub.follow(other_user, user) - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) conn = build_conn() @@ -1229,8 +1320,8 @@ test "/api/v1/follow_requests/:id/reject works" do assert relationship = json_response(conn, 200) assert to_string(other_user.id) == relationship["id"] - user = User.get_by_id(user.id) - other_user = User.get_by_id(other_user.id) + user = User.get_cached_by_id(user.id) + other_user = User.get_cached_by_id(other_user.id) assert User.following?(other_user, user) == false end @@ -1421,7 +1512,7 @@ test "getting followers, pagination", %{conn: conn} do assert id2 == follower2.id assert [link_header] = get_resp_header(res_conn, "link") - assert link_header =~ ~r/since_id=#{follower2.id}/ + assert link_header =~ ~r/min_id=#{follower2.id}/ assert link_header =~ ~r/max_id=#{follower2.id}/ end @@ -1500,7 +1591,7 @@ test "getting following, pagination", %{conn: conn} do assert id2 == following2.id assert [link_header] = get_resp_header(res_conn, "link") - assert link_header =~ ~r/since_id=#{following2.id}/ + assert link_header =~ ~r/min_id=#{following2.id}/ assert link_header =~ ~r/max_id=#{following2.id}/ end @@ -1515,7 +1606,7 @@ test "following / unfollowing a user", %{conn: conn} do assert %{"id" => _id, "following" => true} = json_response(conn, 200) - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) conn = build_conn() @@ -1524,7 +1615,7 @@ test "following / unfollowing a user", %{conn: conn} do assert %{"id" => _id, "following" => false} = json_response(conn, 200) - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) conn = build_conn() @@ -1535,6 +1626,78 @@ test "following / unfollowing a user", %{conn: conn} do assert id == to_string(other_user.id) end + test "following without reblogs" do + follower = insert(:user) + followed = insert(:user) + other_user = insert(:user) + + conn = + build_conn() + |> assign(:user, follower) + |> post("/api/v1/accounts/#{followed.id}/follow?reblogs=false") + + assert %{"showing_reblogs" => false} = json_response(conn, 200) + + {:ok, activity} = CommonAPI.post(other_user, %{"status" => "hey"}) + {:ok, reblog, _} = CommonAPI.repeat(activity.id, followed) + + conn = + build_conn() + |> assign(:user, User.get_cached_by_id(follower.id)) + |> get("/api/v1/timelines/home") + + assert [] == json_response(conn, 200) + + conn = + build_conn() + |> assign(:user, follower) + |> post("/api/v1/accounts/#{followed.id}/follow?reblogs=true") + + assert %{"showing_reblogs" => true} = json_response(conn, 200) + + conn = + build_conn() + |> assign(:user, User.get_cached_by_id(follower.id)) + |> get("/api/v1/timelines/home") + + expected_activity_id = reblog.id + assert [%{"id" => ^expected_activity_id}] = json_response(conn, 200) + end + + test "following / unfollowing errors" do + user = insert(:user) + + conn = + build_conn() + |> assign(:user, user) + + # self follow + conn_res = post(conn, "/api/v1/accounts/#{user.id}/follow") + assert %{"error" => "Record not found"} = json_response(conn_res, 404) + + # self unfollow + user = User.get_cached_by_id(user.id) + conn_res = post(conn, "/api/v1/accounts/#{user.id}/unfollow") + assert %{"error" => "Record not found"} = json_response(conn_res, 404) + + # self follow via uri + user = User.get_cached_by_id(user.id) + conn_res = post(conn, "/api/v1/follows", %{"uri" => user.nickname}) + assert %{"error" => "Record not found"} = json_response(conn_res, 404) + + # follow non existing user + conn_res = post(conn, "/api/v1/accounts/doesntexist/follow") + assert %{"error" => "Record not found"} = json_response(conn_res, 404) + + # follow non existing user via uri + conn_res = post(conn, "/api/v1/follows", %{"uri" => "doesntexist"}) + assert %{"error" => "Record not found"} = json_response(conn_res, 404) + + # unfollow non existing user + conn_res = post(conn, "/api/v1/accounts/doesntexist/unfollow") + assert %{"error" => "Record not found"} = json_response(conn_res, 404) + end + test "muting / unmuting a user", %{conn: conn} do user = insert(:user) other_user = insert(:user) @@ -1546,7 +1709,7 @@ test "muting / unmuting a user", %{conn: conn} do assert %{"id" => _id, "muting" => true} = json_response(conn, 200) - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) conn = build_conn() @@ -1601,7 +1764,7 @@ test "blocking / unblocking a user", %{conn: conn} do assert %{"id" => _id, "blocking" => true} = json_response(conn, 200) - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) conn = build_conn() @@ -1760,7 +1923,7 @@ test "search doesn't show statuses that it shouldn't", %{conn: conn} do capture_log(fn -> conn = conn - |> get("/api/v1/search", %{"q" => activity.data["object"]["id"]}) + |> get("/api/v1/search", %{"q" => Object.normalize(activity).data["id"]}) assert results = json_response(conn, 200) @@ -1825,6 +1988,199 @@ test "returns the favorites of a user", %{conn: conn} do assert [] = json_response(third_conn, 200) end + describe "getting favorites timeline of specified user" do + setup do + [current_user, user] = insert_pair(:user, %{info: %{hide_favorites: false}}) + [current_user: current_user, user: user] + end + + test "returns list of statuses favorited by specified user", %{ + conn: conn, + current_user: current_user, + user: user + } do + [activity | _] = insert_pair(:note_activity) + CommonAPI.favorite(activity.id, user) + + response = + conn + |> assign(:user, current_user) + |> get("/api/v1/pleroma/accounts/#{user.id}/favourites") + |> json_response(:ok) + + [like] = response + + assert length(response) == 1 + assert like["id"] == activity.id + end + + test "returns favorites for specified user_id when user is not logged in", %{ + conn: conn, + user: user + } do + activity = insert(:note_activity) + CommonAPI.favorite(activity.id, user) + + response = + conn + |> get("/api/v1/pleroma/accounts/#{user.id}/favourites") + |> json_response(:ok) + + assert length(response) == 1 + end + + test "returns favorited DM only when user is logged in and he is one of recipients", %{ + conn: conn, + current_user: current_user, + user: user + } do + {:ok, direct} = + CommonAPI.post(current_user, %{ + "status" => "Hi @#{user.nickname}!", + "visibility" => "direct" + }) + + CommonAPI.favorite(direct.id, user) + + response = + conn + |> assign(:user, current_user) + |> get("/api/v1/pleroma/accounts/#{user.id}/favourites") + |> json_response(:ok) + + assert length(response) == 1 + + anonymous_response = + conn + |> get("/api/v1/pleroma/accounts/#{user.id}/favourites") + |> json_response(:ok) + + assert length(anonymous_response) == 0 + end + + test "does not return others' favorited DM when user is not one of recipients", %{ + conn: conn, + current_user: current_user, + user: user + } do + user_two = insert(:user) + + {:ok, direct} = + CommonAPI.post(user_two, %{ + "status" => "Hi @#{user.nickname}!", + "visibility" => "direct" + }) + + CommonAPI.favorite(direct.id, user) + + response = + conn + |> assign(:user, current_user) + |> get("/api/v1/pleroma/accounts/#{user.id}/favourites") + |> json_response(:ok) + + assert length(response) == 0 + end + + test "paginates favorites using since_id and max_id", %{ + conn: conn, + current_user: current_user, + user: user + } do + activities = insert_list(10, :note_activity) + + Enum.each(activities, fn activity -> + CommonAPI.favorite(activity.id, user) + end) + + third_activity = Enum.at(activities, 2) + seventh_activity = Enum.at(activities, 6) + + response = + conn + |> assign(:user, current_user) + |> get("/api/v1/pleroma/accounts/#{user.id}/favourites", %{ + since_id: third_activity.id, + max_id: seventh_activity.id + }) + |> json_response(:ok) + + assert length(response) == 3 + refute third_activity in response + refute seventh_activity in response + end + + test "limits favorites using limit parameter", %{ + conn: conn, + current_user: current_user, + user: user + } do + 7 + |> insert_list(:note_activity) + |> Enum.each(fn activity -> + CommonAPI.favorite(activity.id, user) + end) + + response = + conn + |> assign(:user, current_user) + |> get("/api/v1/pleroma/accounts/#{user.id}/favourites", %{limit: "3"}) + |> json_response(:ok) + + assert length(response) == 3 + end + + test "returns empty response when user does not have any favorited statuses", %{ + conn: conn, + current_user: current_user, + user: user + } do + response = + conn + |> assign(:user, current_user) + |> get("/api/v1/pleroma/accounts/#{user.id}/favourites") + |> json_response(:ok) + + assert Enum.empty?(response) + end + + test "returns 404 error when specified user is not exist", %{conn: conn} do + conn = get(conn, "/api/v1/pleroma/accounts/test/favourites") + + assert json_response(conn, 404) == %{"error" => "Record not found"} + end + + test "returns 403 error when user has hidden own favorites", %{ + conn: conn, + current_user: current_user + } do + user = insert(:user, %{info: %{hide_favorites: true}}) + activity = insert(:note_activity) + CommonAPI.favorite(activity.id, user) + + conn = + conn + |> assign(:user, current_user) + |> get("/api/v1/pleroma/accounts/#{user.id}/favourites") + + assert json_response(conn, 403) == %{"error" => "Can't get favorites"} + end + + test "hides favorites for new users by default", %{conn: conn, current_user: current_user} do + user = insert(:user) + activity = insert(:note_activity) + CommonAPI.favorite(activity.id, user) + + conn = + conn + |> assign(:user, current_user) + |> get("/api/v1/pleroma/accounts/#{user.id}/favourites") + + assert user.info.hide_favorites + assert json_response(conn, 403) == %{"error" => "Can't get favorites"} + end + end + describe "updating credentials" do test "updates the user's bio", %{conn: conn} do user = insert(:user) @@ -1858,6 +2214,78 @@ test "updates the user's locking status", %{conn: conn} do assert user["locked"] == true end + test "updates the user's default scope", %{conn: conn} do + user = insert(:user) + + conn = + conn + |> assign(:user, user) + |> patch("/api/v1/accounts/update_credentials", %{default_scope: "cofe"}) + + assert user = json_response(conn, 200) + assert user["source"]["privacy"] == "cofe" + end + + test "updates the user's hide_followers status", %{conn: conn} do + user = insert(:user) + + conn = + conn + |> assign(:user, user) + |> patch("/api/v1/accounts/update_credentials", %{hide_followers: "true"}) + + assert user = json_response(conn, 200) + assert user["pleroma"]["hide_followers"] == true + end + + test "updates the user's hide_follows status", %{conn: conn} do + user = insert(:user) + + conn = + conn + |> assign(:user, user) + |> patch("/api/v1/accounts/update_credentials", %{hide_follows: "true"}) + + assert user = json_response(conn, 200) + assert user["pleroma"]["hide_follows"] == true + end + + test "updates the user's hide_favorites status", %{conn: conn} do + user = insert(:user) + + conn = + conn + |> assign(:user, user) + |> patch("/api/v1/accounts/update_credentials", %{hide_favorites: "true"}) + + assert user = json_response(conn, 200) + assert user["pleroma"]["hide_favorites"] == true + end + + test "updates the user's show_role status", %{conn: conn} do + user = insert(:user) + + conn = + conn + |> assign(:user, user) + |> patch("/api/v1/accounts/update_credentials", %{show_role: "false"}) + + assert user = json_response(conn, 200) + assert user["source"]["pleroma"]["show_role"] == false + end + + test "updates the user's no_rich_text status", %{conn: conn} do + user = insert(:user) + + conn = + conn + |> assign(:user, user) + |> patch("/api/v1/accounts/update_credentials", %{no_rich_text: "true"}) + + assert user = json_response(conn, 200) + assert user["source"]["pleroma"]["no_rich_text"] == true + end + test "updates the user's name", %{conn: conn} do user = insert(:user) @@ -1929,13 +2357,14 @@ test "get instance information", %{conn: conn} do conn = get(conn, "/api/v1/instance") assert result = json_response(conn, 200) + email = Pleroma.Config.get([:instance, :email]) # Note: not checking for "max_toot_chars" since it's optional assert %{ "uri" => _, "title" => _, "description" => _, "version" => _, - "email" => _, + "email" => from_config_email, "urls" => %{ "streaming_api" => _ }, @@ -1944,6 +2373,8 @@ test "get instance information", %{conn: conn} do "languages" => _, "registrations" => _ } = result + + assert email == from_config_email end test "get instance stats", %{conn: conn} do @@ -1958,7 +2389,7 @@ test "get instance stats", %{conn: conn} do {:ok, _} = TwitterAPI.create_status(user, %{"status" => "cofe"}) # Stats should count users with missing or nil `info.deactivated` value - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) info_change = Changeset.change(user.info, %{deactivated: nil}) {:ok, _user} = @@ -2330,7 +2761,7 @@ test "preserves parameters in link headers", %{conn: conn} do assert [link_header] = get_resp_header(conn, "link") assert link_header =~ ~r/media_only=true/ - assert link_header =~ ~r/since_id=#{notification2.id}/ + assert link_header =~ ~r/min_id=#{notification2.id}/ assert link_header =~ ~r/max_id=#{notification1.id}/ end end @@ -2653,4 +3084,49 @@ test "deletes a scheduled activity", %{conn: conn} do assert %{"error" => "Record not found"} = json_response(res_conn, 404) end end + + test "Repeated posts that are replies incorrectly have in_reply_to_id null", %{conn: conn} do + user1 = insert(:user) + user2 = insert(:user) + user3 = insert(:user) + + {:ok, replied_to} = TwitterAPI.create_status(user1, %{"status" => "cofe"}) + + # Reply to status from another user + conn1 = + conn + |> assign(:user, user2) + |> post("/api/v1/statuses", %{"status" => "xD", "in_reply_to_id" => replied_to.id}) + + assert %{"content" => "xD", "id" => id} = json_response(conn1, 200) + + activity = Activity.get_by_id_with_object(id) + + assert Object.normalize(activity).data["inReplyTo"] == Object.normalize(replied_to).data["id"] + assert Activity.get_in_reply_to_activity(activity).id == replied_to.id + + # Reblog from the third user + conn2 = + conn + |> assign(:user, user3) + |> post("/api/v1/statuses/#{activity.id}/reblog") + + assert %{"reblog" => %{"id" => id, "reblogged" => true, "reblogs_count" => 1}} = + json_response(conn2, 200) + + assert to_string(activity.id) == id + + # Getting third user status + conn3 = + conn + |> assign(:user, user3) + |> get("api/v1/timelines/home") + + [reblogged_activity] = json_response(conn3, 200) + + assert reblogged_activity["reblog"]["in_reply_to_id"] == replied_to.id + + replied_to_user = User.get_by_ap_id(replied_to.data["actor"]) + assert reblogged_activity["reblog"]["in_reply_to_account_id"] == replied_to_user.id + end end diff --git a/test/web/mastodon_api/notification_view_test.exs b/test/web/mastodon_api/notification_view_test.exs index f2c1eb76c..977ea1e87 100644 --- a/test/web/mastodon_api/notification_view_test.exs +++ b/test/web/mastodon_api/notification_view_test.exs @@ -21,7 +21,7 @@ test "Mention notification" do mentioned_user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{"status" => "hey @#{mentioned_user.nickname}"}) {:ok, [notification]} = Notification.create_notifications(activity) - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) expected = %{ id: to_string(notification.id), diff --git a/test/web/mastodon_api/status_view_test.exs b/test/web/mastodon_api/status_view_test.exs index db2fdc2f6..5fddc6c58 100644 --- a/test/web/mastodon_api/status_view_test.exs +++ b/test/web/mastodon_api/status_view_test.exs @@ -6,8 +6,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusViewTest do use Pleroma.DataCase alias Pleroma.Activity + alias Pleroma.Bookmark + alias Pleroma.Object + alias Pleroma.Repo alias Pleroma.User - alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.CommonAPI alias Pleroma.Web.CommonAPI.Utils alias Pleroma.Web.MastodonAPI.AccountView @@ -53,14 +55,14 @@ test "tries to get a user by nickname if fetching by ap_id doesn't work" do test "a note with null content" do note = insert(:note_activity) + note_object = Object.normalize(note.data["object"]) data = - note.data - |> put_in(["object", "content"], nil) + note_object.data + |> Map.put("content", nil) - note = - note - |> Map.put(:data, data) + Object.change(note_object, %{data: data}) + |> Object.update_and_set_cache() User.get_cached_by_ap_id(note.data["actor"]) @@ -127,6 +129,7 @@ test "a note activity" do pleroma: %{ local: true, conversation_id: convo_id, + in_reply_to_account_acct: nil, content: %{"text/plain" => HtmlSanitizeEx.strip_tags(note.data["object"]["content"])}, spoiler_text: %{"text/plain" => HtmlSanitizeEx.strip_tags(note.data["object"]["summary"])} } @@ -151,6 +154,25 @@ test "tells if the message is muted for some reason" do assert status.muted == true end + test "tells if the status is bookmarked" do + user = insert(:user) + + {:ok, activity} = CommonAPI.post(user, %{"status" => "Cute girls doing cute things"}) + status = StatusView.render("status.json", %{activity: activity}) + + assert status.bookmarked == false + + status = StatusView.render("status.json", %{activity: activity, for: user}) + + assert status.bookmarked == false + + {:ok, _bookmark} = Bookmark.create(user.id, activity.id) + + status = StatusView.render("status.json", %{activity: activity, for: user}) + + assert status.bookmarked == true + end + test "a reply" do note = insert(:note_activity) user = insert(:user) @@ -177,7 +199,7 @@ test "contains mentions" do status = StatusView.render("status.json", %{activity: activity}) - actor = User.get_by_ap_id(activity.actor) + actor = User.get_cached_by_ap_id(activity.actor) assert status.mentions == Enum.map([user, actor], fn u -> AccountView.render("mention.json", %{user: u}) end) @@ -230,7 +252,7 @@ test "a peertube video" do user = insert(:user) {:ok, object} = - ActivityPub.fetch_object_from_id( + Pleroma.Object.Fetcher.fetch_object_from_id( "https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3" ) diff --git a/test/web/metadata/rel_me_test.exs b/test/web/metadata/rel_me_test.exs new file mode 100644 index 000000000..f66bf7834 --- /dev/null +++ b/test/web/metadata/rel_me_test.exs @@ -0,0 +1,18 @@ +defmodule Pleroma.Web.Metadata.Providers.RelMeTest do + use Pleroma.DataCase + import Pleroma.Factory + alias Pleroma.Web.Metadata.Providers.RelMe + + test "it renders all links with rel='me' from user bio" do + bio = + ~s(https://some-link.com https://another-link.com + "], []}, + {:link, [rel: "me", href: "https://another-link.com"], []} + ] + end +end diff --git a/test/web/oauth/oauth_controller_test.exs b/test/web/oauth/oauth_controller_test.exs index ac7843f9b..6e96537ec 100644 --- a/test/web/oauth/oauth_controller_test.exs +++ b/test/web/oauth/oauth_controller_test.exs @@ -68,10 +68,12 @@ test "GET /oauth/prepare_request encodes parameters as `state` and redirects", % "/oauth/prepare_request", %{ "provider" => "twitter", - "scope" => "read follow", - "client_id" => app.client_id, - "redirect_uri" => app.redirect_uris, - "state" => "a_state" + "authorization" => %{ + "scope" => "read follow", + "client_id" => app.client_id, + "redirect_uri" => app.redirect_uris, + "state" => "a_state" + } } ) @@ -104,7 +106,7 @@ test "with user-bound registration, GET /oauth//callback redirects to } with_mock Pleroma.Web.Auth.Authenticator, - get_registration: fn _, _ -> {:ok, registration} end do + get_registration: fn _ -> {:ok, registration} end do conn = get( conn, @@ -134,7 +136,7 @@ test "with user-unbound registration, GET /oauth//callback renders reg } with_mock Pleroma.Web.Auth.Authenticator, - get_registration: fn _, _ -> {:ok, registration} end do + get_registration: fn _ -> {:ok, registration} end do conn = get( conn, @@ -193,12 +195,14 @@ test "GET /oauth/registration_details renders registration details form", %{ conn, "/oauth/registration_details", %{ - "scopes" => app.scopes, - "client_id" => app.client_id, - "redirect_uri" => app.redirect_uris, - "state" => "a_state", - "nickname" => nil, - "email" => "john@doe.com" + "authorization" => %{ + "scopes" => app.scopes, + "client_id" => app.client_id, + "redirect_uri" => app.redirect_uris, + "state" => "a_state", + "nickname" => nil, + "email" => "john@doe.com" + } } ) @@ -221,12 +225,14 @@ test "with valid params, POST /oauth/register?op=register redirects to `redirect "/oauth/register", %{ "op" => "register", - "scopes" => app.scopes, - "client_id" => app.client_id, - "redirect_uri" => app.redirect_uris, - "state" => "a_state", - "nickname" => "availablenick", - "email" => "available@email.com" + "authorization" => %{ + "scopes" => app.scopes, + "client_id" => app.client_id, + "redirect_uri" => app.redirect_uris, + "state" => "a_state", + "nickname" => "availablenick", + "email" => "available@email.com" + } } ) @@ -244,17 +250,23 @@ test "with invalid params, POST /oauth/register?op=register renders registration params = %{ "op" => "register", - "scopes" => app.scopes, - "client_id" => app.client_id, - "redirect_uri" => app.redirect_uris, - "state" => "a_state", - "nickname" => "availablenickname", - "email" => "available@email.com" + "authorization" => %{ + "scopes" => app.scopes, + "client_id" => app.client_id, + "redirect_uri" => app.redirect_uris, + "state" => "a_state", + "nickname" => "availablenickname", + "email" => "available@email.com" + } } for {bad_param, bad_param_value} <- [{"nickname", another_user.nickname}, {"email", another_user.email}] do - bad_params = Map.put(params, bad_param, bad_param_value) + bad_registration_attrs = %{ + "authorization" => Map.put(params["authorization"], bad_param, bad_param_value) + } + + bad_params = Map.merge(params, bad_registration_attrs) conn = conn @@ -281,12 +293,14 @@ test "with valid params, POST /oauth/register?op=connect redirects to `redirect_ "/oauth/register", %{ "op" => "connect", - "scopes" => app.scopes, - "client_id" => app.client_id, - "redirect_uri" => app.redirect_uris, - "state" => "a_state", - "auth_name" => user.nickname, - "password" => "testpassword" + "authorization" => %{ + "scopes" => app.scopes, + "client_id" => app.client_id, + "redirect_uri" => app.redirect_uris, + "state" => "a_state", + "name" => user.nickname, + "password" => "testpassword" + } } ) @@ -304,12 +318,14 @@ test "with invalid params, POST /oauth/register?op=connect renders registration_ params = %{ "op" => "connect", - "scopes" => app.scopes, - "client_id" => app.client_id, - "redirect_uri" => app.redirect_uris, - "state" => "a_state", - "auth_name" => user.nickname, - "password" => "wrong password" + "authorization" => %{ + "scopes" => app.scopes, + "client_id" => app.client_id, + "redirect_uri" => app.redirect_uris, + "state" => "a_state", + "name" => user.nickname, + "password" => "wrong password" + } } conn = @@ -349,6 +365,27 @@ test "renders authentication page", %{app: app, conn: conn} do assert html_response(conn, 200) =~ ~s(type="submit") end + test "properly handles internal calls with `authorization`-wrapped params", %{ + app: app, + conn: conn + } do + conn = + get( + conn, + "/oauth/authorize", + %{ + "authorization" => %{ + "response_type" => "code", + "client_id" => app.client_id, + "redirect_uri" => app.redirect_uris, + "scope" => "read" + } + } + ) + + assert html_response(conn, 200) =~ ~s(type="submit") + end + test "renders authentication page if user is already authenticated but `force_login` is tru-ish", %{app: app, conn: conn} do token = insert(:oauth_token, app_id: app.id) diff --git a/test/web/ostatus/ostatus_controller_test.exs b/test/web/ostatus/ostatus_controller_test.exs index 2950f11c0..7441e5fce 100644 --- a/test/web/ostatus/ostatus_controller_test.exs +++ b/test/web/ostatus/ostatus_controller_test.exs @@ -6,7 +6,6 @@ defmodule Pleroma.Web.OStatus.OStatusControllerTest do use Pleroma.Web.ConnCase import Pleroma.Factory alias Pleroma.Object - alias Pleroma.Repo alias Pleroma.User alias Pleroma.Web.CommonAPI alias Pleroma.Web.OStatus.ActivityRepresenter @@ -41,7 +40,8 @@ test "decodes a salmon with a changed magic key", %{conn: conn} do assert response(conn, 200) # Set a wrong magic-key for a user so it has to refetch - salmon_user = User.get_by_ap_id("http://gs.example.org:4040/index.php/user/1") + salmon_user = User.get_cached_by_ap_id("http://gs.example.org:4040/index.php/user/1") + # Wrong key info_cng = User.Info.remote_user_creation(salmon_user.info, %{ @@ -52,7 +52,7 @@ test "decodes a salmon with a changed magic key", %{conn: conn} do salmon_user |> Ecto.Changeset.change() |> Ecto.Changeset.put_embed(:info, info_cng) - |> Repo.update() + |> User.update_and_set_cache() conn = build_conn() @@ -86,7 +86,7 @@ test "returns 404 for a missing feed", %{conn: conn} do test "gets an object", %{conn: conn} do note_activity = insert(:note_activity) - user = User.get_by_ap_id(note_activity.data["actor"]) + user = User.get_cached_by_ap_id(note_activity.data["actor"]) [_, uuid] = hd(Regex.scan(~r/.+\/([\w-]+)$/, note_activity.data["object"]["id"])) url = "/objects/#{uuid}" diff --git a/test/web/ostatus/ostatus_test.exs b/test/web/ostatus/ostatus_test.exs index 9fd100f63..2916caf8d 100644 --- a/test/web/ostatus/ostatus_test.exs +++ b/test/web/ostatus/ostatus_test.exs @@ -28,34 +28,35 @@ test "don't insert create notes twice" do test "handle incoming note - GS, Salmon" do incoming = File.read!("test/fixtures/incoming_note_activity.xml") {:ok, [activity]} = OStatus.handle_incoming(incoming) + object = Object.normalize(activity.data["object"]) - user = User.get_by_ap_id(activity.data["actor"]) + user = User.get_cached_by_ap_id(activity.data["actor"]) assert user.info.note_count == 1 assert activity.data["type"] == "Create" - assert activity.data["object"]["type"] == "Note" + assert object.data["type"] == "Note" - assert activity.data["object"]["id"] == - "tag:gs.example.org:4040,2017-04-23:noticeId=29:objectType=note" + assert object.data["id"] == "tag:gs.example.org:4040,2017-04-23:noticeId=29:objectType=note" assert activity.data["published"] == "2017-04-23T14:51:03+00:00" - assert activity.data["object"]["published"] == "2017-04-23T14:51:03+00:00" + assert object.data["published"] == "2017-04-23T14:51:03+00:00" assert activity.data["context"] == "tag:gs.example.org:4040,2017-04-23:objectType=thread:nonce=f09e22f58abd5c7b" assert "http://pleroma.example.org:4000/users/lain3" in activity.data["to"] - assert activity.data["object"]["emoji"] == %{"marko" => "marko.png", "reimu" => "reimu.png"} + assert object.data["emoji"] == %{"marko" => "marko.png", "reimu" => "reimu.png"} assert activity.local == false end test "handle incoming notes - GS, subscription" do incoming = File.read!("test/fixtures/ostatus_incoming_post.xml") {:ok, [activity]} = OStatus.handle_incoming(incoming) + object = Object.normalize(activity.data["object"]) assert activity.data["type"] == "Create" - assert activity.data["object"]["type"] == "Note" - assert activity.data["object"]["actor"] == "https://social.heldscal.la/user/23211" - assert activity.data["object"]["content"] == "Will it blend?" + assert object.data["type"] == "Note" + assert object.data["actor"] == "https://social.heldscal.la/user/23211" + assert object.data["content"] == "Will it blend?" user = User.get_cached_by_ap_id(activity.data["actor"]) assert User.ap_followers(user) in activity.data["to"] assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"] @@ -64,20 +65,22 @@ test "handle incoming notes - GS, subscription" do test "handle incoming notes with attachments - GS, subscription" do incoming = File.read!("test/fixtures/incoming_websub_gnusocial_attachments.xml") {:ok, [activity]} = OStatus.handle_incoming(incoming) + object = Object.normalize(activity.data["object"]) assert activity.data["type"] == "Create" - assert activity.data["object"]["type"] == "Note" - assert activity.data["object"]["actor"] == "https://social.heldscal.la/user/23211" - assert activity.data["object"]["attachment"] |> length == 2 - assert activity.data["object"]["external_url"] == "https://social.heldscal.la/notice/2020923" + assert object.data["type"] == "Note" + assert object.data["actor"] == "https://social.heldscal.la/user/23211" + assert object.data["attachment"] |> length == 2 + assert object.data["external_url"] == "https://social.heldscal.la/notice/2020923" assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"] end test "handle incoming notes with tags" do incoming = File.read!("test/fixtures/ostatus_incoming_post_tag.xml") {:ok, [activity]} = OStatus.handle_incoming(incoming) + object = Object.normalize(activity.data["object"]) - assert activity.data["object"]["tag"] == ["nsfw"] + assert object.data["tag"] == ["nsfw"] assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"] end @@ -92,10 +95,11 @@ test "handle incoming notes - Mastodon, salmon, reply" do incoming = File.read!("test/fixtures/incoming_reply_mastodon.xml") {:ok, [activity]} = OStatus.handle_incoming(incoming) + object = Object.normalize(activity.data["object"]) assert activity.data["type"] == "Create" - assert activity.data["object"]["type"] == "Note" - assert activity.data["object"]["actor"] == "https://mastodon.social/users/lambadalambda" + assert object.data["type"] == "Note" + assert object.data["actor"] == "https://mastodon.social/users/lambadalambda" assert activity.data["context"] == "2hu" assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"] end @@ -103,42 +107,47 @@ test "handle incoming notes - Mastodon, salmon, reply" do test "handle incoming notes - Mastodon, with CW" do incoming = File.read!("test/fixtures/mastodon-note-cw.xml") {:ok, [activity]} = OStatus.handle_incoming(incoming) + object = Object.normalize(activity.data["object"]) assert activity.data["type"] == "Create" - assert activity.data["object"]["type"] == "Note" - assert activity.data["object"]["actor"] == "https://mastodon.social/users/lambadalambda" - assert activity.data["object"]["summary"] == "technologic" + assert object.data["type"] == "Note" + assert object.data["actor"] == "https://mastodon.social/users/lambadalambda" + assert object.data["summary"] == "technologic" assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"] end test "handle incoming unlisted messages, put public into cc" do incoming = File.read!("test/fixtures/mastodon-note-unlisted.xml") {:ok, [activity]} = OStatus.handle_incoming(incoming) + object = Object.normalize(activity.data["object"]) + refute "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"] assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["cc"] - refute "https://www.w3.org/ns/activitystreams#Public" in activity.data["object"]["to"] - assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["object"]["cc"] + refute "https://www.w3.org/ns/activitystreams#Public" in object.data["to"] + assert "https://www.w3.org/ns/activitystreams#Public" in object.data["cc"] end test "handle incoming retweets - Mastodon, with CW" do incoming = File.read!("test/fixtures/cw_retweet.xml") {:ok, [[_activity, retweeted_activity]]} = OStatus.handle_incoming(incoming) + retweeted_object = Object.normalize(retweeted_activity.data["object"]) - assert retweeted_activity.data["object"]["summary"] == "Hey." + assert retweeted_object.data["summary"] == "Hey." end test "handle incoming notes - GS, subscription, reply" do incoming = File.read!("test/fixtures/ostatus_incoming_reply.xml") {:ok, [activity]} = OStatus.handle_incoming(incoming) + object = Object.normalize(activity.data["object"]) assert activity.data["type"] == "Create" - assert activity.data["object"]["type"] == "Note" - assert activity.data["object"]["actor"] == "https://social.heldscal.la/user/23211" + assert object.data["type"] == "Note" + assert object.data["actor"] == "https://social.heldscal.la/user/23211" - assert activity.data["object"]["content"] == + assert object.data["content"] == "@shpbot why not indeed." - assert activity.data["object"]["inReplyTo"] == + assert object.data["inReplyTo"] == "tag:gs.archae.me,2017-04-30:noticeId=778260:objectType=note" assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"] @@ -150,17 +159,18 @@ test "handle incoming retweets - GS, subscription" do assert activity.data["type"] == "Announce" assert activity.data["actor"] == "https://social.heldscal.la/user/23211" - assert activity.data["object"] == retweeted_activity.data["object"]["id"] + assert activity.data["object"] == retweeted_activity.data["object"] assert "https://pleroma.soykaf.com/users/lain" in activity.data["to"] refute activity.local retweeted_activity = Activity.get_by_id(retweeted_activity.id) + retweeted_object = Object.normalize(retweeted_activity.data["object"]) assert retweeted_activity.data["type"] == "Create" assert retweeted_activity.data["actor"] == "https://pleroma.soykaf.com/users/lain" refute retweeted_activity.local - assert retweeted_activity.data["object"]["announcement_count"] == 1 - assert String.contains?(retweeted_activity.data["object"]["content"], "mastodon") - refute String.contains?(retweeted_activity.data["object"]["content"], "Test account") + assert retweeted_object.data["announcement_count"] == 1 + assert String.contains?(retweeted_object.data["content"], "mastodon") + refute String.contains?(retweeted_object.data["content"], "Test account") end test "handle incoming retweets - GS, subscription - local message" do @@ -192,10 +202,11 @@ test "handle incoming retweets - GS, subscription - local message" do test "handle incoming retweets - Mastodon, salmon" do incoming = File.read!("test/fixtures/share.xml") {:ok, [[activity, retweeted_activity]]} = OStatus.handle_incoming(incoming) + retweeted_object = Object.normalize(retweeted_activity.data["object"]) assert activity.data["type"] == "Announce" assert activity.data["actor"] == "https://mastodon.social/users/lambadalambda" - assert activity.data["object"] == retweeted_activity.data["object"]["id"] + assert activity.data["object"] == retweeted_activity.data["object"] assert activity.data["id"] == "tag:mastodon.social,2017-05-03:objectId=4934452:objectType=Status" @@ -204,7 +215,7 @@ test "handle incoming retweets - Mastodon, salmon" do assert retweeted_activity.data["type"] == "Create" assert retweeted_activity.data["actor"] == "https://pleroma.soykaf.com/users/lain" refute retweeted_activity.local - refute String.contains?(retweeted_activity.data["object"]["content"], "Test account") + refute String.contains?(retweeted_object.data["content"], "Test account") end test "handle incoming favorites - GS, websub" do @@ -214,7 +225,7 @@ test "handle incoming favorites - GS, websub" do assert activity.data["type"] == "Like" assert activity.data["actor"] == "https://social.heldscal.la/user/23211" - assert activity.data["object"] == favorited_activity.data["object"]["id"] + assert activity.data["object"] == favorited_activity.data["object"] assert activity.data["id"] == "tag:social.heldscal.la,2017-05-05:fave:23211:comment:2061643:2017-05-05T09:12:50+00:00" @@ -223,7 +234,7 @@ test "handle incoming favorites - GS, websub" do assert favorited_activity.data["type"] == "Create" assert favorited_activity.data["actor"] == "https://shitposter.club/user/1" - assert favorited_activity.data["object"]["id"] == + assert favorited_activity.data["object"] == "tag:shitposter.club,2017-05-05:noticeId=2827873:objectType=comment" refute favorited_activity.local @@ -258,17 +269,17 @@ test "handle incoming favorites with locally available object - GS, websub" do test "handle incoming replies" do incoming = File.read!("test/fixtures/incoming_note_activity_answer.xml") {:ok, [activity]} = OStatus.handle_incoming(incoming) + object = Object.normalize(activity.data["object"]) assert activity.data["type"] == "Create" - assert activity.data["object"]["type"] == "Note" + assert object.data["type"] == "Note" - assert activity.data["object"]["inReplyTo"] == + assert object.data["inReplyTo"] == "http://pleroma.example.org:4000/objects/55bce8fc-b423-46b1-af71-3759ab4670bc" assert "http://pleroma.example.org:4000/users/lain5" in activity.data["to"] - assert activity.data["object"]["id"] == - "tag:gs.example.org:4040,2017-04-25:noticeId=55:objectType=note" + assert object.data["id"] == "tag:gs.example.org:4040,2017-04-25:noticeId=55:objectType=note" assert "https://www.w3.org/ns/activitystreams#Public" in activity.data["to"] end @@ -285,8 +296,8 @@ test "handle incoming follows" do assert activity.data["object"] == "https://pawoo.net/users/pekorino" refute activity.local - follower = User.get_by_ap_id(activity.data["actor"]) - followed = User.get_by_ap_id(activity.data["object"]) + follower = User.get_cached_by_ap_id(activity.data["actor"]) + followed = User.get_cached_by_ap_id(activity.data["object"]) assert User.following?(follower, followed) end @@ -309,8 +320,8 @@ test "handle incoming unfollows with existing follow" do assert activity.data["object"]["object"] == "https://pawoo.net/users/pekorino" refute activity.local - follower = User.get_by_ap_id(activity.data["actor"]) - followed = User.get_by_ap_id(activity.data["object"]["object"]) + follower = User.get_cached_by_ap_id(activity.data["actor"]) + followed = User.get_cached_by_ap_id(activity.data["object"]["object"]) refute User.following?(follower, followed) end @@ -344,7 +355,7 @@ test "tries to use the information in poco fields" do {:ok, user} = OStatus.find_or_make_user(uri) - user = Pleroma.User.get_by_id(user.id) + user = Pleroma.User.get_cached_by_id(user.id) assert user.name == "Constance Variable" assert user.nickname == "lambadalambda@social.heldscal.la" assert user.local == false @@ -495,7 +506,7 @@ test "it builds a missing status from an html url" do assert activity.data["actor"] == "https://shitposter.club/user/1" - assert activity.data["object"]["id"] == + assert activity.data["object"] == "tag:shitposter.club,2017-05-05:noticeId=2827873:objectType=comment" end) end @@ -504,7 +515,7 @@ test "it works for atom notes, too" do url = "https://social.sakamoto.gq/objects/0ccc1a2c-66b0-4305-b23a-7f7f2b040056" {:ok, [activity]} = OStatus.fetch_activity_from_url(url) assert activity.data["actor"] == "https://social.sakamoto.gq/users/eal" - assert activity.data["object"]["id"] == url + assert activity.data["object"] == url end end diff --git a/test/web/push/impl_test.exs b/test/web/push/impl_test.exs index 6bac2c9f6..1e948086a 100644 --- a/test/web/push/impl_test.exs +++ b/test/web/push/impl_test.exs @@ -5,6 +5,8 @@ defmodule Pleroma.Web.Push.ImplTest do use Pleroma.DataCase + alias Pleroma.Object + alias Pleroma.Web.CommonAPI alias Pleroma.Web.Push.Impl alias Pleroma.Web.Push.Subscription @@ -52,16 +54,12 @@ test "performs sending notifications" do data: %{alerts: %{"follow" => true, "mention" => false}} ) + {:ok, activity} = CommonAPI.post(user, %{"status" => " "Create", - "actor" => user.ap_id, - "object" => %{"content" => " + "Lorem ipsum dolor sit amet, consectetur :firefox: adipiscing elit. Fusce sagittis finibus turpis." + }) + + object = Object.normalize(activity) + assert Impl.format_body( %{ - activity: %{ - data: %{ - "type" => "Create", - "object" => %{ - "content" => - "Lorem ipsum dolor sit amet, consectetur :bear: adipiscing elit. Fusce sagittis finibus turpis." - } - } - } + activity: activity }, - %{nickname: "Bob"} + user, + object ) == "@Bob: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sagittis fini..." end test "renders body for follow activity" do - assert Impl.format_body(%{activity: %{data: %{"type" => "Follow"}}}, %{nickname: "Bob"}) == + user = insert(:user, nickname: "Bob") + other_user = insert(:user) + {:ok, _, _, activity} = CommonAPI.follow(user, other_user) + object = Object.normalize(activity) + + assert Impl.format_body(%{activity: activity}, user, object) == "@Bob has followed you" end test "renders body for announce activity" do user = insert(:user) - note = - insert(:note, %{ - data: %{ - "content" => - "Lorem ipsum dolor sit amet, consectetur :bear: adipiscing elit. Fusce sagittis finibus turpis." - } + {:ok, activity} = + CommonAPI.post(user, %{ + "status" => + "Lorem ipsum dolor sit amet, consectetur :firefox: adipiscing elit. Fusce sagittis finibus turpis." }) - note_activity = insert(:note_activity, %{note: note}) - announce_activity = insert(:announce_activity, %{user: user, note_activity: note_activity}) + {:ok, announce_activity, _} = CommonAPI.repeat(activity.id, user) + object = Object.normalize(activity) - assert Impl.format_body(%{activity: announce_activity}, user) == + assert Impl.format_body(%{activity: announce_activity}, user, object) == "@#{user.nickname} repeated: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sagittis fini..." end test "renders body for like activity" do - assert Impl.format_body(%{activity: %{data: %{"type" => "Like"}}}, %{nickname: "Bob"}) == + user = insert(:user, nickname: "Bob") + + {:ok, activity} = + CommonAPI.post(user, %{ + "status" => + "Lorem ipsum dolor sit amet, consectetur :firefox: adipiscing elit. Fusce sagittis finibus turpis." + }) + + {:ok, activity, _} = CommonAPI.favorite(activity.id, user) + object = Object.normalize(activity) + + assert Impl.format_body(%{activity: activity}, user, object) == "@Bob has favorited your post" end end diff --git a/test/web/salmon/salmon_test.exs b/test/web/salmon/salmon_test.exs index 35503259b..7532578ca 100644 --- a/test/web/salmon/salmon_test.exs +++ b/test/web/salmon/salmon_test.exs @@ -99,7 +99,7 @@ test "it pushes an activity to remote accounts it's addressed to" do } {:ok, activity} = Repo.insert(%Activity{data: activity_data, recipients: activity_data["to"]}) - user = User.get_by_ap_id(activity.data["actor"]) + user = User.get_cached_by_ap_id(activity.data["actor"]) {:ok, user} = Pleroma.Web.WebFinger.ensure_keys_present(user) poster = fn url, _data, _headers -> diff --git a/test/web/twitter_api/twitter_api_controller_test.exs b/test/web/twitter_api/twitter_api_controller_test.exs index 72b7ea85e..43ad71a16 100644 --- a/test/web/twitter_api/twitter_api_controller_test.exs +++ b/test/web/twitter_api/twitter_api_controller_test.exs @@ -22,8 +22,9 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do alias Pleroma.Web.TwitterAPI.TwitterAPI alias Pleroma.Web.TwitterAPI.UserView - import Pleroma.Factory import Mock + import Pleroma.Factory + import Swoosh.TestAssertions @banner "data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7" @@ -269,7 +270,7 @@ test "returns 200 to authenticated request when the instance is public", test "returns one status", %{conn: conn} do user = insert(:user) {:ok, activity} = CommonAPI.post(user, %{"status" => "Hey!"}) - actor = Repo.get_by!(User, ap_id: activity.data["actor"]) + actor = User.get_cached_by_ap_id(activity.data["actor"]) conn = conn @@ -719,7 +720,7 @@ test "with credentials", %{conn: conn, user: current_user} do |> with_credentials(current_user.nickname, "test") |> post("/api/friendships/create.json", %{user_id: followed.id}) - current_user = User.get_by_id(current_user.id) + current_user = User.get_cached_by_id(current_user.id) assert User.ap_followers(followed) in current_user.following assert json_response(conn, 200) == @@ -734,8 +735,8 @@ test "for restricted account", %{conn: conn, user: current_user} do |> with_credentials(current_user.nickname, "test") |> post("/api/friendships/create.json", %{user_id: followed.id}) - current_user = User.get_by_id(current_user.id) - followed = User.get_by_id(followed.id) + current_user = User.get_cached_by_id(current_user.id) + followed = User.get_cached_by_id(followed.id) refute User.ap_followers(followed) in current_user.following @@ -764,7 +765,7 @@ test "with credentials", %{conn: conn, user: current_user} do |> with_credentials(current_user.nickname, "test") |> post("/api/friendships/destroy.json", %{user_id: followed.id}) - current_user = User.get_by_id(current_user.id) + current_user = User.get_cached_by_id(current_user.id) assert current_user.following == [current_user.ap_id] assert json_response(conn, 200) == @@ -788,7 +789,7 @@ test "with credentials", %{conn: conn, user: current_user} do |> with_credentials(current_user.nickname, "test") |> post("/api/blocks/create.json", %{user_id: blocked.id}) - current_user = User.get_by_id(current_user.id) + current_user = User.get_cached_by_id(current_user.id) assert User.blocks?(current_user, blocked) assert json_response(conn, 200) == @@ -815,7 +816,7 @@ test "with credentials", %{conn: conn, user: current_user} do |> with_credentials(current_user.nickname, "test") |> post("/api/blocks/destroy.json", %{user_id: blocked.id}) - current_user = User.get_by_id(current_user.id) + current_user = User.get_cached_by_id(current_user.id) assert current_user.info.blocks == [] assert json_response(conn, 200) == @@ -846,7 +847,7 @@ test "with credentials", %{conn: conn, user: current_user} do |> with_credentials(current_user.nickname, "test") |> post("/api/qvitter/update_avatar.json", %{img: avatar_image}) - current_user = User.get_by_id(current_user.id) + current_user = User.get_cached_by_id(current_user.id) assert is_map(current_user.avatar) assert json_response(conn, 200) == @@ -955,7 +956,7 @@ test "with credentials", %{conn: conn, user: current_user} do |> post(request_path) activity = Activity.get_by_id(note_activity.id) - activity_user = User.get_by_ap_id(note_activity.data["actor"]) + activity_user = User.get_cached_by_ap_id(note_activity.data["actor"]) assert json_response(response, 200) == ActivityView.render("activity.json", %{ @@ -993,7 +994,7 @@ test "with credentials", %{conn: conn, user: current_user} do |> post(request_path) activity = Activity.get_by_id(note_activity.id) - activity_user = User.get_by_ap_id(note_activity.data["actor"]) + activity_user = User.get_cached_by_ap_id(note_activity.data["actor"]) assert json_response(response, 200) == ActivityView.render("activity.json", %{ @@ -1021,7 +1022,7 @@ test "it creates a new user", %{conn: conn} do user = json_response(conn, 200) - fetched_user = User.get_by_nickname("lain") + fetched_user = User.get_cached_by_nickname("lain") assert user == UserView.render("show.json", %{user: fetched_user}) end @@ -1063,8 +1064,14 @@ test "it creates a PasswordResetToken record for user", %{user: user} do test "it sends an email to user", %{user: user} do token_record = Repo.get_by(Pleroma.PasswordResetToken, user_id: user.id) - Swoosh.TestAssertions.assert_email_sent( - Pleroma.UserEmail.password_reset_email(user, token_record.token) + email = Pleroma.Emails.UserEmail.password_reset_email(user, token_record.token) + notify_email = Pleroma.Config.get([:instance, :notify_email]) + instance_name = Pleroma.Config.get([:instance, :name]) + + assert_email_sent( + from: {instance_name, notify_email}, + to: {user.name, user.email}, + html_body: email.html_body ) end end @@ -1109,7 +1116,7 @@ test "it redirects to root url", %{conn: conn, user: user} do test "it confirms the user account", %{conn: conn, user: user} do get(conn, "/api/account/confirm_email/#{user.id}/#{user.info.confirmation_token}") - user = User.get_by_id(user.id) + user = User.get_cached_by_id(user.id) refute user.info.confirmation_pending refute user.info.confirmation_token @@ -1163,7 +1170,15 @@ test "it sends confirmation email", %{conn: conn, user: user} do |> assign(:user, user) |> post("/api/account/resend_confirmation_email?email=#{user.email}") - Swoosh.TestAssertions.assert_email_sent(Pleroma.UserEmail.account_confirmation_email(user)) + email = Pleroma.Emails.UserEmail.account_confirmation_email(user) + notify_email = Pleroma.Config.get([:instance, :notify_email]) + instance_name = Pleroma.Config.get([:instance, :name]) + + assert_email_sent( + from: {instance_name, notify_email}, + to: {user.name, user.email}, + html_body: email.html_body + ) end end @@ -1727,7 +1742,7 @@ test "with credentials, valid password and matching new password and confirmatio }) assert json_response(conn, 200) == %{"status" => "success"} - fetched_user = User.get_by_id(current_user.id) + fetched_user = User.get_cached_by_id(current_user.id) assert Pbkdf2.checkpw("newpass", fetched_user.password_hash) == true end end @@ -1768,8 +1783,8 @@ test "it lists friend requests" do {:ok, _activity} = ActivityPub.follow(other_user, user) - user = User.get_by_id(user.id) - other_user = User.get_by_id(other_user.id) + user = User.get_cached_by_id(user.id) + other_user = User.get_cached_by_id(other_user.id) assert User.following?(other_user, user) == false @@ -1808,8 +1823,8 @@ test "it approves a friend request" do {:ok, _activity} = ActivityPub.follow(other_user, user) - user = User.get_by_id(user.id) - other_user = User.get_by_id(other_user.id) + user = User.get_cached_by_id(user.id) + other_user = User.get_cached_by_id(other_user.id) assert User.following?(other_user, user) == false @@ -1831,8 +1846,8 @@ test "it denies a friend request" do {:ok, _activity} = ActivityPub.follow(other_user, user) - user = User.get_by_id(user.id) - other_user = User.get_by_id(other_user.id) + user = User.get_cached_by_id(user.id) + other_user = User.get_cached_by_id(other_user.id) assert User.following?(other_user, user) == false @@ -1901,7 +1916,7 @@ test "it performs the upload and sets `data[actor]` with AP id of uploader user" describe "POST /api/media/metadata/create" do setup do object = insert(:note) - user = User.get_by_ap_id(object.data["actor"]) + user = User.get_cached_by_ap_id(object.data["actor"]) %{object: object, user: user} end diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs index a4540e651..d601c8f1f 100644 --- a/test/web/twitter_api/twitter_api_test.exs +++ b/test/web/twitter_api/twitter_api_test.exs @@ -41,18 +41,19 @@ test "create a status" do input = %{ "status" => - "Hello again, @shp.\nThis is on another :moominmamma: line. #2hu #epic #phantasmagoric", + "Hello again, @shp.\nThis is on another :firefox: line. #2hu #epic #phantasmagoric", "media_ids" => [object.id] } {:ok, activity = %Activity{}} = TwitterAPI.create_status(user, input) + object = Object.normalize(activity.data["object"]) expected_text = - "Hello again, @shp.<script></script>
This is on another :moominmamma: line.
image.jpg" + "Hello again, @shp.<script></script>
This is on another :firefox: line.
image.jpg" - assert get_in(activity.data, ["object", "content"]) == expected_text - assert get_in(activity.data, ["object", "type"]) == "Note" - assert get_in(activity.data, ["object", "actor"]) == user.ap_id + assert get_in(object.data, ["content"]) == expected_text + assert get_in(object.data, ["type"]) == "Note" + assert get_in(object.data, ["actor"]) == user.ap_id assert get_in(activity.data, ["actor"]) == user.ap_id assert Enum.member?(get_in(activity.data, ["cc"]), User.ap_followers(user)) @@ -64,21 +65,20 @@ test "create a status" do assert Enum.member?(get_in(activity.data, ["to"]), "shp") assert activity.local == true - assert %{"moominmamma" => "http://localhost:4001/finmoji/128px/moominmamma-128.png"} = - activity.data["object"]["emoji"] + assert %{"firefox" => "http://localhost:4001/emoji/Firefox.gif"} = object.data["emoji"] # hashtags - assert activity.data["object"]["tag"] == ["2hu", "epic", "phantasmagoric"] + assert object.data["tag"] == ["2hu", "epic", "phantasmagoric"] # Add a context assert is_binary(get_in(activity.data, ["context"])) - assert is_binary(get_in(activity.data, ["object", "context"])) + assert is_binary(get_in(object.data, ["context"])) - assert is_list(activity.data["object"]["attachment"]) + assert is_list(object.data["attachment"]) - assert activity.data["object"] == Object.get_by_ap_id(activity.data["object"]["id"]).data + assert activity.data["object"] == object.data["id"] - user = User.get_by_ap_id(user.ap_id) + user = User.get_cached_by_ap_id(user.ap_id) assert user.info.note_count == 1 end @@ -91,6 +91,7 @@ test "create a status that is a reply" do } {:ok, activity = %Activity{}} = TwitterAPI.create_status(user, input) + object = Object.normalize(activity.data["object"]) input = %{ "status" => "Here's your (you).", @@ -98,14 +99,14 @@ test "create a status that is a reply" do } {:ok, reply = %Activity{}} = TwitterAPI.create_status(user, input) + reply_object = Object.normalize(reply.data["object"]) assert get_in(reply.data, ["context"]) == get_in(activity.data, ["context"]) - assert get_in(reply.data, ["object", "context"]) == - get_in(activity.data, ["object", "context"]) + assert get_in(reply_object.data, ["context"]) == get_in(object.data, ["context"]) - assert get_in(reply.data, ["object", "inReplyTo"]) == get_in(activity.data, ["object", "id"]) - assert get_in(reply.data, ["object", "inReplyToStatusId"]) == activity.id + assert get_in(reply_object.data, ["inReplyTo"]) == get_in(activity.data, ["object"]) + assert Activity.get_in_reply_to_activity(reply).id == activity.id end test "Follow another user using user_id" do @@ -128,7 +129,7 @@ test "Follow another user using screen_name" do assert User.ap_followers(followed) in user.following - followed = User.get_by_ap_id(followed.ap_id) + followed = User.get_cached_by_ap_id(followed.ap_id) assert followed.info.follower_count == 1 {:error, msg} = TwitterAPI.follow(user, %{"screen_name" => followed.nickname}) @@ -280,7 +281,7 @@ test "it registers a new user and returns the user." do {:ok, user} = TwitterAPI.register_user(data) - fetched_user = User.get_by_nickname("lain") + fetched_user = User.get_cached_by_nickname("lain") assert UserView.render("show.json", %{user: user}) == UserView.render("show.json", %{user: fetched_user}) @@ -298,7 +299,7 @@ test "it registers a new user with empty string in bio and returns the user." do {:ok, user} = TwitterAPI.register_user(data) - fetched_user = User.get_by_nickname("lain") + fetched_user = User.get_cached_by_nickname("lain") assert UserView.render("show.json", %{user: user}) == UserView.render("show.json", %{user: fetched_user}) @@ -325,7 +326,16 @@ test "it sends confirmation email if :account_activation_required is specified i assert user.info.confirmation_pending - Swoosh.TestAssertions.assert_email_sent(Pleroma.UserEmail.account_confirmation_email(user)) + email = Pleroma.Emails.UserEmail.account_confirmation_email(user) + + notify_email = Pleroma.Config.get([:instance, :notify_email]) + instance_name = Pleroma.Config.get([:instance, :name]) + + Swoosh.TestAssertions.assert_email_sent( + from: {instance_name, notify_email}, + to: {user.name, user.email}, + html_body: email.html_body + ) end test "it registers a new user and parses mentions in the bio" do @@ -384,7 +394,7 @@ test "returns user on success" do {:ok, user} = TwitterAPI.register_user(data) - fetched_user = User.get_by_nickname("vinny") + fetched_user = User.get_cached_by_nickname("vinny") invite = Repo.get_by(UserInviteToken, token: invite.token) assert invite.used == true @@ -407,7 +417,7 @@ test "returns error on invalid token" do {:error, msg} = TwitterAPI.register_user(data) assert msg == "Invalid token" - refute User.get_by_nickname("GrimReaper") + refute User.get_cached_by_nickname("GrimReaper") end test "returns error on expired token" do @@ -427,7 +437,7 @@ test "returns error on expired token" do {:error, msg} = TwitterAPI.register_user(data) assert msg == "Expired token" - refute User.get_by_nickname("GrimReaper") + refute User.get_cached_by_nickname("GrimReaper") end end @@ -452,7 +462,7 @@ test "returns error on expired token" do check_fn = fn invite -> data = Map.put(data, "token", invite.token) {:ok, user} = TwitterAPI.register_user(data) - fetched_user = User.get_by_nickname("vinny") + fetched_user = User.get_cached_by_nickname("vinny") assert UserView.render("show.json", %{user: user}) == UserView.render("show.json", %{user: fetched_user}) @@ -489,7 +499,7 @@ test "returns an error on overdue date", %{data: data} do {:error, msg} = TwitterAPI.register_user(data) assert msg == "Expired token" - refute User.get_by_nickname("vinny") + refute User.get_cached_by_nickname("vinny") invite = Repo.get_by(UserInviteToken, token: invite.token) refute invite.used @@ -524,7 +534,7 @@ test "returns user on success, after him registration fails" do } {:ok, user} = TwitterAPI.register_user(data) - fetched_user = User.get_by_nickname("vinny") + fetched_user = User.get_cached_by_nickname("vinny") invite = Repo.get_by(UserInviteToken, token: invite.token) assert invite.used == true @@ -545,7 +555,7 @@ test "returns user on success, after him registration fails" do {:error, msg} = TwitterAPI.register_user(data) assert msg == "Expired token" - refute User.get_by_nickname("GrimReaper") + refute User.get_cached_by_nickname("GrimReaper") end end @@ -575,7 +585,7 @@ test "returns user on success" do } {:ok, user} = TwitterAPI.register_user(data) - fetched_user = User.get_by_nickname("vinny") + fetched_user = User.get_cached_by_nickname("vinny") invite = Repo.get_by(UserInviteToken, token: invite.token) refute invite.used @@ -600,7 +610,7 @@ test "error after max uses" do } {:ok, user} = TwitterAPI.register_user(data) - fetched_user = User.get_by_nickname("vinny") + fetched_user = User.get_cached_by_nickname("vinny") invite = Repo.get_by(UserInviteToken, token: invite.token) assert invite.used == true @@ -620,7 +630,7 @@ test "error after max uses" do {:error, msg} = TwitterAPI.register_user(data) assert msg == "Expired token" - refute User.get_by_nickname("GrimReaper") + refute User.get_cached_by_nickname("GrimReaper") end test "returns error on overdue date" do @@ -640,7 +650,7 @@ test "returns error on overdue date" do {:error, msg} = TwitterAPI.register_user(data) assert msg == "Expired token" - refute User.get_by_nickname("GrimReaper") + refute User.get_cached_by_nickname("GrimReaper") end test "returns error on with overdue date and after max" do @@ -662,7 +672,7 @@ test "returns error on with overdue date and after max" do {:error, msg} = TwitterAPI.register_user(data) assert msg == "Expired token" - refute User.get_by_nickname("GrimReaper") + refute User.get_cached_by_nickname("GrimReaper") end end @@ -678,7 +688,7 @@ test "it returns the error on registration problems" do {:error, error_object} = TwitterAPI.register_user(data) assert is_binary(error_object[:error]) - refute User.get_by_nickname("lain") + refute User.get_cached_by_nickname("lain") end test "it assigns an integer conversation_id" do @@ -699,7 +709,7 @@ test "fetches a user by uri" do id = "https://mastodon.social/users/lambadalambda" user = insert(:user) {:ok, represented} = TwitterAPI.get_external_profile(user, id) - remote = User.get_by_ap_id(id) + remote = User.get_cached_by_ap_id(id) assert represented["id"] == UserView.render("show.json", %{user: remote, for: user})["id"] diff --git a/test/web/twitter_api/util_controller_test.exs b/test/web/twitter_api/util_controller_test.exs index a4b3d651a..56474447b 100644 --- a/test/web/twitter_api/util_controller_test.exs +++ b/test/web/twitter_api/util_controller_test.exs @@ -26,6 +26,21 @@ test "it returns HTTP 200", %{conn: conn} do assert response == "job started" end + test "it imports new-style mastodon follow lists", %{conn: conn} do + user1 = insert(:user) + user2 = insert(:user) + + response = + conn + |> assign(:user, user1) + |> post("/api/pleroma/follow_import", %{ + "list" => "Account address,Show boosts\n#{user2.ap_id},true" + }) + |> json_response(:ok) + + assert response == "job started" + end + test "requires 'follow' permission", %{conn: conn} do token1 = insert(:oauth_token, scopes: ["read", "write"]) token2 = insert(:oauth_token, scopes: ["follow"]) @@ -230,4 +245,10 @@ test "show follow account page if the `acct` is a account link", %{conn: conn} d assert html_response(response, 200) =~ "Log in to follow" end end + + test "GET /api/pleroma/healthcheck", %{conn: conn} do + conn = get(conn, "/api/pleroma/healthcheck") + + assert conn.status in [200, 503] + end end diff --git a/test/web/twitter_api/views/activity_view_test.exs b/test/web/twitter_api/views/activity_view_test.exs index ee9a0c834..d84ab7420 100644 --- a/test/web/twitter_api/views/activity_view_test.exs +++ b/test/web/twitter_api/views/activity_view_test.exs @@ -6,6 +6,7 @@ defmodule Pleroma.Web.TwitterAPI.ActivityViewTest do use Pleroma.DataCase alias Pleroma.Activity + alias Pleroma.Object alias Pleroma.Repo alias Pleroma.User alias Pleroma.Web.ActivityPub.ActivityPub @@ -90,16 +91,16 @@ test "a create activity with a html status" do test "a create activity with a summary containing emoji" do {:ok, activity} = CommonAPI.post(insert(:user), %{ - "spoiler_text" => ":woollysocks: meow", + "spoiler_text" => ":firefox: meow", "status" => "." }) result = ActivityView.render("activity.json", activity: activity) - expected = ":woollysocks: meow" + expected = ":firefox: meow" expected_html = - "\"woollysocks\" meow" + "\"firefox\" meow" assert result["summary"] == expected assert result["summary_html"] == expected_html @@ -125,10 +126,11 @@ test "a create activity with a note" do other_user = insert(:user, %{nickname: "shp"}) {:ok, activity} = CommonAPI.post(user, %{"status" => "Hey @shp!", "visibility" => "direct"}) + object = Object.normalize(activity.data["object"]) result = ActivityView.render("activity.json", activity: activity) - convo_id = Utils.context_to_conversation_id(activity.data["object"]["context"]) + convo_id = Utils.context_to_conversation_id(object.data["context"]) expected = %{ "activity_type" => "post", @@ -136,8 +138,8 @@ test "a create activity with a note" do "attentions" => [ UserView.render("show.json", %{user: other_user}) ], - "created_at" => activity.data["object"]["published"] |> Utils.date_to_asctime(), - "external_url" => activity.data["object"]["id"], + "created_at" => object.data["published"] |> Utils.date_to_asctime(), + "external_url" => object.data["id"], "fave_num" => 0, "favorited" => false, "id" => activity.id, @@ -161,7 +163,7 @@ test "a create activity with a note" do }\">@shp
!", "tags" => [], "text" => "Hey @shp!", - "uri" => activity.data["object"]["id"], + "uri" => object.data["id"], "user" => UserView.render("show.json", %{user: user}), "visibility" => "direct", "card" => nil, @@ -175,8 +177,9 @@ test "a list of activities" do user = insert(:user) other_user = insert(:user, %{nickname: "shp"}) {:ok, activity} = CommonAPI.post(user, %{"status" => "Hey @shp!"}) + object = Object.normalize(activity.data["object"]) - convo_id = Utils.context_to_conversation_id(activity.data["object"]["context"]) + convo_id = Utils.context_to_conversation_id(object.data["context"]) mocks = [ { @@ -277,9 +280,9 @@ test "an announce activity" do other_user = insert(:user, %{nickname: "shp"}) {:ok, activity} = CommonAPI.post(user, %{"status" => "Hey @shp!"}) - {:ok, announce, _object} = CommonAPI.repeat(activity.id, other_user) + {:ok, announce, object} = CommonAPI.repeat(activity.id, other_user) - convo_id = Utils.context_to_conversation_id(activity.data["object"]["context"]) + convo_id = Utils.context_to_conversation_id(object.data["context"]) activity = Activity.get_by_id(activity.id) @@ -357,7 +360,7 @@ test "a delete activity" do test "a peertube video" do {:ok, object} = - ActivityPub.fetch_object_from_id( + Pleroma.Object.Fetcher.fetch_object_from_id( "https://peertube.moe/videos/watch/df5f464b-be8d-46fb-ad81-2d4c2d1630e3" ) diff --git a/test/web/twitter_api/views/user_view_test.exs b/test/web/twitter_api/views/user_view_test.exs index 0feaf4b64..c99dbddeb 100644 --- a/test/web/twitter_api/views/user_view_test.exs +++ b/test/web/twitter_api/views/user_view_test.exs @@ -89,29 +89,34 @@ test "A user" do "following" => false, "follows_you" => false, "statusnet_blocking" => false, - "rights" => %{ - "delete_others_notice" => false, - "admin" => false - }, "statusnet_profile_url" => user.ap_id, "cover_photo" => banner, "background_image" => nil, "is_local" => true, "locked" => false, - "default_scope" => "public", - "no_rich_text" => false, "hide_follows" => false, "hide_followers" => false, "fields" => [], "pleroma" => %{ "confirmation_pending" => false, "tags" => [] - } + }, + "rights" => %{"admin" => false, "delete_others_notice" => false}, + "role" => "member" } assert represented == UserView.render("show.json", %{user: user}) end + test "User exposes settings for themselves and only for themselves", %{user: user} do + as_user = UserView.render("show.json", %{user: user, for: user}) + assert as_user["default_scope"] == user.info.default_scope + assert as_user["no_rich_text"] == user.info.no_rich_text + as_stranger = UserView.render("show.json", %{user: user}) + refute as_stranger["default_scope"] + refute as_stranger["no_rich_text"] + end + test "A user for a given other follower", %{user: user} do follower = insert(:user, %{following: [User.ap_followers(user)]}) {:ok, user} = User.update_follower_count(user) @@ -137,24 +142,20 @@ test "A user for a given other follower", %{user: user} do "following" => true, "follows_you" => false, "statusnet_blocking" => false, - "rights" => %{ - "delete_others_notice" => false, - "admin" => false - }, "statusnet_profile_url" => user.ap_id, "cover_photo" => banner, "background_image" => nil, "is_local" => true, "locked" => false, - "default_scope" => "public", - "no_rich_text" => false, "hide_follows" => false, "hide_followers" => false, "fields" => [], "pleroma" => %{ "confirmation_pending" => false, "tags" => [] - } + }, + "rights" => %{"admin" => false, "delete_others_notice" => false}, + "role" => "member" } assert represented == UserView.render("show.json", %{user: user, for: follower}) @@ -186,24 +187,20 @@ test "A user that follows you", %{user: user} do "following" => false, "follows_you" => true, "statusnet_blocking" => false, - "rights" => %{ - "delete_others_notice" => false, - "admin" => false - }, "statusnet_profile_url" => follower.ap_id, "cover_photo" => banner, "background_image" => nil, "is_local" => true, "locked" => false, - "default_scope" => "public", - "no_rich_text" => false, "hide_follows" => false, "hide_followers" => false, "fields" => [], "pleroma" => %{ "confirmation_pending" => false, "tags" => [] - } + }, + "rights" => %{"admin" => false, "delete_others_notice" => false}, + "role" => "member" } assert represented == UserView.render("show.json", %{user: follower, for: user}) @@ -272,27 +269,23 @@ test "A blocked user for the blocker" do "following" => false, "follows_you" => false, "statusnet_blocking" => true, - "rights" => %{ - "delete_others_notice" => false, - "admin" => false - }, "statusnet_profile_url" => user.ap_id, "cover_photo" => banner, "background_image" => nil, "is_local" => true, "locked" => false, - "default_scope" => "public", - "no_rich_text" => false, "hide_follows" => false, "hide_followers" => false, "fields" => [], "pleroma" => %{ "confirmation_pending" => false, "tags" => [] - } + }, + "rights" => %{"admin" => false, "delete_others_notice" => false}, + "role" => "member" } - blocker = User.get_by_id(blocker.id) + blocker = User.get_cached_by_id(blocker.id) assert represented == UserView.render("show.json", %{user: user, for: blocker}) end diff --git a/uploads/.gitignore b/uploads/.gitignore new file mode 100644 index 000000000..523e584a7 --- /dev/null +++ b/uploads/.gitignore @@ -0,0 +1,3 @@ +# Git will ignore everything in this directory except this file. +* +!.gitignore