Compare commits

..

157 Commits

Author SHA1 Message Date
Ariadne Conill dd3a2ce506 Merge gitea.treehouse.systems:mirrors/mastodon-glitch into chore/merge-20230511-1
ci/woodpecker/push/woodpecker Pipeline failed Details
2023-05-11 17:27:17 -07:00
Claire f08f6d20e6
Merge pull request #2215 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
2023-05-09 14:47:11 +02:00
Renaud Chaput ea04f33f50 [Glitch] Fixes build errors from some previous TS-related commits
Port 45579a26cf to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-08 22:15:00 +02:00
fusagiko / takayamaki 3d9e35375c [Glitch] Rewrite actions/app.ts and reducers/missed_updates.ts with createAction
Port 0999cb4601 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-08 22:15:00 +02:00
Renaud Chaput a33d6c946a [Glitch] Remove MastodonMap TS type
Port 9a52a7f7a0 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-08 22:15:00 +02:00
kouhai dev acf635ffe8 th: cache busting? not on our watch
ci/woodpecker/push/woodpecker Pipeline was successful Details
2023-04-24 22:09:57 -07:00
kouhai dev fdd48f3b43 th: date-based tags suck, actually 2023-04-24 22:09:53 -07:00
kouhai dev 74742ba16d th: add woodpecker config to dockerignore 2023-04-24 22:09:47 -07:00
kouhai dev f177325ba7 th: better image tags hopefully 2023-04-24 22:09:44 -07:00
kouhai dev e7ef14a4d7 Merge remote-tracking branch 'glitch/main' 2023-04-23 23:23:28 -07:00
kouhai dev 7e1924e3fb Merge remote-tracking branch 'glitch/main'
ci/woodpecker/push/woodpecker Pipeline was successful Details
2023-04-22 01:48:47 -07:00
kouhai dev d5e19ad44a th: everyone (doesn't) gets rspec'd in ci :3
ci/woodpecker/push/woodpecker Pipeline was successful Details
2023-04-22 01:21:55 -07:00
kouhai dev 2a31266b9d th: speedy clone for fast(er) ci
ci/woodpecker/push/woodpecker Pipeline was successful Details
2023-04-22 00:38:08 -07:00
kouhai dev ad9c9bb74b Merge remote-tracking branch 'glitch/main' 2023-04-22 00:38:08 -07:00
kouhai dev 6b29db907c th: fix presenter before merge 2023-04-22 00:38:08 -07:00
kouhai dev c13cde3589 th: fix build 2023-04-22 00:38:08 -07:00
kouhai dev 7499f170b8 th: fix extension 2023-04-22 00:38:08 -07:00
kouhai dev 096d584d9a th: hack: fix excessively noisy babel traces 2023-04-22 00:38:08 -07:00
kouhai dev d8b8b3d3fc th: ugh 2023-04-22 00:38:08 -07:00
kouhai dev b822d60675 th: compose out of the box, more-or-less 2023-04-22 00:38:08 -07:00
kouhai dev c9a49fc3dd th: fun, image tagging, and SOURCE_TAG 2023-04-22 00:38:08 -07:00
kouhai dev 0382d1efe7 th: optimize dockerfile (attempt was made) 2023-04-22 00:38:08 -07:00
kouhai dev 236f063dd3 th: berry flavored yarn 2023-04-22 00:38:08 -07:00
kouhai dev a2faa867a5 th: update js deps 2023-04-22 00:38:08 -07:00
kouhai dev 662a83326d Merge remote-tracking branch 'glitch/main' 2023-04-22 00:38:08 -07:00
kouhai dev 85799852d4 th: Add foreman to development deps 2023-04-22 00:38:08 -07:00
kouhai dev 66ed2c4288 th: use {RAILS,NODE}_ENV=development when running webpack-dev-server with Foreman 2023-04-22 00:38:08 -07:00
kouhai dev 01c7d03aeb Merge remote-tracking branch 'glitch/main' 2023-04-22 00:38:08 -07:00
kouhai dev 12906c7d54 th: update models, node/Gemfile state 2023-04-22 00:38:08 -07:00
kouhai dev 351f0cf51a Merge remote-tracking branch 'glitch/main' 2023-04-22 00:38:08 -07:00
kouhai dev f6c88fb2a6 Merge remote-tracking branch 'glitch/main' 2023-04-22 00:38:08 -07:00
kouhai dev 6a0b004e7b th: consistent dividers 2023-04-22 00:38:08 -07:00
kouhai dev bae4217549 th: add deps rake tasks 2023-04-22 00:38:08 -07:00
kouhai dev 8a10baa676 update default repository/source metadata 2022-12-29 22:55:49 -06:00
kouhai dev 051f883fbf update browserslist to remove unnecessary "not IE 11" 2022-12-29 22:55:49 -06:00
kouhai dev c762da600a update dockerignore 2022-12-29 22:38:44 -06:00
kouhai dev dec67bc50e temporarily remove "Get the app" link" 2022-12-29 22:38:44 -06:00
kouhai dev 0bd08b1169 quick status hover hack 2022-12-29 22:38:43 -06:00
kouhai dev 0ff80581b9 fix lints
ci/woodpecker/pr/woodpecker Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-12-29 22:23:09 -06:00
kouhai dev 4424dbad4b fix missing qt summary autofill 2022-12-29 22:23:04 -06:00
Ariadne Conill 31550094b3 Merge pull request 'merge in mastodon 4.0.2+glitch' (#41) from merge/glitch-4.0.2 into main
ci/woodpecker/push/woodpecker Pipeline was successful Details
Reviewed-on: #41
2022-12-28 22:38:23 +00:00
Ariadne Conill ba8847da0e woodpecker: use latest docker
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details
2022-12-28 22:27:57 +00:00
Ariadne Conill c66041370c Merge https://gitea.treehouse.systems/mirrors/mastodon-glitch into merge/glitch-4.0.2
ci/woodpecker/push/woodpecker Pipeline failed Details
ci/woodpecker/pr/woodpecker Pipeline failed Details
2022-12-28 22:08:51 +00:00
Ariadne Conill 98d9c84c8b Merge pull request 'Turn quote author/text into links back to the original profile/post' (#37) from ar/mastodon:turn-quotes-into-links into main
ci/woodpecker/push/woodpecker Pipeline was successful Details
Reviewed-on: #37
2022-12-28 06:59:46 +00:00
Ariadne Conill 5d0ed01191 Merge branch 'main' into turn-quotes-into-links
ci/woodpecker/pr/woodpecker Pipeline was successful Details
2022-12-28 06:59:34 +00:00
Ariadne Conill 9c51dc8dd5 activitypub: tag manager: ensure that a quote post has the OP included in to field
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-12-28 06:48:24 +00:00
Ariadne Conill 418fffcb41 models: status edit: pass through quote information to parent status 2022-12-28 06:06:49 +00:00
Ariadne Conill 985ef99590 activitypub: create: fix up quoteUri/quoteUrl/quoteURL handling
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-12-28 05:15:25 +00:00
Robert Gerus 5025713c5a status: turn quote author/text into links to original profile/post
ci/woodpecker/pr/woodpecker Pipeline was successful Details
2022-12-28 01:35:56 +01:00
Ariadne Conill 384ac613d8 reducers: add missing nullification of quote_id on reset
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-12-26 05:54:44 +00:00
Ariadne Conill c6a4f42a37 compose reducer: fix cancelling reply/quote
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-12-26 05:39:30 +00:00
Ariadne Conill 8b6e2ed562 Merge pull request 'add quote toots' (#36) from feature/quote into main
ci/woodpecker/push/woodpecker Pipeline was successful Details
Reviewed-on: #36
2022-12-26 04:52:20 +00:00
Ariadne Conill c4253c32a0 delete obsolete console.log statements
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details
2022-12-26 04:38:32 +00:00
Ariadne Conill df07456f51 add reply and quote icons to the reply/quote indicators so people know what is going on 2022-12-26 04:38:21 +00:00
Ariadne Conill 7efe4bc5d3 activitypub: fix context extensions for quote_uri 2022-12-26 04:26:52 +00:00
Ariadne Conill f0065720d6 javascript: fix dispatch 2022-12-26 04:17:21 +00:00
Ariadne Conill d23cd8da00 add quote option to detailed statuses 2022-12-26 04:09:05 +00:00
Ariadne Conill 67a7b6067a components: detailed status: suppress cards on quote posts 2022-12-26 03:59:38 +00:00
Ariadne Conill 7d4127065d formatting helper: add the quote-inline hack for incompatible clients 2022-12-26 03:57:02 +00:00
Ariadne Conill e59c40eb68 activitypub: switch to fedibird:quoteUri 2022-12-26 03:18:03 +00:00
Ariadne Conill 5a8d4265ef glitch: fix up quote indicator 2022-12-26 02:53:01 +00:00
Ariadne Conill 214a4c9e6b glitch: reducers: set up correct state for quoting 2022-12-26 01:41:45 +00:00
Ariadne Conill 766a643811 add styles for quote indicator 2022-12-26 01:41:32 +00:00
Ariadne Conill a47d917072 flavors: glitch: add quote handling to status feature 2022-12-26 01:31:57 +00:00
Ariadne Conill c7e00d4c4e flavors: glitch: add quote indicator component 2022-12-26 01:27:58 +00:00
Ariadne Conill 9d4851e3cd glitch: actions: add quoteCompose and cancelQuoteCompose 2022-12-26 01:23:25 +00:00
Ariadne Conill adf1e9fc2e flavors: glitch: action bar: add quote button 2022-12-26 01:15:54 +00:00
Ariadne Conill 08aecd24ba flavors: glitch: show emojified display name in quotes 2022-12-26 00:59:04 +00:00
Ariadne Conill 005256ae8c javascript: glitch: start rendering quotes 2022-12-25 21:11:11 +00:00
Ariadne Conill 5be6a59f80 javascript: glitch: dont render cards if the status has a quote attached 2022-12-25 10:58:25 +00:00
Ariadne Conill 0d3df3e8cf javascript: glitch: pre-process misskey quotes to remove the URL part 2022-12-25 10:46:18 +00:00
Ariadne Conill b36e884cc1 activitypub: note serializer: support _misskey keys 2022-12-25 09:16:44 +00:00
Ariadne Conill 14d001574c activitypub: case transform: support _misskey keys without messing them up 2022-12-25 09:16:44 +00:00
Ariadne Conill 61565488a6 status: support either _misskey_quote or quoteUrl for fetching quotes 2022-12-25 09:16:42 +00:00
Ariadne Conill 8d86c77a58 db: add quote_id index 2022-12-25 04:20:17 +00:00
Ariadne Conill 36955a7a56 status: prevent recursion when serializing 2022-12-25 04:20:17 +00:00
Ariadne Conill 1cef1eb847 status: disallow quoting of non-public posts 2022-12-25 04:20:16 +00:00
Ariadne Conill a697e1da13 db: add quote_id migration 2022-12-25 03:58:18 +00:00
Ariadne Conill 0b48ae2c3c sanitizer config: add quote-inline span to allowlist 2022-12-25 03:58:18 +00:00
Ariadne Conill 1df2577b89 db: add quote_id to statuses table 2022-12-25 03:58:18 +00:00
Ariadne Conill 28fb5c8c52 rest: status serializer: include quote data 2022-12-25 03:58:18 +00:00
Ariadne Conill 56d4b04358 views: add quote status html view 2022-12-25 03:58:16 +00:00
Ariadne Conill ee98c0a6f8 services: post status service: add quote_id to status parameters 2022-12-25 03:25:22 +00:00
Ariadne Conill ba965bec3d statuses controller: accept quote_id parameter 2022-12-25 03:25:22 +00:00
Ariadne Conill 968bd6f0ee activitypub: resolve quoted objects when new create activities are received 2022-12-25 03:25:22 +00:00
Ariadne Conill 6b07407820 context helper: add quoteUrl as as:quoteUrl, even though its wrong 2022-12-25 03:25:22 +00:00
Ariadne Conill 0990d5ac75 activitypub: note serializer: begrudgingly serialize quotes using misskey quoteUrl 2022-12-25 03:25:22 +00:00
Ariadne Conill b1bce9d193 models: status: add support for quoting 2022-12-25 03:25:20 +00:00
Ariadne Conill 78e8693388 services: link fetcher: do not fetch links for quotes 2022-12-25 02:00:29 +00:00
Ariadne Conill 6be7cbb0bc Merge pull request 'docker-compose: emulate production traefik setup' (#35) from feature/docker-compose-traefik into main
ci/woodpecker/push/woodpecker Pipeline was successful Details
Reviewed-on: #35
2022-12-25 01:57:01 +00:00
Ariadne Conill 4bb0e9f9ed docker-compose: emulate production traefik setup
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details
2022-12-25 01:56:20 +00:00
fox 772ba5aac3 update documentation
ci/woodpecker/push/woodpecker Pipeline was successful Details
Reviewed-on: #30
Co-authored-by: fox <fox@neko.business>
Co-committed-by: fox <fox@neko.business>
2022-12-18 03:13:45 +00:00
Rin aa24b2d072
make glitch style consistent
ci/woodpecker/pr/woodpecker Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-12-08 18:26:32 +11:00
Rin 0cd76aa22a
make default masto style consistent 2022-12-08 18:24:41 +11:00
Rin 06a2259577
fix default masto style too 2022-12-08 16:58:48 +11:00
Rin 7bf26a1094
fix missing link style in admin.scss - actually this time
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details
2022-12-08 16:31:42 +11:00
kouhai dev 41f55e5d8f update upstream glitch README/CONTRIBUTING
ci/woodpecker/pr/woodpecker Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-27 23:49:18 -06:00
kouhai dev c75ac19c8a fix REDIS_URL unix socket path parsing for relative paths 2022-11-27 23:49:18 -06:00
kouhai dev bd0da3a499 fix redis conf
ci/woodpecker/pr/woodpecker Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-24 23:01:20 -06:00
Rin e60d7e3c43
Add dir for redis data
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details
2022-11-25 14:24:44 +11:00
kouhai dev ea44d46ca9 update gitignore
ci/woodpecker/pr/woodpecker Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-24 18:58:23 -06:00
kouhai dev 17ba99b157 rewrite instructions for a self-contained dev env
ci/woodpecker/pr/woodpecker Pipeline failed Details
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-24 18:57:24 -06:00
Rin f4b48ca5ee
Command style consistency
ci/woodpecker/pr/woodpecker Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-23 19:35:13 +11:00
Rin 8e4da8677c
Fix headings
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details
2022-11-23 19:34:20 +11:00
Rin 401a51b67b
Update instructions - make everything self contained
ci/woodpecker/pr/woodpecker Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-23 19:31:19 +11:00
Rin 842498649d
Moderately curse the env file to contain everything in the project 2022-11-23 19:25:17 +11:00
Rin 17e49cf098
rename env file to conform 2022-11-23 19:22:32 +11:00
Rin ca98b0da84
Add .env.ENV.local to .gitignore 2022-11-23 19:10:31 +11:00
Rin 8a701c5ac3 Fix numbering <_<
ci/woodpecker/pr/woodpecker Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-23 07:25:24 +00:00
Rin 2790045c7e Reduce .env file to minimal config 2022-11-23 07:25:24 +00:00
Rin 74c54af904 update gitignore to ignore the pg db we created 2022-11-23 07:25:24 +00:00
Rin 59b831de9b use local pg cluster instead 2022-11-23 07:25:24 +00:00
Rin 4172c91de0 fix typo 2022-11-23 07:25:24 +00:00
Rin ced99149d6 Add SETUP instructions 2022-11-23 07:25:24 +00:00
Rin d25d8d2c07
fix no-style links in admin panel
ci/woodpecker/pr/woodpecker Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-21 18:34:21 +11:00
kouhai dev b247829276 Merge remote-tracking branch 'glitch/main'
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-15 12:03:46 -08:00
Ariadne Conill bb4ed39673 woodpecker: only do push when branch is main
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-13 03:34:08 +00:00
Ariadne Conill c4b8dfae32 Merge pull request 'logo-fix' (#12) from logo-fix into main
ci/woodpecker/push/woodpecker Pipeline was successful Details
Reviewed-on: #12
2022-11-13 03:18:16 +00:00
Rin 4a18d8e642 Fix non-rendering on certain engines
ci/woodpecker/pr/woodpecker Pipeline was successful Details
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-13 02:12:17 +00:00
Rin c048f832c1 Change Safari bookmark colour to match treehouse 2022-11-13 02:12:17 +00:00
Rin bd6a63ebed Add small icon assets 2022-11-13 02:12:17 +00:00
Ariadne Conill b0dc619c56 woodpecker: add registry secret
ci/woodpecker/push/woodpecker Pipeline was successful Details
2022-11-12 14:08:48 +00:00
Ariadne Conill d51636a24d woodpecker: remove separate login step
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-12 11:18:48 +00:00
Ariadne Conill 5650b7a785 woodpecker: expose host docker socket for now until i have time to make docker-in-docker work
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-12 10:55:53 +00:00
Ariadne Conill 1678011556 add woodpecker CI
ci/woodpecker/push/woodpecker Pipeline failed Details
2022-11-12 10:50:24 +00:00
Ariadne Conill 946388f02e Merge gitea.treehouse.systems:mirrors/mastodon-glitch 2022-11-10 07:11:03 +00:00
Ariadne Conill c515158c09 Revert "Add prefers-color-scheme based theme"
This reverts commit 652882a81b.
2022-11-10 07:05:56 +00:00
Ariadne Conill 8d1fe49d81 try to fix compile 2022-11-10 06:41:02 +00:00
Ariadne Conill ce30dbc2f9 Merge pull request 'Add prefers-color-scheme based theme' (#6) from hamptonmoore/mastodon:system-theme into main
Reviewed-on: #6
2022-11-10 06:10:04 +00:00
Ariadne Conill b1955b69eb Merge pull request 'Replace default mastodon icons with treehouse icons' (#5) from favicon-fix into main
Reviewed-on: #5
2022-11-10 06:06:10 +00:00
Hampton Moore 652882a81b Add prefers-color-scheme based theme 2022-11-09 14:33:12 -05:00
Rin da2445d301
Update favicons to use proper rounded-rect 2022-11-09 19:12:14 +11:00
Rin c4785a1e2e
Update favicons to treehouse favicons 2022-11-09 19:11:36 +11:00
Rin e5e061cdfc restore treehouse favicon 2022-11-09 17:24:22 +11:00
Ariadne Conill 1e00edfc35 config: production: traefik does not support sendfile mode 2022-11-08 09:59:32 +00:00
Ariadne Conill 8d07052d6d version: change to +glitch+th for client compatibility 2022-11-08 07:16:56 +00:00
Ariadne Conill 2c4738f592 version: change +glitch suffix to +th, since we have local modifications 2022-11-07 23:24:11 +00:00
Ariadne Conill 2bee8024c2 Merge https://gitea.treehouse.systems/treehouse/mastodon-glitch into rebase/4.0.0rc2 2022-11-07 23:20:04 +00:00
Ariadne Conill 10c928a72e fix autocomplete 2022-11-07 17:32:46 +00:00
Ariadne Conill d0e2d7df37 config: CSP: add unsafe-eval for scripts 2022-11-07 17:30:16 +00:00
Ariadne Conill 152f5c7983 app: api: base_controller: allow API access to be configurable 2022-11-06 19:13:50 +00:00
Ariadne Conill 7ceda772e4 locales: fix YAML quoting issue
Psych::SyntaxError: (/opt/mastodon/config/locales/simple_form.en.yml): mapping values are not allowed in this context at line 102 column 103
2022-11-06 18:43:54 +00:00
Ariadne Conill 8fb8a2667a Merge branch 'rebase/4.0.0rc1' 2022-11-06 18:23:41 +00:00
kouhai dev 6b7b80a892 update account request question prompt 2022-11-06 18:22:00 +00:00
Ariadne Conill a82113dbd9 vanilla: emoji: use 63x63 grid for emoji 2022-11-06 18:21:57 +00:00
Ariadne Conill 728ed66f8a glitch: emoji: set sprite sheet to 63x63 2022-11-06 18:21:52 +00:00
Ariadne Conill 117d2ed9c7 dockerfile: implement emoji-mart patch 2022-11-06 18:20:15 +00:00
Ariadne Conill 4c38a2d32c update emoji-mart sprite sheet for emoji 13.1 2022-11-06 18:20:15 +00:00
Ariadne Conill c01750a3dd add emoji 13.1 data for emoji-mart 2022-11-06 18:20:15 +00:00
kouhai dev 0ae6ca72de update account request question prompt 2022-11-06 01:36:06 -07:00
Ariadne Conill 47493323fa fixup! 2022-06-12 01:07:56 +00:00
Ariadne Conill 5f634378a2 glitch: fixup! 2022-06-12 01:07:52 +00:00
Ariadne Conill 2298d5b3ce vanilla: emoji: use 63x63 grid for emoji 2022-06-12 00:45:41 +00:00
Ariadne Conill 2ccc011e3f glitch: emoji: set sprite sheet to 63x63 2022-06-12 00:43:28 +00:00
Ariadne Conill 39f42334c2 dockerfile: implement emoji-mart patch 2022-06-11 23:57:03 +00:00
Ariadne Conill 648cad5619 update emoji-mart sprite sheet for emoji 13.1 2022-06-11 23:52:40 +00:00
Ariadne Conill a0479b5d4c add emoji 13.1 data for emoji-mart 2022-06-11 23:51:31 +00:00
105 changed files with 2270 additions and 212 deletions

View File

@ -1,6 +1,5 @@
[production]
defaults
not IE 11
not dead
[development]

View File

@ -1,21 +1,38 @@
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# Order-independent
*.sw*
*~
.DS_Store
.bundle
.env
.env.*
.git
.gitattributes
.gitignore
.github
public/system
public/assets
public/packs
node_modules
.gitignore
.woodpecker.yml
build
chart
coverage
data
elasticsearch
log
neo4j
vendor/bundle
.DS_Store
*.swp
*~
node_modules
postgres
postgres14
public/assets
public/packs
public/packs-test
public/system
redis
elasticsearch
chart
sorbet
tmp
vendor/bundle

7
.env.development Normal file
View File

@ -0,0 +1,7 @@
LOCAL_DOMAIN=localhost
ALTERNATE_DOMAINS=mastodon.internal
DB_HOST=$(pwd)/data/postgres
DB_USER=mastodon
DB_NAME=mastodon_dev
REDIS_URL=unix://./data/redis/redis-dev.sock

View File

@ -14,7 +14,7 @@
# ----------
# This identifies your server and cannot be changed safely later
# ----------
LOCAL_DOMAIN=example.com
LOCAL_DOMAIN=localhost
# Use this only if you need to run mastodon on a different domain than the one used for federation.
# You can read more about this option on https://docs.joinmastodon.org/admin/config/#web-domain
@ -25,6 +25,7 @@ LOCAL_DOMAIN=example.com
# handler@example2.com etc. for the same user. LOCAL_DOMAIN should not
# be added. Comma separated values
# ALTERNATE_DOMAINS=example1.com,example2.com
ALTERNATE_DOMAINS=mastodon.internal
# Use HTTP proxy for outgoing request (optional)
# http_proxy=http://gateway.local:8118
@ -43,14 +44,14 @@ LOCAL_DOMAIN=example.com
# Redis
# -----
REDIS_HOST=localhost
REDIS_HOST=redis
REDIS_PORT=6379
# PostgreSQL
# ----------
DB_HOST=/var/run/postgresql
DB_USER=mastodon
DB_HOST=db
DB_USER=postgres
DB_NAME=mastodon_production
DB_PASS=
DB_PORT=5432

View File

@ -3,3 +3,8 @@ NODE_ENV=tests
# Federation
LOCAL_DOMAIN=cb6e6126.ngrok.io
LOCAL_HTTPS=true
DB_HOST=$(pwd)/data/postgres
DB_USER=mastodon
DB_NAME=mastodon_dev
REDIS_URL=unix://./data/redis/redis-dev.sock

15
.gitignore vendored
View File

@ -4,6 +4,9 @@
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore local dotenv overrides
.env.*.local
# Ignore bundler config and downloaded libraries.
/.bundle
/vendor/bundle
@ -12,6 +15,9 @@
/db/*.sqlite3
/db/*.sqlite3-journal
# Ignore local data directory
/data
# Ignore all logfiles and tempfiles.
.eslintcache
/log/*
@ -63,3 +69,12 @@ yarn-debug.log
# Ignore Docker option files
docker-compose.override.yml
# Yarn Berry
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

66
.woodpecker.yml Normal file
View File

@ -0,0 +1,66 @@
variables:
environment: &docker-environment
NAME: gitea.treehouse.systems/treehouse/mastodon
DATE_COMMAND: export COMMIT_DATE=$(date -u -Idate -d @$(git show -s --format=%ct))
docker-step: &docker-step
image: docker:rc-git
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
<<: *docker-environment
clone:
git:
image: woodpeckerci/plugin-git
settings:
partial: false
depth: 10
pipeline:
build-base:
<<: *docker-step
commands:
- docker version
- docker image build -f Dockerfile --build-arg SOURCE_TAG=$CI_COMMIT_SHA . --target build-base -t $NAME:build-base
# the world is not yet ready for this step
# test:
# <<: *docker-step
# commands:
# - docker run --rm -e RAILS_ENV=test -e NODE_ENV=development $NAME:build-base sh -c 'bundle config set --local without development && bundle install && rake spec'
build:
<<: *docker-step
commands:
- eval $DATE_COMMAND
- export TAG=$${COMMIT_DATE}.$CI_COMMIT_SHA && echo $${TAG}
- docker image build -f Dockerfile --build-arg SOURCE_TAG=$CI_COMMIT_SHA . -t $NAME:latest
- docker tag $NAME:latest $NAME:$TAG
# idk what's actually persisted between steps
# /shrug this works, so,???
- echo $${TAG} > tags.txt
- echo latest >> tags.txt
# maybe we can use tags someday,,,
# tag-tag:
# image: *docker-git
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# commands:
# - docker tag $NAME:latest $NAME:$CI_COMMIT_TAG
# when:
# event: tag
push:
<<: *docker-step
commands:
- echo $REGISTRY_SECRET | docker login -u $REGISTRY_USER --password-stdin gitea.treehouse.systems
- cat tags.txt | xargs -n 1 -I% echo docker image push $NAME:%
- cat tags.txt | xargs -n 1 -I% docker image push $NAME:%
when:
event: [push, tag]
branch: main
secrets: [REGISTRY_SECRET]
environment:
<<: *docker-environment
REGISTRY_USER: ariadne

873
.yarn/releases/yarn-3.4.1.cjs vendored Executable file

File diff suppressed because one or more lines are too long

5
.yarnrc.yml Normal file
View File

@ -0,0 +1,5 @@
enableGlobalCache: true
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.4.1.cjs

View File

@ -1,10 +1,10 @@
# Contributing to Mastodon Glitch Edition
# Contributing to Mastodon Glitch+Treehouse Edition #
Thank you for your interest in contributing to the `glitch-soc` project!
Thank you for your interest in contributing to the **Treehouse Mastodon** project!
Here are some guidelines, and ways you can help.
> (This document is a bit of a work-in-progress, so please bear with us.
> If you don't see what you're looking for here, please don't hesitate to reach out!)
> (This document is a bit of a work-in-progress, so please bear with us.
> If you don't see what you're looking for here, please don't hesitate to reach out!)
## Translations
@ -12,26 +12,31 @@ You can submit glitch-soc-specific translations via [Crowdin](https://crowdin.co
[![Crowdin](https://badges.crowdin.net/glitch-soc/localized.svg)](https://crowdin.com/project/glitch-soc)
## Planning
## Planning ##
Right now a lot of the planning for this project takes place in the `#fediverse`
channel of the Treehouse Discord, or through Gitea Issues.
Right now a lot of the planning for this project takes place in our development Discord, or through GitHub Issues and Projects.
We're working on ways to improve the planning structure and better solicit feedback, and if you feel like you can help in this respect, feel free to give us a holler.
## Documentation
## Documentation ##
The documentation for this repository is available at [`glitch-soc/docs`](https://github.com/glitch-soc/docs) (online at [glitch-soc.github.io/docs/](https://glitch-soc.github.io/docs/)).
Right now, we've mostly focused on the features that make this fork different from upstream in some manner.
Adding screenshots, improving descriptions, and so forth are all ways to help contribute to the project even if you don't know any code.
The upstream Glitch documentation for this repository is available at [`glitch-soc/docs`](https://github.com/glitch-soc/docs) (online at [glitch-soc.github.io/docs/](https://glitch-soc.github.io/docs/)).
## Frontend Development
## Setup ##
For a some-batteries-required guide to setting up a development environment for this repository, read Rin's excellent
[SETUP.md](https://gitea.treehouse.systems/treehouse/mastodon/src/branch/main/SETUP.md).
## Frontend Development ##
Check out [the documentation here](https://glitch-soc.github.io/docs/contributing/frontend/) for more information.
## Backend Development
## Backend Development ##
See the guidelines below.
---
- - -
You should also try to follow the guidelines set out in the original `CONTRIBUTING.md` from `mastodon/mastodon`, reproduced below.
@ -80,6 +85,8 @@ It is not always possible to phrase every change in such a manner, but it is des
- Code style rules (rubocop, eslint)
- Normalization of locale files (i18n-tasks)
**Note**: You may need to log in and authorise the GitHub account your fork of this repository belongs to with CircleCI to enable some of the automated checks to run.
## Documentation
The [Mastodon documentation](https://docs.joinmastodon.org) is a statically generated site. You can [submit merge requests to mastodon/documentation](https://github.com/mastodon/documentation).

View File

@ -1,23 +1,24 @@
# syntax=docker/dockerfile:1.4
# This needs to be bullseye-slim because the Ruby image is built on bullseye-slim
ARG NODE_VERSION="16.20-bullseye-slim"
ARG NODE_VERSION="18.15-bullseye-slim"
FROM ghcr.io/moritzheiber/ruby-jemalloc:3.2.2-slim as ruby
FROM node:${NODE_VERSION} as build
FROM ghcr.io/moritzheiber/ruby-jemalloc:3.2.1-slim as ruby
FROM node:${NODE_VERSION} as build-base
COPY --link --from=ruby /opt/ruby /opt/ruby
ENV DEBIAN_FRONTEND="noninteractive" \
PATH="${PATH}:/opt/ruby/bin"
PATH="${PATH}:/opt/ruby/bin" \
NODE_OPTIONS=--openssl-legacy-provider
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
WORKDIR /opt/mastodon
COPY Gemfile* package.json yarn.lock /opt/mastodon/
# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential \
ca-certificates \
git \
libicu-dev \
libidn11-dev \
@ -31,7 +32,12 @@ RUN apt-get update && \
ca-certificates \
libreadline8 \
python3 \
shared-mime-info && \
shared-mime-info
COPY --link .yarn/releases/ /opt/mastodon/.yarn/releases/
COPY --link Gemfile* package.json yarn.lock .yarnrc.yml /opt/mastodon/
RUN \
bundle config set --local deployment 'true' && \
bundle config set --local without 'development test' && \
bundle config set silence_root_warning true && \
@ -39,6 +45,23 @@ RUN apt-get update && \
yarn install --pure-lockfile --production --network-timeout 600000 && \
yarn cache clean
# Precompile assets
# TODO(kouhai): we're currently patching node_modules because of emoji-mart.
# we should integrate our own fork instead.
COPY --link . /opt/mastodon
FROM build-base AS build
ENV RAILS_ENV="production" \
NODE_ENV="production"
ENV OTP_SECRET=precompile_placeholder \
SECRET_KEY_BASE=precompile_placeholder \
RAKE_NO_YARN_INSTALL_HACK=1
RUN mv ./emoji_data/all.json ./node_modules/emoji-mart/data/all.json && \
bundle exec rails assets:precompile
FROM node:${NODE_VERSION}
# Use those args to specify your own version flags & suffixes
@ -82,13 +105,14 @@ RUN apt-get update && \
# Note: no, cleaning here since Debian does this automatically
# See the file /etc/apt/apt.conf.d/docker-clean within the Docker image's filesystem
COPY --chown=mastodon:mastodon . /opt/mastodon
COPY --chown=mastodon:mastodon --from=build /opt/mastodon /opt/mastodon
COPY --link --chown=mastodon:mastodon --from=build /opt/mastodon /opt/mastodon
ARG SOURCE_TAG=''
ENV RAILS_ENV="production" \
NODE_ENV="production" \
RAILS_SERVE_STATIC_FILES="true" \
BIND="0.0.0.0" \
SOURCE_TAG="${SOURCE_TAG}" \
MASTODON_VERSION_FLAGS="${MASTODON_VERSION_FLAGS}" \
MASTODON_VERSION_SUFFIX="${MASTODON_VERSION_SUFFIX}"
@ -96,9 +120,6 @@ ENV RAILS_ENV="production" \
USER mastodon
WORKDIR /opt/mastodon
# Precompile assets
RUN OTP_SECRET=precompile_placeholder SECRET_KEY_BASE=precompile_placeholder rails assets:precompile
# Set the work dir and the container entry point
ENTRYPOINT ["/usr/bin/tini", "--"]
EXPOSE 3000 4000

View File

@ -147,6 +147,8 @@ group :development do
gem 'capistrano-yarn', '~> 2.0'
gem 'stackprof'
gem 'foreman'
end
group :production do

View File

@ -286,6 +286,7 @@ GEM
fog-core (>= 1.45, <= 2.1.0)
fog-json (>= 1.0)
ipaddress (>= 0.8)
foreman (0.87.2)
formatador (0.3.0)
fugit (1.8.1)
et-orbi (~> 1, >= 1.2.7)
@ -805,6 +806,7 @@ DEPENDENCIES
fastimage
fog-core (<= 2.4.0)
fog-openstack (~> 0.3)
foreman
fuubar (~> 2.5)
haml-rails (~> 2.0)
haml_lint
@ -897,3 +899,9 @@ DEPENDENCIES
webpacker (~> 5.4)
webpush!
xorcist (~> 1.1)
RUBY VERSION
ruby 3.0.5p211
BUNDLED WITH
2.4.6

View File

@ -1,4 +1,4 @@
web: env PORT=3000 RAILS_ENV=development bundle exec puma -C config/puma.rb
sidekiq: env PORT=3000 RAILS_ENV=development bundle exec sidekiq
stream: env PORT=4000 yarn run start
webpack: ./bin/webpack-dev-server --listen-host 0.0.0.0
webpack: env RAILS_ENV=development NODE_ENV=development ./bin/webpack-dev-server --listen-host 0.0.0.0

View File

@ -1,14 +1,20 @@
# Mastodon Glitch Edition
# Mastodon Glitch+Treehouse Edition #
> Now with automated deploys!
> Now with bunny ears!
[![Build Status](https://img.shields.io/circleci/project/github/glitch-soc/mastodon.svg)][circleci]
[![Code Climate](https://img.shields.io/codeclimate/maintainability/glitch-soc/mastodon.svg)][code_climate]
So here's the deal: we all work on this code, and anyone who uses that does so absolutely at their own risk. Can you dig it?
[circleci]: https://circleci.com/gh/glitch-soc/mastodon
[code_climate]: https://codeclimate.com/github/glitch-soc/mastodon
Specifically, this fork-of-a-fork is intended for Treehouse use only. Unless
otherwise communicated, we will not put effort into supporting other deployments
or upstreaming our patches.
So here's the deal: we all work on this code, and anyone who uses that does so absolutely at their own risk. can you dig it?
## Links
- You can view documentation for this project at [glitch-soc.github.io/docs/](https://glitch-soc.github.io/docs/).
- And contributing guidelines are available [here](CONTRIBUTING.md) and [here](https://glitch-soc.github.io/docs/contributing/).
- You can view upstream Glitch's documentation for this project at [glitch-soc.github.io/docs/](https://glitch-soc.github.io/docs/).
- Contributing guidelines are available [here](CONTRIBUTING.md).
## Known Deployments
- Treehouse Social: [social.treehouse.systems](https://social.treehouse.systems)
- VT Social: [vt.social](https://vt.social)
- Unstable Systems: [unstable.systems](https://unstable.systems)

View File

@ -4,3 +4,12 @@
require File.expand_path('../config/application', __FILE__)
Rails.application.load_tasks
# please don't do this
if Rake::Task.task_defined?('assets:precompile') && ENV.include?('RAKE_NO_YARN_INSTALL_HACK')
task = Rake::Task['assets:precompile']
puts task.prerequisites
task.prerequisites.delete('webpacker:yarn_install')
task.prerequisites.delete('yarn:install')
puts task.prerequisites
end

143
SETUP.md Normal file
View File

@ -0,0 +1,143 @@
# Setting up a dev environment
## Prerequisites
Mastodon development requires the following:
- Ruby 3.0
- Ruby gems:
- `bundler`
- `irb`
- `foreman`
- NodeJS v18 (LTS)
- NPM packages:
- `yarn`
- Postgres
- Redis
### macOS
First, make sure you have Homebrew installed. Follow the instructions at [brew.sh](https://brew.sh).
Run the following to install all necessary packages:
```
brew install ruby@3.0 foreman node yarn postgresql redis
```
Ruby 3.0 is **keg-only** by default. Follow the instructions in the **Caveat** to add it to your path.
### Linux
We will assume that you know how to locate the correct packages for your distro. That said, some distros package `bundler` and `irb` separately. Make sure that you also install these.
On Arch, you will need:
- `ruby`
- `ruby-bundler`
- `ruby-irb`
- `ruby-foreman`
- `redis`
- `postgresql`
- `yarn`
- `gmp`
- `libidn`
### Windows
Unfortunately, none of the authors use Windows. Contributions welcome!
## Database
In the root of this repository, go through the following script:
```sh
# Create a folder for local data
mkdir -p data
# Set up a local database
pg_ctl -D data/postgres initdb -o '-U mastodon --auth-host=trust'
# Use the data/postgres folder for the DB connection unix socket
#
# If you don't know what that means, it's just a way for Mastodon to communicate
# with a database on the same machine efficiently.
#
# See: https://manpages.ubuntu.com/manpages/jammy/man7/unix.7.html
echo 'unix_socket_directories = .' >> data/postgres/postgresql.conf
# Start the database
pg_ctl -D data/postgres start --silent
```
## Redis
In the root of this repository, run the following:
```sh
# Create a folder for redis data
mkdir -p data/redis
# Start Redis
redis-server ./redis-dev.conf
# [Optional] Stop Redis
# kill "$(cat ./data/redis/redis-dev.pid)"
```
## Ruby
```sh
export RAILS_ENV=development
# Bundle installs all Ruby gems globally by default, which might cause problems.
bundle config set --local path 'vendor/bundle'
# [Apple Silicon] If using macOS on Apple Silicon, run the following:
# bundle config build.idn-ruby -- --with-idn-dir="$(brew --prefix libidn)"
# Install dependencies using bundle (Ruby) and yarn (JS)
bundle install
yarn install
# Setup the database using the pre-defined Rake task
#
# Rake is a command runner for Ruby projects. The `bundle exec` ensures that
# we use the version of Rake that this project requires.
bundle exec rake db:setup
# [Optional] If that fails, run the following and try again:
# bundle exec rake db:reset
```
## Running Mastodon
1. Run `export RAILS_ENV=development NODE_ENV=development`.
- Put these in your shell's .rc, or a script you can source if you want to skip this step in the future.
2. Run `bundle exec rake assets:precompile`.
- If this explodes, complaining about `Hash`, you'll need to `export NODE_OPTIONS=--openssl-legacy-provider`.
- After doing this, you will need to run `bundle exec rake assets:clobber` and then re-run `bundle exec rake assets:precompile`.
3. Run `foreman start`
# Updates/Troubleshooting
## RubyVM/DebugInspector Issues
Still unable to fix. Circumvent by removing `better_errors` and `binding_of_caller` from Gemfile.
Happy to troubleshoot with someone better with Ruby than us >_<'/.
## Webpack Issues
If Webpack compalins about being unable to find some assets or locales:
Try:
1. `rm -rf node_modules`
2. `yarn install`
If this doesn't help, try:
1. `yarn add webpack`
2. `git restore package.json yarn.lock`
3. `yarn install`
Then re-run `foreman start`. No. We have no idea why this worked.
# Need Help?
If the above instructions don't work, please contact @Rin here, or @tammy@social.treehouse.systems.

View File

@ -69,7 +69,8 @@ class Api::V1::StatusesController < Api::BaseController
content_type: status_params[:content_type],
allowed_mentions: status_params[:allowed_mentions],
idempotency: request.headers['Idempotency-Key'],
with_rate_limit: true
with_rate_limit: true,
quote_id: status_params[:quote_id].presence
)
render json: @status, serializer: @status.is_a?(ScheduledStatus) ? REST::ScheduledStatusSerializer : REST::StatusSerializer
@ -140,6 +141,7 @@ class Api::V1::StatusesController < Api::BaseController
:visibility,
:language,
:scheduled_at,
:quote_id,
:content_type,
allowed_mentions: [],
media_ids: [],

View File

@ -24,6 +24,7 @@ module ContextHelper
voters_count: { 'toot' => 'http://joinmastodon.org/ns#', 'votersCount' => 'toot:votersCount' },
olm: { 'toot' => 'http://joinmastodon.org/ns#', 'Device' => 'toot:Device', 'Ed25519Signature' => 'toot:Ed25519Signature', 'Ed25519Key' => 'toot:Ed25519Key', 'Curve25519Key' => 'toot:Curve25519Key', 'EncryptedMessage' => 'toot:EncryptedMessage', 'publicKeyBase64' => 'toot:publicKeyBase64', 'deviceId' => 'toot:deviceId', 'claim' => { '@type' => '@id', '@id' => 'toot:claim' }, 'fingerprintKey' => { '@type' => '@id', '@id' => 'toot:fingerprintKey' }, 'identityKey' => { '@type' => '@id', '@id' => 'toot:identityKey' }, 'devices' => { '@type' => '@id', '@id' => 'toot:devices' }, 'messageFranking' => 'toot:messageFranking', 'messageType' => 'toot:messageType', 'cipherText' => 'toot:cipherText' },
suspended: { 'toot' => 'http://joinmastodon.org/ns#', 'suspended' => 'toot:suspended' },
quote_uri: { 'fedibird' => 'http://fedibird.com/ns#', 'quoteUri' => 'fedibird:quoteUri' },
}.freeze
def full_context

View File

@ -15,7 +15,17 @@ module FormattingHelper
module_function :extract_status_plain_text
def status_content_format(status)
html_aware_format(status.text, status.local?, preloaded_accounts: [status.account] + (status.respond_to?(:active_mentions) ? status.active_mentions.map(&:account) : []), content_type: status.content_type)
base = html_aware_format(status.text, status.local?, preloaded_accounts: [status.account] + (status.respond_to?(:active_mentions) ? status.active_mentions.map(&:account) : []), content_type: status.content_type)
if status.quote? && status.local?
after_html = begin
"<span class=\"quote-inline\"><a href=\"#{status.quote.to_log_permalink}\" class=\"status-link unhandled-link\" target=\"_blank\">#{status.quote.to_log_permalink}</a></span>"
end.html_safe # rubocop:disable Rails/OutputSafety
base + after_html
else
base
end
end
def rss_status_content_format(status)

View File

@ -1,6 +0,0 @@
export const APP_LAYOUT_CHANGE = 'APP_LAYOUT_CHANGE';
export const changeLayout = layout => ({
type: APP_LAYOUT_CHANGE,
layout,
});

View File

@ -0,0 +1,7 @@
import { createAction } from '@reduxjs/toolkit';
type ChangeLayoutPayload = {
layout: 'mobile' | 'single-column' | 'multi-column';
};
export const changeLayout =
createAction<ChangeLayoutPayload>('APP_LAYOUT_CHANGE');

View File

@ -82,6 +82,9 @@ export const COMPOSE_CHANGE_MEDIA_FOCUS = 'COMPOSE_CHANGE_MEDIA_FOCUS';
export const COMPOSE_SET_STATUS = 'COMPOSE_SET_STATUS';
export const COMPOSE_QUOTE = 'COMPOSE_QUOTE';
export const COMPOSE_QUOTE_CANCEL = 'COMPOSE_QUOTE_CANCEL';
const messages = defineMessages({
uploadErrorLimit: { id: 'upload_error.limit', defaultMessage: 'File upload limit exceeded.' },
uploadErrorPoll: { id: 'upload_error.poll', defaultMessage: 'File upload not allowed with polls.' },
@ -135,6 +138,25 @@ export function cancelReplyCompose() {
};
}
export function quoteCompose(status, router) {
return (dispatch, getState) => {
dispatch({
type: COMPOSE_QUOTE,
status: status,
});
if (!getState().getIn(['compose', 'mounted'])) {
router.push('/publish');
}
};
};
export function cancelQuoteCompose() {
return {
type: COMPOSE_QUOTE_CANCEL,
};
};
export function resetCompose() {
return {
type: COMPOSE_RESET,
@ -208,6 +230,7 @@ export function submitCompose(routerHistory) {
status,
content_type: getState().getIn(['compose', 'content_type']),
in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null),
quote_id: getState().getIn(['compose', 'quote_id'], null),
media_ids: media.map(item => item.get('id')),
media_attributes,
sensitive: getState().getIn(['compose', 'sensitive']) || (spoilerText.length > 0 && media.size !== 0),

View File

@ -74,6 +74,8 @@ export function normalizeStatus(status, normalOldStatus, settings) {
normalStatus.contentHtml = normalOldStatus.get('contentHtml');
normalStatus.spoilerHtml = normalOldStatus.get('spoilerHtml');
normalStatus.hidden = normalOldStatus.get('hidden');
normalStatus.quote = normalOldStatus.get('quote');
normalStatus.quote_hidden = normalOldStatus.get('quote_hidden');
} else {
const spoilerText = normalStatus.spoiler_text || '';
const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).concat(status.media_attachments.map(att => att.description)).join('\n\n').replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n');
@ -83,6 +85,35 @@ export function normalizeStatus(status, normalOldStatus, settings) {
normalStatus.contentHtml = emojify(normalStatus.content, emojiMap);
normalStatus.spoilerHtml = emojify(escapeTextContentForBrowser(spoilerText), emojiMap);
normalStatus.hidden = (spoilerText.length > 0 || normalStatus.sensitive) && autoHideCW(settings, spoilerText);
if (status.quote && status.quote.id) {
const quote_spoilerText = status.quote.spoiler_text || '';
const quote_searchContent = [quote_spoilerText, status.quote.content].join('\n\n').replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n');
const quote_emojiMap = makeEmojiMap(normalStatus.quote);
const quote_account_emojiMap = makeEmojiMap(status.quote.account);
const displayName = normalStatus.quote.account.display_name.length === 0 ? normalStatus.quote.account.username : normalStatus.quote.account.display_name;
normalStatus.quote.account.display_name_html = emojify(escapeTextContentForBrowser(displayName), quote_account_emojiMap);
normalStatus.quote.search_index = domParser.parseFromString(quote_searchContent, 'text/html').documentElement.textContent;
let docElem = domParser.parseFromString(normalStatus.quote.content, 'text/html').documentElement;
Array.from(docElem.querySelectorAll('span.quote-inline'), span => span.remove());
Array.from(docElem.querySelectorAll('p,br'), line => {
let parentNode = line.parentNode;
if (line.nextSibling) {
parentNode.insertBefore(document.createTextNode(' '), line.nextSibling);
}
});
let _contentHtml = docElem.textContent;
normalStatus.quote.contentHtml = '<p>'+emojify(_contentHtml.substr(0, 150), quote_emojiMap) + (_contentHtml.substr(150) ? '...' : '')+'</p>';
normalStatus.quote.spoilerHtml = emojify(escapeTextContentForBrowser(quote_spoilerText), quote_emojiMap);
normalStatus.quote_hidden = (quote_spoilerText.length > 0 || normalStatus.quote.sensitive) && autoHideCW(settings, quote_spoilerText);
// delete the quote link!!!!
let parentDocElem = domParser.parseFromString(normalStatus.contentHtml, 'text/html').documentElement;
Array.from(parentDocElem.querySelectorAll('span.quote-inline'), span => span.remove());
normalStatus.contentHtml = parentDocElem.children[1].innerHTML;
}
}
return normalStatus;

View File

@ -71,6 +71,7 @@ class Status extends ImmutablePureComponent {
nextInReplyToId: PropTypes.string,
rootId: PropTypes.string,
onReply: PropTypes.func,
onQuote: PropTypes.func,
onFavourite: PropTypes.func,
onReblog: PropTypes.func,
onBookmark: PropTypes.func,
@ -713,7 +714,7 @@ class Status extends ImmutablePureComponent {
if (!status.get('sensitive') && !(status.get('spoiler_text').length > 0) && settings.getIn(['collapsed', 'backgrounds', 'preview_images'])) {
background = attachments.getIn([0, 'preview_url']);
}
} else if (status.get('card') && settings.get('inline_preview_cards') && !this.props.muted) {
} else if (!status.get('quote') && status.get('card') && settings.get('inline_preview_cards') && !this.props.muted) {
media.push(
<Card
onOpenMedia={this.handleOpenMedia}

View File

@ -25,6 +25,7 @@ const messages = defineMessages({
replyAll: { id: 'status.replyAll', defaultMessage: 'Reply to thread' },
reblog: { id: 'status.reblog', defaultMessage: 'Boost' },
reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost with original visibility' },
quote: { id: 'status.quote', defaultMessage: 'Quote' },
cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' },
cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },
favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },
@ -58,6 +59,7 @@ class StatusActionBar extends ImmutablePureComponent {
onReply: PropTypes.func,
onFavourite: PropTypes.func,
onReblog: PropTypes.func,
onQuote: PropTypes.func,
onDelete: PropTypes.func,
onDirect: PropTypes.func,
onMention: PropTypes.func,