Compare commits

...

883 Commits

Author SHA1 Message Date
Dennis Schubert
49f3442f64 Merge branch 'next-minor' into develop 2025-06-22 14:41:04 +02:00
Dennis Schubert
aadd8396cc Update open_graph_reader to 0.9.1 and set new config flag.
closes #8465
2025-06-22 14:40:56 +02:00
Dennis Schubert
251e4329c5 Merge branch 'next-minor' into develop 2025-04-13 18:09:23 +02:00
flaburgan
452f46a548 Add reported user diaspora ID in /report view
closes #8464
2025-04-13 18:09:15 +02:00
Dennis Schubert
c2589f10cc Merge branch 'next-minor' into develop 2025-01-23 22:21:26 +01:00
Dennis Schubert
c24ca7d56c Update open_graph_reader to 0.8.0
closes #8463
2025-01-23 22:21:21 +01:00
Benjamin Neff
e569ec72c7 Merge branch 'next-minor' into develop 2025-01-23 01:36:16 +01:00
flaburgan
d26b917e6f Update diaspora.toml.example
closes #8462
2025-01-23 01:36:10 +01:00
Benjamin Neff
0ea682b1d5 Merge branch 'next-minor' into develop 2025-01-11 00:48:59 +01:00
Benjamin Neff
3fcd5708e9 Revert "Start 1.0.0 cycle (again)" on next-minor
This reverts commit 094cb73b05.
2025-01-11 00:47:25 +01:00
Dennis Schubert
b9c36fadfd Add Changelog entry for #8460...
Nobody saw anything! This commit does not exist!
2025-01-10 23:31:53 +01:00
Dennis Schubert
150331ec9d Merge pull request #8460 from denschub/bump-imagemagick-disk-limit 2025-01-10 23:28:32 +01:00
Dennis Schubert
eede6e0f68 Allow ImageMagick to use 1GiB of disk caches
This matches the "websafe" upstream preset[0], and our current limit is too low for high-noise images (like a scene full of snow).

[0]: c7d070ec65/config/policy-websafe.xml (L58)
2025-01-10 23:07:21 +01:00
Benjamin Neff
37096d9c88 Merge branch 'next-minor' into develop 2024-09-05 01:39:56 +02:00
Daniel Black
53b9e3cbf3 docker-compose.yml - bump mariadb version
Noted its not the primary development environment, but 10.9 is out of support so just keep the the LTS tag.

MARIADB_AUTO_UPGRADE=1 facilitates in place upgrades.

closes #8452
2024-09-05 01:39:30 +02:00
Benjamin Neff
094cb73b05 Start 1.0.0 cycle (again) 2024-06-16 02:37:05 +02:00
Benjamin Neff
83a97420d9 Start 0.9.1.0 cycle 2024-06-16 02:35:30 +02:00
Benjamin Neff
94a72e1108 Merge branch 'release/0.9.0.0' 2024-06-16 02:25:33 +02:00
Benjamin Neff
d81aa12d54 Prepare 0.9.0.0 release and replace 1.0 version numbers 2024-06-16 01:45:50 +02:00
Benjamin Neff
7355df5202 updated 250 locale files [ci skip]
The script changed from old unmaintained ya2yaml (which is broken with
current ruby version) to default `to_yaml` from ruby. That's why the
diff is "a bit" bigger than usual, because it looks like some keys are
sorted differently.
2024-06-16 00:53:29 +02:00
Benjamin Neff
70e293ba94 Add rack-attack to throttle login actions
This also fixes CVE-2024-0227 for 2FA brute force

See: https://blog.inhq.net/posts/totp-CVE-2024-0227/
2024-06-15 18:32:09 +02:00
Benjamin Neff
0d41b7ca13 Merge pull request #8449 from denschub/blindness
Replace eye with foreman.
2024-06-09 03:17:39 +02:00
Dennis Schubert
619722490c Replace eye with foreman. 2024-06-09 02:01:38 +02:00
Benjamin Neff
fddfd8b8c0 Merge pull request #8363 from cmrd-senya/fix-api-tags-stream-to-hide-ignores
API: update Search endpoint to be aware of ignored users
2024-06-05 01:06:26 +02:00
Benjamin Neff
c3eaa212af Merge pull request #8406 from Flaburgan/6184-service-disabled
Do not show the service to the user if it is disabled, fixes #6184

Fixes #6184
2024-06-05 01:04:00 +02:00
Benjamin Neff
7ec2a68256 Merge pull request #8439 from jhass/feature/comment_likes_api
add API routes for comment likes
2024-06-05 01:01:52 +02:00
Benjamin Neff
80beedfe63 Merge pull request #8442 from Flaburgan/mark-like-on-comment-notifications-as-read
Mark Likes on comment notifications as read when visiting a post
2024-06-05 01:01:04 +02:00
Benjamin Neff
cc50077188 Merge pull request #8448 from SuperTux88/gem-updates
Update dependencies and ruby version
2024-06-05 00:55:00 +02:00
Benjamin Neff
07f6a91d02 Upgrade to ruby 3.3 2024-06-05 00:35:48 +02:00
Benjamin Neff
02f8629254 Fix Person spec to prepare ruby upgrade 2024-06-05 00:35:48 +02:00
Benjamin Neff
8b6adee359 Bump perfect-scrollbar 2024-06-05 00:35:48 +02:00
Benjamin Neff
7a8bc40bb8 Bump highlightjs 2024-06-05 00:35:48 +02:00
Benjamin Neff
69637608e8 Bump fine-uploader 2024-06-05 00:35:48 +02:00
Benjamin Neff
14ddc750d0 Bump cropperjs 2024-06-05 00:35:48 +02:00
Benjamin Neff
794545278b Bump corejs-typeahead 2024-06-05 00:35:47 +02:00
Benjamin Neff
195be4fc83 Bump backbone 2024-06-05 00:35:47 +02:00
Benjamin Neff
342b82dfd2 Bump autosize 2024-06-05 00:35:47 +02:00
Benjamin Neff
2f78f97ded Bump other dependencies not directly in Gemfile 2024-06-05 00:35:47 +02:00
Benjamin Neff
7726855d1c Bump cucumber-rails 2024-06-05 00:34:02 +02:00
Benjamin Neff
4d38b8592f Bump rspec-rails 2024-06-05 00:34:02 +02:00
Benjamin Neff
6321215bb4 Bump webmock 2024-06-05 00:34:02 +02:00
Benjamin Neff
e8fc097728 Bump timecop 2024-06-05 00:34:02 +02:00
Benjamin Neff
fbdb9edbf2 Bump shoulda-matchers 2024-06-05 00:34:01 +02:00
Benjamin Neff
781fda001b Bump factory_bot_rails 2024-06-05 00:34:01 +02:00
Benjamin Neff
140168ea2d Bump cuprite 2024-06-05 00:34:01 +02:00
Benjamin Neff
f1523b0260 Bump capybara 2024-06-05 00:34:01 +02:00
Benjamin Neff
2878537ca0 Bump listen 2024-06-05 00:34:01 +02:00
Benjamin Neff
1bf1b7bda1 Bump rubocop and rubocop-rails 2024-06-05 00:34:01 +02:00
Benjamin Neff
7e8bf20299 Bump pronto 2024-06-05 00:34:01 +02:00
Benjamin Neff
2e5224c50d Bump haml_lint 2024-06-05 00:34:01 +02:00
Benjamin Neff
dc83503868 Bump asset_sync 2024-06-05 00:34:01 +02:00
Benjamin Neff
ddc1f65b57 Bump minitest 2024-06-05 00:34:01 +02:00
Benjamin Neff
34c2b87ed7 Bump typhoeus 2024-06-05 00:34:01 +02:00
Benjamin Neff
e7549a07e2 Bump faraday-typhoeus 2024-06-05 00:34:01 +02:00
Benjamin Neff
68575f6c58 Bump faraday 2024-06-05 00:34:01 +02:00
Benjamin Neff
2123e1f311 Bump addressable 2024-06-05 00:34:00 +02:00
Benjamin Neff
e64cd6038c Bump acts-as-taggable-on 2024-06-05 00:34:00 +02:00
Benjamin Neff
a1abcdb1c0 Bump active_model_serializers 2024-06-05 00:34:00 +02:00
Benjamin Neff
027c0420c9 Bump openid_connect 2024-06-05 00:34:00 +02:00
Benjamin Neff
1c621dc999 Bump omniauth and omniauth-rails_csrf_protection 2024-06-05 00:34:00 +02:00
Benjamin Neff
12e21555ee Bump ruby-oembed 2024-06-05 00:34:00 +02:00
Benjamin Neff
84794a1b25 Bump nokogiri 2024-06-05 00:34:00 +02:00
Benjamin Neff
e8a374a16d Bump leaflet-rails 2024-06-05 00:34:00 +02:00
Benjamin Neff
046280c480 Bump rails-i18n 2024-06-05 00:34:00 +02:00
Benjamin Neff
813e44c0a9 Bump jquery-ui-rails 2024-06-05 00:34:00 +02:00
Benjamin Neff
dcd29a6968 Bump jquery-rails and jquery 2024-06-05 00:34:00 +02:00
Benjamin Neff
769c6b1a8c Bump js-routes 2024-06-05 00:34:00 +02:00
Benjamin Neff
a080d2a01a Bump fog-aws 2024-06-05 00:34:00 +02:00
Benjamin Neff
541da9f682 Bump carrierwave
Carrierwave 3.0.4 cleans the original_filename after store, but we can
still get the original filename from the file directly.
2024-06-05 00:33:58 +02:00
Benjamin Neff
016b2f15c5 Bump activerecord-import 2024-06-05 00:25:29 +02:00
Benjamin Neff
cb0c02f9f2 Bump pg 2024-06-05 00:24:54 +02:00
Benjamin Neff
47b7181061 Bump mysql2 2024-06-05 00:24:54 +02:00
Benjamin Neff
2c34f271d9 Bump autoprefixer-rails 2024-06-05 00:24:54 +02:00
Benjamin Neff
0615ac112b Bump rack-cors 2024-06-05 00:24:54 +02:00
Benjamin Neff
7dc1e2d026 Bump toml-rb 2024-06-05 00:24:53 +02:00
Benjamin Neff
abb59cc1b4 Bump configurate 2024-06-05 00:24:53 +02:00
Benjamin Neff
5eec93d2ef Bump terser 2024-06-05 00:24:53 +02:00
Benjamin Neff
d390499e86 Bump sidekiq and sidekiq-cron 2024-06-05 00:24:53 +02:00
Benjamin Neff
630b70bcf0 Bump devise 2024-06-05 00:24:53 +02:00
Benjamin Neff
61592cca67 Bump json-schema 2024-06-05 00:24:53 +02:00
Benjamin Neff
9ed57596c1 Bump json 2024-06-05 00:24:53 +02:00
Benjamin Neff
7910103f60 Bump puma 2024-06-05 00:24:53 +02:00
Benjamin Neff
eb12b5596c Bump responders 2024-06-05 00:24:53 +02:00
Benjamin Neff
5e13a7208d Bump rails 2024-06-05 00:24:50 +02:00
Benjamin Neff
4b49270be7 Simplify comment and post validation
It's enough to check if the comment exists on the specified post, if it
doesn't exist at all, that check will also fail.

Also do that check directly on SQL level and just check if the comment
exist instead of looping through all comments.
2024-06-05 00:14:31 +02:00
Benjamin Neff
649d8c5b56 Mark notifications as read in a single SQL query
There is no need to load all comments only to count them. Lets just let
the database do all the work. If there are no comments found, nothing
will happen anyway.

Also already filter the comments to only search for notifications for
own comments.

And add some tests :)
2024-06-03 00:11:45 +02:00
Benjamin Neff
52424fba6d Add available_services helper to be used for desktop and mobile 2024-06-02 05:08:29 +02:00
Benjamin Neff
a83d34dcda Bump bundler to match ruby 3.1.5 2024-05-30 02:28:34 +02:00
flaburgan
71e6f20740 Mark Likes on comment notifications as read when visiting a post 2024-02-11 18:40:29 +01:00
flaburgan
14cf4ff85d Do not show the service to the user if it is disabled, fixes #6184 2024-02-11 17:12:02 +01:00
Benjamin Neff
ae3b7804f0 Merge pull request #8441 from SuperTux88/fix-fetch-comments
Allow fetching comments
2024-01-24 01:03:08 +01:00
Benjamin Neff
7cc48bec54 Merge pull request #8285 from Flaburgan/revamped-registrations
New registration page
2024-01-24 01:00:11 +01:00
Benjamin Neff
9e61693e20 Allow fetching comments
Now with likes on comments, diaspora also tries to fetch comments if it
receives a like for a comment it doesn't know yet. So this now also
allows to fetch comments with `/fetch/comment/<guid>`.
2024-01-21 23:30:51 +01:00
Jonne Haß
1e1130e211 add API routes for comment likes 2023-11-24 18:12:59 +01:00
flaburgan
89f906b1b1 Fix horizontal scroll and captcha on mobile, host for user id 2023-11-13 22:13:44 +01:00
flaburgan
7782a32921 New registration page, mentionning the import, fixes #8009 2023-11-13 21:06:20 +01:00
Benjamin Neff
389b1870d3 Merge pull request #8437 from SuperTux88/fix-photo-export-spec
Ensure image processing gets disabled again, even after exceptions
2023-11-13 02:32:57 +01:00
Benjamin Neff
42ffd6322f Merge pull request #8203 from tclaus/2999-likes-comment
Re-introduce likes on comments
2023-11-13 02:32:43 +01:00
Benjamin Neff
686f67d2f8 Merge pull request #8035 from Flaburgan/improve-report-form
Add a more detailed modal when reporting a post or a comment
2023-11-13 02:31:20 +01:00
Benjamin Neff
b0c196aea0 Add notifications for likes on comments 2023-11-13 02:27:55 +01:00
Benjamin Neff
3e1407d242 Fix comments not being lazy loaded in streams anymore 2023-11-13 02:27:55 +01:00
Benjamin Neff
df8275f000 Fix participations for likes on comments in the backend
When liking a comment, the post also gets a participation, and if all
likes/comments get removed again, the participation also gets removed
again.

The only thing still not working properly is the frontend, but that is
already broken when unliking a post. So it shows an invalids state in
the frontend when unliking the post/comment.
2023-11-13 02:27:55 +01:00
Benjamin Neff
edfb603965 Fix API v1 schema for likes on comments and add test 2023-11-13 02:27:55 +01:00
flaburgan
5153534f4c Fix pronto in Ruby 2023-11-13 02:27:55 +01:00
flaburgan
1b2f85c384 Improve styling for mobile comments 2023-11-13 02:27:55 +01:00
Benjamin Neff
71d071be60 Only show heart icon when avatars are shown for comment likes 2023-11-13 02:27:55 +01:00
Benjamin Neff
ad6c9dd55f Fix styling and spacing for likes on comments 2023-11-13 02:27:55 +01:00
Thorsten Claus
9c0f8cdf11 Dont send all likes with list of comments
Due to historic reasons with a comment the list of all likes was sent to the frontend.
This is needed just to detect if one of the likes is current users like.
So if sending just the own like, the frontend can do it's job.

When the frontend is refactured in any way, post and comment like handling should be improved.
2023-11-13 02:27:55 +01:00
Thorsten Claus
c2a2fb63b0 In API dont fetch liked from all comments 2023-11-13 02:27:55 +01:00
Thorsten Claus
67f8ba5d57 Refacor files namespaces 2023-11-13 02:27:55 +01:00
Thorsten Claus
9b19be18f2 Adding eventhandler for Mobile views 2023-11-13 02:26:59 +01:00
Thorsten Claus
06a0dc68a9 Enabled likes-on-comments in mobile view 2023-11-13 02:26:59 +01:00
Thorsten Claus
35f1cd61b1 set correct comment like avatar by removing size 2023-11-13 02:26:59 +01:00
flaburgan
8d6548b610 Introduce like-interactions.js
Adapt to latest development

User likes
 Set css class for inline likes on comment

Re-set participation on comment likes

Co-authored-by: Thorsten Claus <ThorstenClaus@web.de>
2023-11-13 02:26:59 +01:00
flaburgan
82ff57a750 Bring back likes on comments 2023-11-13 02:26:59 +01:00
Benjamin Neff
4f798fc5d8 Ensure image processing gets disabled again, even after exceptions
Otherwise this leaves it enabled if the processing failed, which then
makes other specs fail where they expect the image not being processed
(for example still have the initial set dimensions, instead of the one
read from image after processing).
2023-11-13 01:36:54 +01:00
flaburgan
587e106095 Add a more detailed modal when reporting a post or a comment 2023-11-13 00:15:33 +01:00
Dennis Schubert
bb882daeae Merge branch 'pr8436' into develop 2023-10-16 15:22:50 +02:00
Wladimir Palant
c791421280 Allow CORS requests to nodeinfo endpoint 2023-10-16 12:11:42 +02:00
Dennis Schubert
744f5449fb Merge branch 'next-minor' into develop 2023-07-10 01:19:08 +02:00
Dennis Schubert
f042f5d490 Merge branch 'hotfix/0.7.18.2' 2023-07-10 01:13:45 +02:00
Dennis Schubert
42b835f0c0 Enforce an ImageMagick policy.xml for all pods.
This fix was heavily inspired by Mastodon's fix for GHSA-9928-3cp5-93fm.
So, thank you Cure53 for finding this issue, thank you Mozilla for
paying Cure53 to look into it, and thanks for Mastodon for fixing it.
2023-07-10 01:12:36 +02:00
Benjamin Neff
8d38193096 Merge pull request #8434 from SuperTux88/fix-pumactl-restart
Silence warning about unused callbacks to fix pumactl restart
2023-06-30 01:40:39 +02:00
Benjamin Neff
994f003b5f Silence warning about unused callbacks
The callbacks aren't used in cluster mode, and puma prints a warning
about that. This is fine, we don't need the callbacks in single-mode,
but can still keep it, in case somebody switches on cluster mode.

The problem is, the current puma version has a bug, where pumactl
crashes when trying to print these warnings, so lets just silence the
warnings. People running in single mode also don't need to care about
the warnings anyway.
2023-06-29 03:14:32 +02:00
Dennis Schubert
49198904f3 Merge pull request #8433 from SuperTux88/add-faraday-retry-for-pronto
Add 'faraday-retry' to Gemfile to be used by pronto/octokit
2023-06-29 01:44:47 +02:00
Benjamin Neff
28b7a62939 Add 'faraday-retry' to Gemfile to be used by pronto/octokit
This prevents a "To use retry middleware with Faraday v2.0+, install
`faraday-retry` gem" warning whenever pronto runs.
2023-06-28 21:59:02 +02:00
Benjamin Neff
f05d9bac69 Merge pull request #8432 from SuperTux88/downgrade-sidekiq
Downgrade sidekiq to latest 6.x version
2023-06-28 21:28:57 +02:00
Benjamin Neff
14c4010471 Downgrade sidekiq to latest 6.x version
Sidekiq 7 requires redis 6.2+, which isn't available in a lot of distros
yet :( So lets wait with this for a while.

This partially reverts commit a59505574a.
2023-06-28 14:05:55 +02:00
Benjamin Neff
040e1dc9ee Merge pull request #8431 from SuperTux88/gem-updates
Updating all ruby dependencies to current versions
2023-06-28 02:38:50 +02:00
Benjamin Neff
7a8e1fe2d5 Bump other dependencies not directly in Gemfile 2023-06-28 01:19:37 +02:00
Benjamin Neff
c665d01cc5 Bump openid_connect 2023-06-28 01:19:37 +02:00
Benjamin Neff
62fdac807e Bump faraday 2023-06-28 01:19:37 +02:00
Benjamin Neff
1bd0c7bb2d Bump cucumber-rails 2023-06-28 01:19:37 +02:00
Benjamin Neff
c5699b7a43 Bump rspec-rails 2023-06-28 01:19:37 +02:00
Benjamin Neff
bdfaff5009 Bump webmock 2023-06-28 01:19:37 +02:00
Benjamin Neff
50422c5902 Bump timecop 2023-06-28 01:19:37 +02:00
Benjamin Neff
313e96d5c3 Bump shoulda-matchers 2023-06-28 01:19:37 +02:00
Benjamin Neff
00b1ed3e76 Bump database_cleaner-active_record 2023-06-28 01:19:37 +02:00
Benjamin Neff
302bd03923 Bump listen 2023-06-28 01:19:37 +02:00
Benjamin Neff
3c3d73fedb Bump simplecov 2023-06-28 01:19:36 +02:00
Benjamin Neff
f2c0688aed Bump haml_lint 2023-06-28 01:19:36 +02:00
Benjamin Neff
d180cd2eaf Bump rubocop 2023-06-28 01:19:36 +02:00
Benjamin Neff
dbc095c895 Bump pronto-rubocop 2023-06-28 01:19:36 +02:00
Benjamin Neff
4fbd5b226b Bump pronto-eslint 2023-06-28 01:19:36 +02:00
Benjamin Neff
d37193f24c Bump pronto 2023-06-28 01:19:36 +02:00
Benjamin Neff
e3149bdea8 Bump asset_sync 2023-06-28 01:19:36 +02:00
Benjamin Neff
bb8486eec5 Bump minitest 2023-06-28 01:19:36 +02:00
Benjamin Neff
7cefa8577a Bump will_paginate 2023-06-28 01:19:36 +02:00
Benjamin Neff
64887e75c5 Bump hamlit 2023-06-28 01:19:36 +02:00
Benjamin Neff
a33803ac19 Bump addressable 2023-06-28 01:19:36 +02:00
Benjamin Neff
9f5d2a8ac6 Bump active_model_serializers 2023-06-28 01:19:36 +02:00
Benjamin Neff
ab08d97dda Bump twitter 2023-06-28 01:19:36 +02:00
Benjamin Neff
4068de6d75 Bump omniauth 2023-06-28 01:19:36 +02:00
Benjamin Neff
8ccca9609f Bump secure_headers 2023-06-28 01:19:35 +02:00
Benjamin Neff
386717b6c4 Bump redcarpet 2023-06-28 01:19:35 +02:00
Benjamin Neff
a7320a872c Bump nokogiri 2023-06-28 01:19:35 +02:00
Benjamin Neff
f8fe914212 Bump leaflet-rails 2023-06-28 01:19:35 +02:00
Benjamin Neff
184bd7c7fd Bump rails-i18n 2023-06-28 01:19:35 +02:00
Benjamin Neff
abedbf10bd Bump js-routes 2023-06-28 01:19:35 +02:00
Benjamin Neff
8184031c4a Bump mini_magick 2023-06-28 01:19:35 +02:00
Benjamin Neff
3aa44edd49 Bump fog-aws 2023-06-28 01:19:35 +02:00
Benjamin Neff
211f34806b Bump activerecord-import 2023-06-28 01:19:35 +02:00
Benjamin Neff
26b99671c4 Bump pg 2023-06-28 01:19:35 +02:00
Benjamin Neff
ed51a17ea6 Bump mysql2 2023-06-28 01:19:35 +02:00
Benjamin Neff
509b302073 Bump autoprefixer-rails 2023-06-28 01:19:35 +02:00
Benjamin Neff
462d3936a1 Bump rack-cors 2023-06-28 01:19:35 +02:00
Benjamin Neff
7d7305028d Bump toml-rb 2023-06-28 01:19:35 +02:00
Benjamin Neff
c11928111d Bump terser 2023-06-28 01:19:35 +02:00
Benjamin Neff
a59505574a Bump sidekiq, sidekiq-cron and migrate to redis-client
This breaks compatibility with redis <6
2023-06-28 01:19:34 +02:00
Benjamin Neff
cc4d2e0832 Bump rqrcode 2023-06-28 00:54:05 +02:00
Benjamin Neff
19c48d5738 Bump devise-two-factor 2023-06-28 00:54:05 +02:00
Benjamin Neff
906cc19eb0 Bump devise 2023-06-28 00:54:05 +02:00
Benjamin Neff
ab02c86fa8 Bump json-schema 2023-06-28 00:54:05 +02:00
Benjamin Neff
dbe644ede6 Bump json 2023-06-28 00:54:05 +02:00
Benjamin Neff
ebcbdd823c Bump diaspora_federation 2023-06-28 00:54:05 +02:00
Benjamin Neff
a784e32840 Bump puma 2023-06-28 00:54:05 +02:00
Benjamin Neff
c286123cc1 Bump responders 2023-06-28 00:54:05 +02:00
Benjamin Neff
033492f2ab Bump rails 2023-06-28 00:54:03 +02:00
Dennis Schubert
6288fe3dde Merge pull request #8429 from denschub/prontohub
[CI] Run Pronto on GitHub Actions.
2023-06-15 16:17:30 +02:00
Dennis Schubert
78925beec5 [CI] Run Pronto on GitHub Actions. 2023-06-14 21:52:26 +02:00
Dennis Schubert
6430aa3bad Merge pull request #8428 from denschub/hackaround-flaky-cuke
Attempt at un-flaky'ing the `preview a very long message` cucumber scenario
2023-06-13 15:24:54 +02:00
Dennis Schubert
c095959e6a [CI] Make the extremely long status message less long.
The old message, being 2048 chars long, apparently sometimes tripped up
Ferrum or Chrome itself. The new, shorter, message does that less or not
at all. It's still long enough, though, as the way we determine if a
status message is "too long" is by height only, so line-breaks work.
2023-06-13 05:00:29 +02:00
Benjamin Neff
3b07b16962 Merge pull request #8427 from SuperTux88/gem-updates
Bump net-* gems and digest
2023-06-12 05:04:10 +02:00
Benjamin Neff
f420a78a79 Bump net-* gems and digest
I don't know why it pinned them to older versions when adding them, lets
use the latest versions instead.
2023-06-12 04:35:45 +02:00
Benjamin Neff
b34a184b0a Merge pull request #8426 from SuperTux88/add-ruby-3.1
Add ruby 3.1, drop ruby 2.7
2023-06-12 04:07:09 +02:00
Benjamin Neff
297fd722ab Bump jwt and json-jwt to support openssl 3.0 2023-06-12 03:39:18 +02:00
Benjamin Neff
9dfce77a4d Remove workaround required to load YAML with ruby 2.7 and 3.1
This works now with ruby >= 3.0
2023-06-12 02:51:41 +02:00
Benjamin Neff
faf9390e70 Add ruby 3.1, drop ruby 2.7 2023-06-12 02:51:16 +02:00
Benjamin Neff
72e1daa5e3 Bump capybara for ruby 3.1
The matrix gem was removed from ruby 3.1, but was required for capybara,
but the current version added it as a dependency.
2023-06-12 02:25:26 +02:00
Benjamin Neff
7934f3e916 Add mail protocol gems
This is required for ruby 3.1 with rails 6.1, as they were removed from
being bundled with ruby 3.1. It can be removed with rails 7 again, as
they were added as a dependency to rails 7.
2023-06-12 02:25:07 +02:00
Benjamin Neff
9cdfd3a55b Merge pull request #8425 from jhass/8424_fix_yaml_load
Use YAML.unsafe_load_file when available in bundler helper
2023-06-12 01:57:45 +02:00
Jonne Haß
324851eeb5 Use YAML.unsafe_load_file when available in bundler helper
fixes #8424
2023-06-11 12:53:27 +02:00
Dennis Schubert
7ce4309fcb Merge pull request #8423 from SuperTux88:update-carrierwave-ruby-3
Update carrierwave and add ruby 3.0 support
2023-06-11 03:31:16 +02:00
Benjamin Neff
ae813f0cf2 Enable ruby 3.0 on CI and switch default to 3.0 2023-06-10 20:30:26 +02:00
Benjamin Neff
d790e3dcba Bump scss_lint and rake
Old rake version didn't work with ruby 3.0 in docker
2023-06-10 19:56:22 +02:00
Benjamin Neff
3c10dbc547 Bump carrierwave 2023-06-10 19:09:53 +02:00
Benjamin Neff
0a545c7092 Merge pull request #8422 from SuperTux88/fix-checkout-deprecation-warning
Upgrade to actions/checkout@v3 to get rid of deprecation warning
2023-06-10 17:27:11 +02:00
Benjamin Neff
02182e3b59 Merge pull request #8421 from SuperTux88/cleanup-from-header-unicode-emojis
Cleanup unicode emojis from email headers
2023-06-10 17:26:48 +02:00
Benjamin Neff
cf49899069 updated 6 locale files [ci skip] 2023-06-10 17:22:19 +02:00
Benjamin Neff
d5a338ad0e Merge pull request #8420 from SuperTux88/remove-i18n-inflector-rails
Remove i18n-inflector-rails dependency
2023-06-10 17:13:15 +02:00
Benjamin Neff
5ce5cfdecf Upgrade to actions/checkout@v3 to get rid of deprecation warning 2023-06-10 05:35:31 +02:00
Benjamin Neff
5508401ed8 Don't modify default translations when merging with other language
`deep_merge!` modifies the hash of the default translation, and it looks
like `I18n.t` always returns the same instance, so after that, the
default stays translated. So lets duplicate the hash first, before
modifying it, this also helps because we also add more keys below, which
probably also shouldn't be added to the original.
2023-06-10 05:00:27 +02:00
Benjamin Neff
dc9a18e24d Cleanup unicode emojis from email headers
Some email providers (for example gmail) block emails if they have
emojis in the from header, as they could be confused with UI elements.
So the easy solution is to just filter all emojis from the name.

The normal `\p{Emoji}` selector also matches normal numbers, because of
the emoji-version of numbers (1️⃣), but the `\p{Emoji_Presentation}` then
doesn't match colored emojis anymore (❄️), so we need a mix of both to
find all emojis
2023-06-09 04:20:15 +02:00
Benjamin Neff
6f802417c6 Remove i18n-inflector-rails dependency
There are no new releases anymore and the current version isn't
compatible with ruby 3.x.

As this feature wasn't really used a lot (Icelandic didn't even setup
inflections properly), it's probably not worth fighting for it, so lets
just drop it.

Related to #8369
2023-06-09 01:13:16 +02:00
Benjamin Neff
87f17fe907 Merge pull request #8418 from SuperTux88/switch-to-cuprite
Switch from apparition to cuprite driver
2023-06-08 22:58:29 +02:00
Benjamin Neff
8ebfd4892f Merge pull request #8419 from SuperTux88/podman-build
Use podman to build when installed and configured
2023-06-08 22:52:37 +02:00
Benjamin Neff
e7e3d3c326 Use podman to build when installed and configured
I had problems when trying to build with podman with docker-compose 2.x,
but it works when just calling the `podman build` command directly
instead.
2023-06-07 02:46:28 +02:00
Benjamin Neff
bb7e5a369d Correctly escape username pattern regex
Without the escaping, the backslash doesn't get renderet in the frontend
which leads to some browsers (chrome >= 114?) just allowing every input.
2023-06-05 23:35:31 +02:00
Benjamin Neff
5425f5cfa6 Switch from apparition to cuprite driver
Apparition4 isn't really maintained anymore and there are no new releases
and it always logs a lot of errors, making the output hard to read.

So lets switch to cuprite, as it also supports everything we need and is
still maintained.

Supersedes #8330
2023-06-05 23:34:52 +02:00
Benjamin Neff
ce32a7d16b Merge pull request #8409 from tclaus/add_app_smart_banner
Add app smart banner to web site when using an iOS device
2023-06-04 21:38:34 +02:00
Benjamin Neff
e29f9e2fa2 Merge pull request #8410 from SuperTux88/allow-DOCKER_HOST-env-var
Allow DOCKER_HOST env var for diaspora-dev docker setup
2023-06-04 21:35:07 +02:00
Benjamin Neff
6510bafa88 Merge pull request #8417 from SuperTux88/remove-strip_exif-flag
Always strip exif data and drop user setting for it
2023-06-04 21:30:01 +02:00
Benjamin Neff
11107ee637 Fix chrome parameters for running jasmine
Yes, I know this is a very ugly workaround, but it works ...

Chrome now requires to add `about:blank` as parameter to open and be
able to use remote debugging. The jasmine-gem isn't supported anymore,
and we need to switch to the `jasmine-browser-runner`, I was working on
that a few months ago, but ran into problems.

As the jasmine-gem doesn't allow to add parameters without `--` infront
of it, lets just add a dummy parameter and add the required
`about:blank` with a space after that. This is ugly, but works for now,
until we can upgrade to the new jasmine version. We could also just
replace the `nil` of the last parameter with that value, but I think
that way it's clearer that this is a workaround and how it works.
2023-06-04 17:10:51 +02:00
Benjamin Neff
763dffa328 Always strip exif data and drop user setting for it
Some imagemagick-versions (I tested Ubuntu 22.04 and debian bullseye)
always loose exif data when converting from jpg to webp. So this made
our CI fail now, but even if it wasn't failing before, some pods always
had and have versions which might loose the information anyway. So
having a setting to keep exif information is kinda pointless, if we
can't guarantee that the information isn't lost. Also, diaspora isn't a
photo sharing platform and we don't display exif information anywhere,
so I think we should just always strip exif data (which was already the
default before), as we don't need them.
2023-06-04 04:25:01 +02:00
Benjamin Neff
f3a6cd9a7f Use specific registry in Dockerfile
Otherwise podman asks which one to use every time
2022-12-05 01:02:46 +01:00
Benjamin Neff
0c163b8c49 Allow to use different DOCKER_HOST env var
This allows to use rootless podman (which doesn't require sudo) instead
of docker.
2022-12-05 00:53:33 +01:00
Thorsten Claus
83a2274f47 Adding Smart App Banner for insporation on iOS devices 2022-11-17 23:20:35 +01:00
Benjamin Neff
2fe5a7bd40 updated 30 locale files [ci skip] 2022-11-04 02:09:11 +01:00
Benjamin Neff
b0b2083fea Merge pull request #8407 from Flaburgan/4821-help-mobile
Tell users that there is no help in mobile version, allow to switch to desktop
2022-11-04 02:07:36 +01:00
flaburgan
3d84ae18a7 Tell users that there is no help in mobile version, allow to switch to desktop, fixes #4821 2022-11-02 23:27:58 +01:00
Benjamin Neff
5f6b01e086 Merge pull request #8404 from Flaburgan/8118-scrolling-photos
Do not recreate blueimp each time you're scrolling in the photos page
2022-11-01 21:20:12 +01:00
Benjamin Neff
80c0888176 Merge pull request #8403 from SuperTux88/cleanup-duplicate-pods-for-real-this-time
Cleanup duplicate pods
2022-11-01 21:17:17 +01:00
Benjamin Neff
acc76a383f Merge pull request #8398 from SuperTux88/fix-mentions-with-underscores
Escape mentions before parsing message with markdown for mobile UI
2022-11-01 21:15:47 +01:00
Dennis Schubert
6af305b2be Merge pull request #8405 from Flaburgan/7949-feedback-mobile
Add info links (the ones in the footer in the desktop version) into the drawer for mobile
2022-10-31 23:29:42 +01:00
flaburgan
fbc096c7a7 Add info links (the ones in the footer in the desktop version) into the drawer for mobile, fixes #7949 2022-10-31 12:11:46 +01:00
flaburgan
35c254c88c Do not recreate blueimp each time you're scrolling in the photos page, fixes #8118 2022-10-31 11:21:08 +01:00
Benjamin Neff
800f394870 Show ports on pods list
otherwise pods with different ports (or without port) all look the same,
like if they are duplicates
2022-10-31 01:45:13 +01:00
Benjamin Neff
8334eeeeff Ensure pod urls are always lowercase
otherwise pods can exist multiple times with mixed case
2022-10-31 01:45:13 +01:00
Benjamin Neff
6bdf6f03b4 Cleanup duplicate pods in database
The unique index doesn't work when the port is `NULL`. So use `-1`
instead for when using the default ports (80/443), as if we would use
the real ports, we could still have both 80 and 443 in the database at
the same time.
2022-10-31 01:45:13 +01:00
Benjamin Neff
bfe1b84a2e Merge pull request #8399 from SuperTux88/docker-pull
Add pull command to diaspora-dev script
2022-10-30 01:46:57 +02:00
Benjamin Neff
f6105e54a9 Merge pull request #8400 from SuperTux88/8352-mobile-photo-url-redirect
Add redirect to mobile-only photo URL when in desktop UI
2022-10-30 01:45:27 +02:00
Benjamin Neff
abcbfcef15 Merge pull request #8397 from SuperTux88/remove-sprockets-es6
Replace sprockets-es6 with babel-transpiler
2022-10-30 01:43:12 +02:00
Benjamin Neff
7e15d9ec8a Merge pull request #8402 from denschub/cucumber-docker-fixes
Fix running Cucumber in Docker
2022-10-30 01:41:31 +02:00
Benjamin Neff
8b74138e5a Update postgres and mariadb container to latest major version
This is a breaking change, so dev-databases need to be recreated.
2022-10-30 01:17:11 +02:00
Benjamin Neff
cbbb0a55c2 Add redirect to mobile-only photo URL when in desktop UI
This URL is only used in the mobile UI, but when somebody then copies
the link and sends it to somebody on the desktop UI, they don't see
anything. So lets just redirect to the post containing the photo, so
there is at least something to show.

If there is no linked post, just redirect to the image instead.

Fixes #8352
2022-10-30 00:32:31 +02:00
Dennis Schubert
bd2a45615f Disable Chromium sandbox for Apparition 2022-10-29 06:30:34 +02:00
Benjamin Neff
ee593933a1 Add a pull command to update docker images to diaspora-dev script
Before the images were only pulled once and then never updated which
lead to really outdated images and OS dependencies. Now all images
(including the base image for the diaspora container) are pulled when
running `setup`. So the idea is to run the `setup` command from time to
time to bring everything up to date again.
2022-10-06 02:08:02 +02:00
Benjamin Neff
536c96f217 Escape mentions before parsing message with markdown
Usernames that contained underscores were parsed by markdown first. This
broke the diaspora IDs and also added weird html at places where it
wasn't needed. Escaping them before sending the message through the
markdown parser fixes this issue.

As underscores are the only allowed character that can be used for
markdown that is also allowed inside a diaspora ID, this escaping can be
kept pretty simple.

This only fixes it for the mobile UI at the moment, for the desktop UI
it's probably better to fix it in markdown-it.

Related to #7975
2022-10-06 00:45:50 +02:00
Benjamin Neff
185f8a1404 Replace sprockets-es6 with babel-transpiler
Sprockets 4 now has direct babel support, so we can remove the temporary
sprockets-es6 dependency and use babel-transpiler directly.
2022-10-01 02:55:50 +02:00
Benjamin Neff
03796e8fe2 Merge pull request #8395 from denschub/time-travel
Fixes for two date-related spec breakages
2022-09-21 02:47:06 +02:00
Benjamin Neff
57cdc288e2 Merge pull request #8396 from SuperTux88/fix-docker-dev
Fix docker development setup after switch to puma
2022-09-21 02:46:08 +02:00
Benjamin Neff
19b32cf6e3 Merge pull request #8217 from tclaus/7080_multi_select_on_aspects_on_mobile
multi select on aspects on mobile

closes #7080
2022-09-21 02:42:25 +02:00
Dennis Schubert
c47258a873 Don't time travel in check_birthday_spec 2022-09-20 03:20:48 +02:00
Dennis Schubert
6dd8af70f7 Force the dev-docker to always run as amd64
We download a static amd64 browser, so this would explode on arm64, for example.
2022-09-20 00:27:45 +02:00
Benjamin Neff
1358f6fbb8 Expose docker-compose through diaspora-dev script
As the docker-compose.yml contains variables, it can't just be used with
docker-compose directly. So this manually use docker-compose commands
with all the required environment variables set.
2022-09-19 04:01:16 +02:00
Benjamin Neff
a4d45358a2 Set listen not only on localhost when used in docker
When puma was introduced in #8392 the default listen configuration was
set to only localhost, which makes sense for most development setups,
but when run within docker, it needs to listen on all IPs so the port
can be forwarded to be accessable outside of docker.

Because the new default makes sense without docker, I overwrite the
option with a environment variable only in the docker-setup. This also
ensures that it always contains the right value needed for the
docker-setup to work, no matter what was configured outside of docker.
2022-09-19 04:01:16 +02:00
Benjamin Neff
84df8eed33 Add redis to docker development setup
With #8392 the `single_process_mode` was removed, which means that
development now also requires a redis.
2022-09-19 04:01:16 +02:00
Thorsten Claus
65456c7f5e Using mixins for aspects css style 2022-09-12 08:25:37 +02:00
Dennis Schubert
6ddd16267a Give queue_users_for_removal_spec a bit of allowance to accord for timezone changes 2022-09-10 23:22:34 +02:00
Benjamin Neff
7c450b4446 Merge pull request #8390 from cmrd-senya/improve-public-fetch
Improve public posts fetch on account search
2022-09-10 01:34:54 +02:00
Benjamin Neff
af0b1c55e3 Merge pull request #8389 from SuperTux88/update-changelog
Update next major to 1.0.0
2022-09-10 01:29:10 +02:00
Benjamin Neff
ae4cbb18f7 Merge pull request #8392 from denschub/unicorn-dust
Replace Unicorn with Puma
2022-09-10 01:20:34 +02:00
Benjamin Neff
1c72dcc412 Merge branch 'next-minor' into develop 2022-09-10 01:16:09 +02:00
Benjamin Neff
52f206fa8a Merge branch 'hotfix/0.7.18.1' 2022-09-10 01:13:25 +02:00
Dennis Schubert
9075dfa470 Update binstubs
Newly generated binstubs will check for the string
`This file was generated by Bundler` inside `bin/bundle`, so we'd have
to update that anyway.

Also, there is a non-zero chance the updated `bundle` binstub resolves
some of the setup-specific issues we've seen.
2022-09-10 00:43:20 +02:00
Dennis Schubert
97cfc80a1f Replace Unicorn with Puma
… and drop the single_process_mode. See the included Changelog entry
for full details on what this change means.
2022-09-09 04:33:37 +02:00
Dennis Schubert
bb80ca3394 Remove artifacts from the old Federation integration testing attempt
It's… safe to assume that nobody is using this, as this has been broken
for quite some time.
2022-09-07 03:17:03 +02:00
Dennis Schubert
bfd42a1914 Update binstubs
Newly generated binstubs will check for the string
`This file was generated by Bundler` inside `bin/bundle`, so we'd have
to update that anyway.

Also, there is a non-zero chance the updated `bundle` binstub resolves
some of the setup-specific issues we've seen.
2022-09-07 03:15:39 +02:00
cmrd Senya
e77d785d9c post fetch: update spec to test reshares data too 2022-09-06 10:22:08 +03:00
cmrd Senya
61d7eb100a post fetch: use warn not debug for exception logging 2022-09-05 23:22:26 +03:00
cmrd Senya
a6e7c8e2d5 post fetch: update post fetch spec 2022-09-05 23:19:11 +03:00
cmrd Senya
f3c01d5a46 post fetch: remove check for type to allow fetching reshares 2022-09-04 23:28:43 +03:00
cmrd Senya
93d61c7f21 Use federation code for fetching public posts on search 2022-09-04 23:15:30 +03:00
Benjamin Neff
66a0994c91 Change development version number to 1.0.0-dev
Lets use the `-dev` suffix for future development versions.
2022-09-04 19:11:25 +02:00
Benjamin Neff
8a249c06c7 Change deprecation warning for diaspora.yml to version 2.0
as this will be the next major after 1.0
2022-09-03 02:56:46 +02:00
Benjamin Neff
6afaa264ee Change next major release to 1.0.0 in the changelog 2022-09-03 02:52:45 +02:00
Thorsten Claus
8e01a66cb5 Finishing Touches 2022-09-01 22:49:48 +02:00
Benjamin Neff
1c064e016f Merge pull request #8387 from denschub/linked-inline-code-color
Make inline code inside links show the link color.
2022-08-31 22:40:49 +02:00
Benjamin Neff
d18243b5cf Merge pull request #8385 from SuperTux88/remove-therubyracer
Remove note about therubyracer from Gemfile
2022-08-31 22:38:25 +02:00
Sébastien Adam
71c856e330 #7080: SCSS adaptation for displaying the selection of the aspect selection button 2022-08-30 22:55:52 +02:00
Sébastien Adam
fa39f7d348 #7080 Adaptation of the JS for the behavior of the aspect selection button. 2022-08-30 22:51:18 +02:00
Sébastien Adam
29fa1e582a #7080 using aspect selecting button form html into mobile version 2022-08-30 22:51:18 +02:00
Dennis Schubert
0ede0233df Make inline code inside links show the link color.
Fixes #8386
2022-08-26 20:24:32 +02:00
Benjamin Neff
6687f85164 Remove note about therubyracer from Gemfile
podmins should just install nodejs instead
2022-08-24 02:52:16 +02:00
Benjamin Neff
58483bdd2c Merge branch 'next-minor' into develop 2022-07-31 23:14:32 +02:00
Benjamin Neff
77af1b9942 Merge pull request #8383 from tclaus/show_available_pods
Prepare the backend for generating a list of active pods
2022-07-31 04:12:02 +02:00
Thorsten Claus
416c806012 Adding total and active count to pod view
The backend adds the total count for all pods, as well as the count for active pods.

In the frontend shows the new counts but without any further user interactions
2022-07-31 00:19:41 +02:00
Benjamin Neff
496ec4b059 Merge branch 'next-minor' into develop 2022-07-24 21:09:52 +02:00
Benjamin Neff
a661b0b608 Merge branch 'next-minor' into develop 2022-07-24 17:22:41 +02:00
Benjamin Neff
429a47d64d Merge pull request #8381 from SuperTux88/fix-forgery-protection-for-federation
Bump diaspora_federation and enable forgery protection by default again
2022-07-24 01:30:43 +02:00
Benjamin Neff
9b6a2268e9 Bump diaspora_federation and enable forgery protection by default 2022-07-24 00:29:56 +02:00
Benjamin Neff
a88a25a5eb Merge branch 'next-minor' into develop 2022-07-23 18:41:31 +02:00
Benjamin Neff
78ea344454 Merge branch 'next-minor' into develop 2022-07-23 17:01:02 +02:00
Benjamin Neff
1be79fb40e Merge pull request #8376 from SuperTux88/improve-setup-and-docker-scripts
Improve setup and docker scripts
2022-07-23 00:56:30 +02:00
Benjamin Neff
2af2bd80f7 Merge pull request #8378 from SuperTux88/add-dummy-host-meta
Add dummy host meta
2022-07-23 00:54:44 +02:00
Benjamin Neff
37a00173f5 Merge branch 'next-minor' into develop 2022-07-23 00:54:06 +02:00
Benjamin Neff
419ed4d9fc Remove old stubs for /.well-known/host-meta
Since the diaspora_federation gem doesn't try to access host-meta
anymore, there is no need to create stubs for it anymore.
2022-07-23 00:21:06 +02:00
Benjamin Neff
ed8e340fa2 Add a dummy route for /.well-known/host-meta
This was removed from the diaspora_federation gem, since it's not used
for the federation/discovery anymore since a long time. But old versions
of the ConnectionTester up to version 0.7.17 still check if this route
exist or else they mark the pod as offline. So lets add a dummy
host-meta with an empty response back, so the ConnectionTester is happy
again until we can remove this workaround again.
2022-07-23 00:17:06 +02:00
Benjamin Neff
662635fe35 Upgrade development Dockerfile to debian bullseye
to have a current version of yarn
2022-07-21 23:24:55 +02:00
Benjamin Neff
fdcea3e824 Add yarn command to the diaspora-dev docker script 2022-07-21 23:24:55 +02:00
Benjamin Neff
95a9c329af Add command for bin/setup to the diaspora-dev docker script
and also use it for the initial setup command, so it also install yarn
dependencies
2022-07-21 23:24:55 +02:00
Benjamin Neff
08e6f1e2a3 Configure bundler and copy example configs on bin/setup
and also remove `bin/rails restart`, this does nothing for us at the
moment anyway, so just remove it.
2022-07-21 23:13:44 +02:00
Benjamin Neff
9b24407b68 Merge branch 'next-minor' into develop 2022-07-21 05:31:11 +02:00
Benjamin Neff
975afe03bb Merge branch 'next-minor' into develop 2022-07-21 04:00:30 +02:00
Benjamin Neff
d6436f4d03 Merge pull request #8368 from SuperTux88/upgrade-diaspora-federation
Upgrade diaspora federation (and some preparations for ruby 3)
2022-07-21 02:22:43 +02:00
Benjamin Neff
022f367692 Fix some keyword args for ruby 3 compatibility 2022-07-21 01:25:53 +02:00
Benjamin Neff
93c69c4d42 Bump factory_bot for ruby 3 support 2022-07-20 23:13:06 +02:00
Benjamin Neff
111b3cdc8e Upgrade diaspora_federation to 1.0 2022-07-20 23:06:18 +02:00
Benjamin Neff
c2acf6168a Merge branch 'next-minor' into develop 2022-07-20 22:59:36 +02:00
Benjamin Neff
8299aabc25 Drop ruby 2.6 to allow new diaspora_federation version 2022-07-20 22:42:01 +02:00
Benjamin Neff
03d2001cf2 Update yarn files for rails 6
Also allow `yarnpkg` binary for `bin/yarn`
2022-07-20 21:35:22 +02:00
Benjamin Neff
e7e34a8c24 Bump yajl-ruby 2022-07-20 21:35:13 +02:00
Benjamin Neff
4edaebb94f Remove "Did you mean?" from api errors when a parameter is missing
This isn't helpful at all for an api if you don't send a required
parameter and get an error response that just tells you what parameters
that were available.

This is a new feature with rails >= 6.1 and ruby >= 2.7, so this just
keeps the old behaviour of older rails/ruby versions.
2022-07-20 21:35:02 +02:00
Benjamin Neff
d4079070ed Merge branch 'next-minor' into develop 2022-07-20 21:34:39 +02:00
Benjamin Neff
1b826eff9b Merge branch 'next-minor' into develop 2022-07-18 00:56:41 +02:00
Benjamin Neff
0cd1080b76 Merge pull request #8364 from cmrd-senya/use-yarn-for-assets
Use yarn for assets
2022-07-18 00:50:23 +02:00
cmrd Senya
ad266e5fda Add url fix for blueimp-gallery error.svg in css 2022-07-18 00:09:15 +03:00
cmrd Senya
7b3ff37079 Replace textchange with native input event 2022-07-17 22:49:29 +03:00
cmrd Senya
ac39716ab4 Drop jquery.textchange 2022-07-17 22:16:05 +03:00
cmrd Senya
1206b3c37d Update package.json fields 2022-07-17 13:27:08 +03:00
cmrd Senya
f702d3c872 Add yarnpkg to developer dockerfile 2022-07-17 13:18:15 +03:00
cmrd Senya
3c3b988603 Merge branch 'develop' into use-yarn-for-assets 2022-07-17 13:07:09 +03:00
Benjamin Neff
d0af34c079 Merge pull request #8358 from tclaus/supporting_heic_images
Using webp as storage format for images
2022-07-16 04:48:03 +02:00
Benjamin Neff
5669ba6b48 Merge branch 'next-minor' into develop 2022-07-16 04:44:59 +02:00
Thorsten Claus
f995e6af0d Dont Convert when initialized by import 2022-07-16 04:12:01 +02:00
cmrd Senya
551841e0ad blueimp: fix image asset URL 2022-07-12 23:42:01 +03:00
cmrd Senya
e6e6299588 Add yarn install before generating error pages 2022-07-12 22:46:08 +03:00
cmrd Senya
db917caaf5 Add yarnpkg on CI 2022-07-12 22:35:17 +03:00
cmrd Senya
406bb4af68 Add bin/yarn 2022-07-12 22:02:28 +03:00
cmrd Senya
b8b448ae40 Use yarn for front-end dependencies instead of rails-assets 2022-07-12 22:02:05 +03:00
cmrd Senya
834f158d01 API: update Search endpoint to be aware of ignored users 2022-07-06 12:10:45 +03:00
Benjamin Neff
c6dda6cf2d Merge branch 'next-minor' into develop 2022-07-03 23:14:51 +02:00
Benjamin Neff
1e3386c77a Merge branch 'next-minor' into develop 2022-07-03 20:44:24 +02:00
Thorsten Claus
492ac74819 Issue #8355: Adding webp as supported file format
Converting all uploaded images to the webp format.
2022-07-01 13:50:01 +02:00
Benjamin Neff
1b2270572b Merge branch 'next-minor' into develop 2022-06-29 13:28:02 +02:00
Benjamin Neff
add707252a Merge branch 'next-minor' into develop
... and also remove json-schema-rspec dependency from api specs
2022-06-28 02:08:42 +02:00
Benjamin Neff
792d034059 Merge pull request #8345 from tclaus/feature/set_name_in_auth_dialog
Set Name from client in auth dialog
2022-06-20 23:54:02 +02:00
Thorsten Claus
18f63250e1 Adding default value to predefined username 2022-06-20 21:59:43 +02:00
Thorsten Claus
84b33f8c63 Using login_hint instead of username 2022-06-20 08:04:03 +02:00
Sage Ross
2ce99d5b5a Remove unread var in mobile_file_uploader.js
This doesn't appear to be actually used, but if `gon` on not defined — which may happen in jasmine tests when run in random order — then it causes test failures.

Closes #8333
2022-06-19 19:31:09 +02:00
Benjamin Neff
6c9e7f283f Merge branch 'next-minor' into develop 2022-06-19 19:30:56 +02:00
Dennis Schubert
865c36bc8a Merge branch 'next-minor' into develop 2022-04-27 21:17:23 +02:00
Dennis Schubert
22ac0872bd Merge branch 'next-minor' into develop 2022-04-27 20:37:49 +02:00
Dennis Schubert
0cab9f595b Merge branch 'next-minor' into develop 2022-04-26 21:04:25 +02:00
Thorsten Claus
96c5146ebd Set Name from client in auth dialog 2022-03-29 08:25:32 +02:00
Benjamin Neff
5d81555ae1 Merge branch 'next-minor' into develop 2022-03-05 16:31:34 +01:00
Benjamin Neff
2b1f27a850 Merge pull request #8341 from SuperTux88/remove-auth-token
Remove /user/auth_token route, this was a leftover from the chat
2022-02-27 23:31:25 +01:00
Benjamin Neff
36778dbeac Remove /user/auth_token route, this was a leftover from the chat
Also remove authentication_token from database
2022-02-27 23:06:24 +01:00
Benjamin Neff
7e889f71eb Merge branch 'next-minor' into develop 2022-02-12 00:12:01 +01:00
Benjamin Neff
37a7c0b35d Merge pull request #8298 from tclaus/migration_backend
Migration: Backend, Rake file, Photos import
2021-11-25 01:39:57 +01:00
Benjamin Neff
d3c2407df1 Don't overwrite photos of other users during import
If a photo with the same filename already exists, generate a new random
filename, and re-federate the photo with that filename. This ensures
users can't modify their archive to overwrite other users photos.
2021-11-24 02:42:31 +01:00
Benjamin Neff
e9f7bf382e Send new remote_photo_path in migration message 2021-11-24 01:18:07 +01:00
Benjamin Neff
34528521f2 Allow to choose to overwrite settings and profile data 2021-11-23 01:48:33 +01:00
Benjamin Neff
96493b4a5c Refactory archive concurrency so the same logic can be reused 2021-11-23 01:48:33 +01:00
Benjamin Neff
1eb2c59cce Move extension logic to SecureUploader class 2021-11-23 01:48:32 +01:00
Thorsten Claus
6c4c6f8889 Migration Backend Part 2021-11-23 01:48:32 +01:00
Benjamin Neff
ced6905cbc Merge pull request #8320 from tclaus/8319-fix_show_local_posts_link_in_ui
Show local posts in sidebar, if enabled
2021-11-23 01:42:01 +01:00
Benjamin Neff
b1a2cf616e Merge pull request #8302 from SuperTux88/fix-local-sharing-with-me
Fix sharing status of local contacts after an import
2021-11-23 01:40:37 +01:00
Benjamin Neff
4902a35972 Merge branch 'next-minor' into develop 2021-11-23 00:56:41 +01:00
Thorsten Claus
d531b64d66 fixes #8319 2021-11-08 18:47:01 +01:00
Benjamin Neff
d1e0b163e2 Merge branch 'next-minor' into develop 2021-10-30 03:14:55 +02:00
Benjamin Neff
36e6b31135 Merge pull request #8237 from tclaus/7878-direct-image-pasting
7878 direct image pasting

fixes #7878
closes #7883
2021-10-25 03:51:58 +02:00
Benjamin Neff
95c0bb9ef2 Merge branch 'next-minor' into develop 2021-10-25 03:46:48 +02:00
Benjamin Neff
5e47c284b6 Merge branch 'next-minor' into develop 2021-10-01 02:12:37 +02:00
Benjamin Neff
0e6caf61ff Fix sharing status with local users when importing archive
* Local contacts also start sharing again with imported user if they
  were sharing with the old account
* Don't create empty contact entities for contacts which the imported
  user doesn't share with and also maybe the contact doesn't share with
  the importer
* Ensure people which were a contact in the archive still receive the
  migration, even when the importer doesn't share with them, so they can
  resend their contact message

fixes #8106 for real this time
2021-09-29 05:05:28 +02:00
Benjamin Neff
d9116efb85 Revert #8254
This reverts commit 123b8b906c.
This reverts commit 60f9dbcdbd.
2021-09-29 01:58:57 +02:00
Benjamin Neff
274edf7589 Merge branch 'next-minor' into develop 2021-09-19 14:30:07 +02:00
Benjamin Neff
991148bd30 Merge branch 'next-minor' into develop 2021-09-19 03:47:12 +02:00
Benjamin Neff
c05079d1d3 Merge branch 'next-minor' into develop 2021-09-19 03:41:51 +02:00
Benjamin Neff
e902261c45 Merge branch 'next-minor' into develop 2021-09-19 03:14:07 +02:00
Benjamin Neff
c740660c0c Merge pull request #8260 from tclaus/import_zipped_archive
Migration: Import compressed archive file handling
2021-09-19 02:28:43 +02:00
Benjamin Neff
0e7c91aeac Merge branch 'next-minor' into develop 2021-09-19 02:22:05 +02:00
Thorsten Claus
85a5744867 Import compressed archive file 2021-09-19 02:14:50 +02:00
Benjamin Neff
2081f39a72 Merge pull request #8010 from cmrd-senya/fix-archive-edge-cases
Fix archive edge cases

closes #8017
closes #8257
2021-09-18 19:29:56 +02:00
Benjamin Neff
750186319e Merge branch 'next-minor' into develop 2021-09-18 19:24:20 +02:00
Thorsten Claus
4630b49ec4 Update reshare import test with more generic test from #8257 and #8017
Just test for generic NotFetchable error, which also includes the root
author failing to be fetched.
2021-09-18 18:09:30 +02:00
cmrd Senya
9723bd37a7 Fix relayable import when parent is not fetchable 2021-09-18 18:09:30 +02:00
cmrd Senya
1ec0314752 Fix reshare import when root is not fetchable 2021-09-18 04:44:19 +02:00
Benjamin Neff
413926b56e Merge branch 'next-minor' into develop 2021-08-16 01:03:05 +02:00
Thorsten Claus
cdb50edabc Person.find_or_fetch_by_identifier never return nil
Person.find_or_fetch_by_identifier raises an exception if person is not found localy and not fetchable. It never returns nil. These code changes take care about this behaviour and changes specs and code to behave equally.

Close #8273
2021-08-16 00:24:59 +02:00
Benjamin Neff
e2b96c81f2 Merge branch 'next-minor' into develop 2021-08-16 00:24:47 +02:00
Benjamin Neff
d02848c216 Merge branch 'next-minor' into develop 2021-07-26 02:37:40 +02:00
Benjamin Neff
8d5abe8892 Merge pull request #8264 from tclaus/migration_importing_blocks
Migration: Importing user blocks
2021-07-13 01:40:04 +02:00
Benjamin Neff
2e6ae8c967 Merge pull request #8254 from tclaus/8106_set_contact_status_on_account_migration
Migration: set share status in contacts

closes #8106
2021-07-13 01:36:48 +02:00
Thorsten Claus
1ec7bd7ce1 Migration: Importing user blocks
Migration: fix error on blocks import
2021-07-13 01:22:14 +02:00
Benjamin Neff
7896dbada5 Merge branch 'next-minor' into develop 2021-07-04 23:28:20 +02:00
Dennis Schubert
0810fa77e9 Remove special-case for diaspora-handle lookups in people controller.
Thss partly reverts a475d5fb62. The special case here was only ever used for the chat, which no longer exists.
2021-07-04 22:10:20 +02:00
Benjamin Neff
4c46ca1a94 Merge branch 'next-minor' into develop 2021-07-04 22:09:32 +02:00
Benjamin Neff
caeeac6c59 Merge branch 'next-minor' into develop 2021-07-03 03:03:32 +02:00
Benjamin Neff
d27eefeb34 Merge branch 'next-minor' into develop 2021-06-30 23:27:57 +02:00
Benjamin Neff
5fcc60fea8 Merge branch 'next-minor' into develop 2021-06-27 22:29:12 +02:00
Thorsten Claus
60f9dbcdbd Adapted tests for imported share-attribute 2021-06-17 11:15:21 +02:00
Thorsten Claus
123b8b906c 8106 set share status in contacts 2021-06-17 10:26:39 +02:00
Benjamin Neff
1dd2382d03 Merge pull request #8243 from tclaus/8192_drop_relay_example
drop relay example and implementation

closes #8192
2021-06-13 01:35:42 +02:00
Benjamin Neff
a6c79f5e57 Merge pull request #8232 from tclaus/local_public_posts
Show Local public posts

closes #8220
2021-06-13 01:32:24 +02:00
Benjamin Neff
a17fca02ff Merge branch 'next-minor' into develop 2021-06-13 01:27:34 +02:00
Thorsten Claus
47a603a346 Remove route to social relay 2021-05-20 07:59:18 +02:00
Thorsten Claus
61de6e117d 8192 drop relay example and implementation 2021-05-12 23:23:46 +02:00
Thorsten Claus
64d65269d8 Fixing robocop 2021-04-18 13:25:50 +02:00
Thorsten Claus
c937e17335 Set correct defaults for local mode stream 2021-04-18 13:23:17 +02:00
Jonne Haß
85bb022b2a Merge branch 'next-minor' into develop 2021-04-18 13:15:14 +02:00
Thorsten Claus
7fae5ca3b8 More optimized and faster query for local public posts
Even faster with new index
2021-04-18 13:11:25 +02:00
Thorsten Claus
2db1d5d641 Fixing PR Rewview issues 2021-04-18 13:11:25 +02:00
Thorsten Claus
4147249d2d Makes the local posts link be configured for special audiences 2021-04-18 13:11:25 +02:00
Thorsten Claus
34d9d9c3ee Fixing test 2021-04-18 13:11:25 +02:00
Thorsten Claus
ddee980426 Adds a local-public tag on the sidebar that shows all posts local to this pod 2021-04-18 13:11:25 +02:00
Jonne Haß
e8442021b6 Merge branch 'next-minor' into develop 2021-04-17 11:56:04 +02:00
Thorsten Claus
6c3269c6d5 Expand publisher on drag&drop 2021-04-14 08:27:06 +02:00
Hank Grabowski
0638619f81 7878 directly pasting images into edit box and broader drag and drop areas 2021-04-13 20:59:45 +02:00
Jonne Haß
69c6305e62 Merge branch 'next-minor' into develop 2021-04-11 20:50:31 +02:00
Jonne Haß
76f759d9f7 Merge branch 'next-minor' into develop 2021-04-11 20:35:18 +02:00
Jonne Haß
705bef1dea update twitter-text to 3.1.0 2021-04-11 18:25:58 +02:00
Pirate Praveen
b9f570c68d Use jquery-ui-rails instead of rails-assets-jquery.ui
closes #8147
2021-04-11 18:25:58 +02:00
Jonne Haß
4f9257985c Merge branch 'next-minor' into develop 2021-04-11 17:42:40 +02:00
Jonne Haß
98d1b54a82 Merge branch 'next-minor' into develop 2021-04-11 17:35:05 +02:00
Jonne Haß
28213b1a47 Merge branch 'next-minor' into develop 2021-04-11 17:29:57 +02:00
Jonne Haß
f4dc6d0dc7 Merge branch 'next-minor' into develop 2021-04-11 17:23:46 +02:00
Jonne Haß
5f00b4a4e6 Merge branch 'next-minor' into develop 2021-04-11 17:13:46 +02:00
Jonne Haß
2c8bf3b5da Merge branch 'next-minor' into develop 2021-04-11 13:16:21 +02:00
Jonne Haß
cc5fca99be Fixup rubocop warnings from factory_bot introduction 2021-04-11 01:59:47 +02:00
Jonne Haß
3e6bb01199 Fix specs for factory_bot 6 2021-04-11 01:51:38 +02:00
Ntavranis Serafeim
671e8476ba Update factory_girl to factory_bot 2021-04-11 01:51:38 +02:00
Jonne Haß
e0af180c9b Merge branch 'next-minor' into develop 2021-04-11 01:46:52 +02:00
Jonne Haß
7d9f18fda1 Merge branch 'next-minor' into develop 2021-04-10 23:17:47 +02:00
Jonne Haß
bbeb24b398 Merge branch 'next-minor' into develop 2021-04-10 11:33:27 +02:00
Jonne Haß
ddaab0d8e8 Merge branch 'next-minor' into develop 2021-04-10 11:07:45 +02:00
Dennis Schubert
d4f92a8fae Merge branch 'next-minor' into develop 2021-02-21 19:45:00 +01:00
Dennis Schubert
4c74136c53 Merge branch 'next-minor' into develop 2021-02-14 18:51:05 +01:00
Dennis Schubert
ecd2b87475 Merge pull request #8206 from denschub/lowercase-tags
Enforce lowercase tags and migrate existing uppercase tags for Postgres.
2021-02-13 04:45:02 +01:00
Dennis Schubert
1ef0cef74c Merge pull request #8205 from tclaus/8189-filter-upload-image-types
File selection dialog accepts only image types
2021-02-13 04:39:42 +01:00
Dennis Schubert
6c49ba1d2e Merge pull request #8187 from jhass/notifications_not_null
Enforce GUID being present for notifications
2021-02-13 04:36:57 +01:00
Dennis Schubert
195dfe6970 Merge pull request #8188 from jhass/converations_api_read
API: Conversations read handling through explicit route
2021-02-13 04:36:23 +01:00
Dennis Schubert
a178e60907 Enforce lowercase tags and migrate existing uppercase tags for Postgres. 2021-02-13 04:30:23 +01:00
Thorsten Claus
37e4242fdf File selection dialog accepts only image types 2021-02-08 21:38:49 +01:00
Dennis Schubert
5bb0798311 Merge branch 'next-minor' into develop 2021-02-08 21:13:57 +01:00
Benjamin Neff
caa8a29605 Merge branch 'next-minor' into develop 2020-12-30 14:16:08 +01:00
Jonne Haß
4ea2a77a86 Merge branch 'next-minor' into develop 2020-12-30 13:29:43 +01:00
Jonne Haß
d9db761c79 API: Add endpoint to toggle conversation read status 2020-11-30 18:03:38 +01:00
Jonne Haß
a7ff52f366 API: Don't mark conversations as read when fetching its messages 2020-11-30 18:03:38 +01:00
Jonne Haß
07ec46e151 Enforce GUID being present for notifications 2020-11-30 15:42:48 +01:00
Thorsten Claus
d2acad1aed Enlarge accept and deny buttons in open-id authorization (#8183)
* Enlarge accept and deny buttons

* Move Accept/Deny buttons to the center on mobile, moved right on dektops
2020-11-14 19:22:40 +01:00
Dennis Schubert
e0995e540b updated 17 locale files [ci skip] 2020-11-06 01:10:18 +01:00
Benjamin Neff
9a637213b9 Merge pull request #8181 from denschub/scope-en-fix
Fix private/public confusion in API scopes.
2020-11-04 18:57:56 +01:00
Jonne Haß
e167584f7f Merge branch 'next-minor' into develop 2020-11-04 18:09:41 +01:00
Dennis Schubert
611e445e17 Fix private/public confusion. 2020-11-04 16:21:43 +01:00
Benjamin Neff
9021583d37 Merge branch 'next-minor' into develop 2020-11-04 14:22:29 +01:00
Jonne Haß
bbd4a68151 Merge branch 'next-minor' into develop 2020-11-02 19:55:41 +01:00
Jonne Haß
89b2e9ed3a Merge branch 'next-minor' into develop 2020-11-02 16:08:19 +01:00
Jonne Haß
6a4a983fa1 Merge branch 'next-minor' into develop 2020-11-02 15:34:08 +01:00
Jonne Haß
a57ee1efb3 Merge branch 'next-minor' into develop 2020-11-02 15:31:11 +01:00
Jonne Haß
5c2e454ebd Merge branch 'next-minor' into develop 2020-11-02 15:20:58 +01:00
Dennis Schubert
5304fb0c6f Merge pull request #8172 from denschub/api-scope-polish
Slightly polish the OAuth Scope descriptions.
2020-11-01 18:48:15 +01:00
Dennis Schubert
04138da009 Slightly polish the OAuth Scope descriptions. 2020-11-01 18:40:28 +01:00
Jonne Haß
0b51bff255 fix wording for api.openid_connect.scopes.notifications 2020-10-30 15:23:01 +01:00
Dennis Schubert
6109c93556 Add de-fallback for de_moo 2020-10-30 02:10:12 +01:00
Dennis Schubert
146045dbf8 Enable de_moo locale 2020-10-30 02:06:11 +01:00
Dennis Schubert
f842da5488 updated 68 locale files [ci skip] 2020-10-30 02:04:19 +01:00
Dennis Schubert
af649adcd9 Fix typo in en.api.openid_connect.authorizations.scopes.interactions.description 2020-10-30 02:02:30 +01:00
Dennis Schubert
25a70c2b16 Merge pull request #8169 from jhass/openid_issuer_url
OpenID Connect: ensure consistent issuer URL
2020-10-25 17:18:25 +01:00
Jonne Haß
0aba20f85c OpenID Connect: ensure consistent issuer URL
root_url does not know the right protocol in all contexts,
some clients are strict when validating this.
2020-10-24 22:30:43 +02:00
Benjamin Neff
d27cd175df Merge pull request #8167 from SuperTux88/fix-TagFollowingsController
Fix error in TagFollowingsController#create when duplicate is created
2020-10-24 21:04:55 +02:00
Dennis Schubert
31e13dcff7 Merge branch 'next-minor' into develop 2020-10-24 14:25:45 +02:00
Benjamin Neff
81bc438c98 Fix error in TagFollowingsController#create when duplicate is created 2020-10-23 21:10:15 +02:00
Jonne Haß
7fabd9d17f OpenID Connect: Disable form-action CSP on authorization page
Some browsers apply this CSP rules even to the redirect response
after the POST requests, blocking the redirect_uri redirect
2020-10-20 18:10:52 +02:00
Jonne Haß
651a271450 Merge branch 'next-minor' into develop 2020-10-20 11:54:48 +02:00
Jonne Haß
1f32999125 Merge branch 'next-minor' into develop 2020-09-17 08:48:45 +02:00
Jonne Haß
e81f07f0cf Drop config/script_server.yml warning 2020-09-04 22:00:23 +02:00
Jonne Haß
e10cf9cc85 Drop fallback to bitcoin_wallet_id 2020-09-04 22:00:14 +02:00
Jonne Haß
b75254bdda Warn about using diaspora.yml 2020-09-04 21:59:36 +02:00
Jonne Haß
15c11b87ca Merge branch 'next-minor' into develop 2020-09-04 21:58:57 +02:00
Dennis Schubert
9df2e95724 Merge pull request #8141 from denschub/add-ip-to-admin-ui
Expose a user's .current_sign_in_ip in the admin panel
2020-09-02 21:51:20 +02:00
Dennis Schubert
517e3b22ba Expose a user's .current_sign_in_ip in the admin panel 2020-09-02 21:06:13 +02:00
Dennis Schubert
f2b118dc32 Merge branch 'next-minor' into develop 2020-07-08 22:05:52 +02:00
Dennis Schubert
2f608d4a78 Merge branch 'next-minor' into develop 2020-06-24 18:48:01 +02:00
Dennis Schubert
44bbb44c81 Merge branch 'next-minor' into develop 2020-06-14 22:13:08 +02:00
Dennis Schubert
fb46e77339 Merge branch 'next-minor' into develop 2020-06-14 21:50:13 +02:00
Dennis Schubert
6519ded5ec Merge branch 'next-minor' into develop 2020-06-14 20:43:23 +02:00
Dennis Schubert
868f0a8eec Merge pull request #8129 from denschub/api-cors
Allow CORS on all API routes.
2020-06-13 23:31:58 +02:00
Dennis Schubert
31b28e731d Merge branch 'next-minor' into develop 2020-06-13 23:31:09 +02:00
Dennis Schubert
e0cf63f1d3 Merge branch 'next-minor' into develop 2020-06-13 23:29:52 +02:00
Dennis Schubert
bcf5406f53 Issue #8126 - Allow CORS on all API routes. 2020-06-11 20:13:46 +02:00
Benjamin Neff
002d427f34 Merge branch 'next-minor' into develop 2020-03-28 01:13:42 +01:00
Jonne Haß
d13bcc00e0 Merge branch 'next-minor' into develop 2020-03-21 19:15:14 +01:00
Jonne Haß
221ef7b932 Merge branch 'next-minor' into develop 2020-03-20 20:06:04 +01:00
Jonne Haß
1a7b2b0c31 API: extend /search/user with a filter option
See API docs for more details
2020-03-20 12:39:09 +01:00
Jonne Haß
2d28ddc1ef Add API route to (un)block a user 2020-03-20 12:38:27 +01:00
Jonne Haß
6278925ce2 Merge pull request #8109 from jhass/feature/api_post_no_body
API: allow post creation without a body when there are photos
2020-03-04 16:12:11 +01:00
Jonne Haß
cd6e02ccec API: allow post creation without a body when there are photos 2020-02-20 18:50:32 +01:00
Jonne Haß
e9242d7754 API: Fix fetching explicitly not only unread conversations 2020-02-17 10:59:10 +01:00
Jonne Haß
00df0b7bda API: add new route to search for tags 2020-02-17 10:58:04 +01:00
Benjamin Neff
984b739eb4 Merge branch 'next-minor' into develop 2020-02-12 00:38:14 +01:00
Benjamin Neff
4139ae2549 Merge branch 'next-minor' into develop 2020-02-12 00:13:19 +01:00
Jonne Haß
6dbef95951 API: return whether post or item was already reported or not 2020-02-09 11:04:59 +01:00
Jonne Haß
8068d8747b API: Fix fetching explicitly not only unread notifications 2020-02-09 11:03:55 +01:00
Jonne Haß
cd0995abf3 API: Don't return notifications target unless it's a post 2020-02-09 11:03:55 +01:00
Jonne Haß
04d0d6dccb API: return mentioned_people for comments 2020-02-04 18:54:53 +01:00
Dennis Schubert
08d4f87a2d Merge pull request #8100 from denschub/hotfix/fix-raw-photos
Re-add `raw` to a photo's json.
2020-02-04 16:36:13 +01:00
Dennis Schubert
6df742a7cb Do not allow additional properties in the API's photo_sizes schema definition 2020-02-04 15:52:58 +01:00
Dennis Schubert
dbbf743920 Add the scaled_full image as a raw image in AvatarPresenter as well.
This is a temporary workaround. Adding the real raw photo is quite a
challange and touches multiple components nobody wants to touch right
now. As this change is blocking an actual hotfix, this is fine, and will
be properly fixed at a later time.
2020-02-04 15:52:57 +01:00
Dennis Schubert
bf55d07580 Re-add sizes.raw to the photo JSON
because we need it for showing the raw image in the lightbox. This got lost, as the photo extension was made after API development started.
2020-02-04 14:38:49 +01:00
Jonne Haß
2e7526bac5 API: Let hide endpoint take payload as documented and act according to it 2020-02-02 21:49:20 +01:00
Jonne Haß
dcbd02cf7f Return 403 for unauthorized API requests
Also cleanup error handling code and remove last translatable
API error messages
2020-02-02 21:49:20 +01:00
Jonne Haß
884de9008f API: rename poll_answer_id to poll_answer in post interactions vote endpoint 2020-02-02 21:26:33 +01:00
Jonne Haß
b1f357849b API: return post oEmbed data 2020-02-02 20:15:36 +01:00
Jonne Haß
5921cd0176 API: return post open graph metadata 2020-02-02 20:15:36 +01:00
Jonne Haß
8cae234f45 API: return own vote state in polls 2020-02-02 18:40:07 +01:00
Jonne Haß
b921b71b97 API: ensure nsfw field in post is returned as a boolean 2020-02-02 18:31:46 +01:00
Jonne Haß
0754c92116 API: correct like and comment scopes for private posts 2020-02-02 18:23:34 +01:00
Jonne Haß
fbd0a51829 API: return current users like, reshare and subcription status in post infos 2020-02-02 18:13:55 +01:00
Jonne Haß
6bbcb7415b API: don't make error messages translatable 2020-02-02 18:04:11 +01:00
Jonne Haß
04744b4dac API: Return 409 when trying to create something existing and 410 when trying to delete something already gone
Probably missed a few more cases where we always return sucess when the user requests
status quo, but this should cover most ground
2020-02-02 18:04:11 +01:00
Jonne Haß
e8b9a70fbf Ensure API responses adhere to documented error format 2020-02-02 18:04:11 +01:00
Jonne Haß
9e762fcc31 Use full references in API JSON schema
We load another schema, https://diaspora.github.io/diaspora_federation/schemas/federation_entities.json,
that has overlapping definitions, namely #/definitions/post. When the definition from that schema is accessed
first, the json-schema gem caches it and is not smart enough to give precedence to the definition
within the schema document that contains the reference. So for now we have to disambiguate the references
likes this
2020-02-02 18:03:51 +01:00
Jonne Haß
2da33408f9 Merge branch 'next-minor' into develop 2020-01-27 09:30:14 +01:00
Dennis Schubert
f35f55cb25 Merge pull request #8088 from jhass/feature/return_token_endpoint_auth_method
API: Return a default token_endpoint_auth_method when the client gives none in its OpenID Connect registration request
2020-01-24 22:20:00 +01:00
Jonne Haß
654b81b8f1 Explicitly select fragment from API JSON schema in specs
this should make them more strict and robust at the same time
2020-01-24 16:59:04 +01:00
Jonne Haß
35bfbc9c82 Return missing created_at field on reshares endpoint 2020-01-24 16:58:32 +01:00
Jonne Haß
0935451cd8 Return a default token_endpoint_auth_method when the client gives none in its OpenID Connect registration request
Since we announce it in the supported metadata, some clients expect to be told what to use and don't fallback to the spec standard of
client_secret_basic on their own.
2020-01-24 11:02:02 +01:00
Dennis Schubert
500763294d Merge pull request #8086 from jhass/api
API
2020-01-22 22:38:15 +01:00
Jonne Haß
1da075e30b Merge branch 'next-minor' into develop 2020-01-22 21:09:20 +01:00
Jonne Haß
8d690a9e33 undo changes in introduced by merge conflicts in the api branch 2020-01-21 23:56:01 +01:00
Jonne Haß
16b242fa0f Drop chat_enabled from aspects API 2020-01-21 23:35:01 +01:00
Jonne Haß
9bb1a36e3d Fix passing scope name to wrong scope openid connect error message 2020-01-21 23:35:01 +01:00
Jonne Haß
3abf6b6f41 return required client_secret_expires_at in openid connect dynamic registration response 2020-01-21 23:35:01 +01:00
Jonne Haß
1bf05e7921 use desktop openid connect authorizations and error pages on mobile for now 2020-01-21 23:35:01 +01:00
Jonne Haß
39c863ead9 Merge branch 'develop' into api 2020-01-21 23:35:01 +01:00
cmrd Senya
6b8cd5d390 API: accept name parameter instead of first name and last name in user patch 2020-01-21 23:34:43 +01:00
cmrd Senya
9e18b19d6a API: render name instead of first_name and last_name in user data 2020-01-21 23:34:43 +01:00
cmrd Senya
c348a763cf API: add profile:read_private scope 2020-01-21 23:34:43 +01:00
Jonne Haß
d08b31f2ed OpenID: remove private profile data claims that are not returned anyway and fix return values for profile and picture 2020-01-21 23:34:43 +01:00
Jonne Haß
dad54db7f4 Return API pagination links as headers rather than in the response body itself 2020-01-21 23:34:43 +01:00
Jonne Haß
2f7acbe4b3 API: fix missing page parameter to integer conversion 2020-01-21 23:34:43 +01:00
Jonne Haß
ab04633474 fix styling on the new authorization page 2020-01-21 23:34:43 +01:00
Jonne Haß
07acfba488 Merge branch 'develop' into api 2020-01-21 23:34:43 +01:00
Jonne Haß
6d6e846916 API: photo width and height are optional 2020-01-21 23:34:43 +01:00
Jonne Haß
cb679371ac Merge branch 'develop' into api 2020-01-21 23:34:43 +01:00
Jonne Haß
16e754f4c7 API: don't return default avatar 2020-01-21 23:34:00 +01:00
Benjamin Neff
1cbb3f9a7c Merge pull request #8069 from denschub/remove-chat
Remove the JSXC/Prosody integration.
2019-10-25 01:32:37 +02:00
Benjamin Neff
6bb2e2fadd Merge branch 'next-minor' into develop 2019-10-25 01:24:19 +02:00
Dennis Schubert
862fa38f8b Remove the JSXC/Prosody integration.
As per discussion on https://discourse.diasporafoundation.org/t/removing-diaspora-s-current-chat-integration/2718, nobody raised serious concerns or objections. Given future plans, we do not think having an unfinished implementation of something that likely will not get finished in the current form is worth it. So let's get rid of it.
2019-10-18 23:14:14 +02:00
Jonne Haß
995f3394a8 Merge branch 'next-minor' into develop 2019-09-01 02:44:02 +02:00
Benjamin Neff
8cab64b715 Merge branch 'next-minor' into develop 2019-07-06 22:45:05 +02:00
Benjamin Neff
e63fa7a398 Merge branch 'next-minor' into develop 2019-07-04 02:30:38 +02:00
Benjamin Neff
11caf4f86f Merge pull request #8036 from theRealNG/develop
Do not show getting started after account import

fixes #8018
2019-07-03 13:33:22 +02:00
Benjamin Neff
e0b8b295df Merge pull request #8039 from SuperTux88/photos-remove-commentable
Remove commentable functionality from photos
2019-07-03 13:29:39 +02:00
Benjamin Neff
a26e20ab7d Merge branch 'next-minor' into develop 2019-07-03 13:25:49 +02:00
Benjamin Neff
034d78e3e4 Remove commentable functionality from photos
This is not (and as far as I know, was never) used. If we want to make
standalone photos commentable, we can always add it back, but it would
also need to change federation for it to work, because comments support
only posts there. But for now it makes the code cleaner and easier to
remove it.
2019-07-02 01:58:54 +02:00
NG
e3de008453 Do not show getting started after account import 2019-06-26 15:56:32 +05:30
Benjamin Neff
e92eb88782 Merge branch 'next-minor' into develop 2019-06-25 02:14:52 +02:00
Benjamin Neff
6f14f1b850 Merge branch 'next-minor' into develop 2019-06-17 01:20:42 +02:00
Benjamin Neff
0f0b3edec2 Merge pull request #8020 from SuperTux88/dont-send-relayable-on-import
Don't relay others relayable on archive import
2019-05-25 20:04:14 +02:00
Jonne Haß
700e5588e0 Merge branch 'next-minor' into develop 2019-05-24 22:43:13 +02:00
Benjamin Neff
d5b7c6d779 Don't relay others relayable on archive import 2019-05-21 23:08:34 +02:00
Benjamin Neff
0df2f519f0 Merge branch 'next-minor' into develop 2019-05-13 22:52:23 +02:00
Benjamin Neff
314239ff2a Merge branch 'next-minor' into develop 2019-05-12 00:25:52 +02:00
Dennis Schubert
cb5f26a709 Merge branch 'next-minor' into develop 2019-05-05 04:23:09 +02:00
Jonne Haß
dfeea521f5 Merge branch 'next-minor' into develop 2019-05-03 17:18:53 +02:00
Dennis Schubert
74c3debefe Merge branch 'next-minor' into develop 2019-05-01 00:22:09 +02:00
Benjamin Neff
d25d9f96f9 Merge branch 'next-minor' into develop 2019-04-30 22:52:00 +02:00
Benjamin Neff
d486fbce8c Merge branch 'next-minor' into develop 2019-04-30 00:21:55 +02:00
Jonne Haß
f7103267a1 Merge branch 'next-minor' into develop 2019-04-28 23:25:04 +02:00
lislis
1da118780e Two factor authentication (#7751) 2019-04-28 19:06:48 +02:00
cmrd Senya
ce597380e6 Merge branch 'next-minor' into develop 2019-04-28 19:29:36 +03:00
Benjamin Neff
8372fb2240 Merge branch 'next-minor' into develop 2019-04-28 16:48:49 +02:00
cmrd Senya
8b35356709 AccountMigration: fix flaky spec 2019-04-28 13:56:35 +03:00
Jonne Haß
a19891174e rubocop: increase complexity limits [ci skip] 2019-04-28 11:08:16 +02:00
Benjamin Neff
d58646085f Merge branch 'next-minor' into develop 2019-04-27 19:12:35 +02:00
Benjamin Neff
cf350c3e92 Merge pull request #7660 from cmrd-senya/archive-import-backend
Archive import backend implementation
2019-04-27 19:07:09 +02:00
cmrd Senya
3c94c1bd29 AuthorPrivateKeyValidator: support old serialization method of RSA keys 2019-04-27 19:17:54 +03:00
Benjamin Neff
6ba9b24c1a Merge branch 'next-minor' into develop 2019-04-27 18:00:40 +02:00
cmrd Senya
ee0c3e9865 Account import: add missing profile fields 2019-04-27 17:44:19 +03:00
Jonne Haß
214c2d7af7 Specs: Ensure photos always width and height 2019-04-27 16:05:35 +02:00
Jonne Haß
91b6a807c7 API: fix birthday format in responses 2019-04-27 16:05:22 +02:00
Jonne Haß
52e4e9f903 API: Update post location format to floats instead of floats as strings 2019-04-27 16:04:44 +02:00
Jonne Haß
af59bf3265 API: Do not return redundant author for photos 2019-04-27 16:03:55 +02:00
Jonne Haß
8afa17f940 Don't return aspect order in single user info API route 2019-04-27 16:03:02 +02:00
Jonne Haß
9b8f10358a Introduce JSON Schema for API responses and validate the responses against it 2019-04-27 16:01:54 +02:00
cmrd Senya
b5db8820d6 Account Migration rake task: render warnings with a newline 2019-04-27 15:13:14 +03:00
cmrd Senya
f7324adb9c Account import: import profile data too 2019-04-27 15:13:14 +03:00
cmrd Senya
bffe2b651c AccountMigration spec: flatten shared examples more 2019-04-26 20:58:28 +03:00
cmrd Senya
882e4f9868 AccountMigration specs: remove unused user shortcuts 2019-04-26 20:44:09 +03:00
cmrd Senya
a3196a1089 ArchiveValidator: remove unused TODO 2019-04-26 20:33:21 +03:00
cmrd Senya
597d9e0275 AccountMigration: support chained migration case 2019-04-26 20:29:26 +03:00
cmrd Senya
dd9ac758e8 AccountMigration integration specs: use single example instead of multiple to speed up the spec 2019-04-26 20:13:19 +03:00
cmrd Senya
f774c46db3 AccountMigration specs: move one-time shared contexts in place 2019-04-26 19:45:55 +03:00
cmrd Senya
6b88d2f4e0 AccountMigration specs: move 2-line shared context in place 2019-04-26 19:38:23 +03:00
Jonne Haß
f7a27f0c07 Ignore Metrics/AbcSize Rubocop for PostPresenter#as_api_response
[ci skip]
2019-04-26 18:18:48 +02:00
Jonne Haß
99411fced7 Merge branch 'develop' into api 2019-04-26 17:54:08 +02:00
Benjamin Neff
4e22c4b211 Merge branch 'next-minor' into develop 2019-04-26 17:41:33 +02:00
cmrd Senya
f85f167f50 Implement archive import backend
This implements archive import feature.

The feature is divided in two main subfeatures: archive validation and archive import.

Archive validation performs different validation on input user archive. This can be
used without actually running import, e.g. when user wants to check the archive
before import from the frontend. Validators may add messages and modify the archive.

Validators are separated in two types: critical validators and non-critical validators.

If validations by critical validators fail it means we can't import archive.

If non-critical validations fail, we can import archive, but some warning messages
are rendered.

Also validators may change archive contents, e.g. when some entity can't be
imported it may be removed from the archive.

Validators' job is to take away complexity from the importer and perform the validations
which are not implemented in other parts of the system, e.g. DB validations or
diaspora_federation entity validations.

Archive importer then takes the modified archive from the validator and imports it.

In order to incapsulate high-level migration logic a MigrationService is
introduced. MigrationService links ArchiveValidator, ArchiveImporter and
AccountMigration.

Also here is introduced a rake task which may be used by podmins to run archive
import.
2019-04-26 18:41:27 +03:00
Jonne Haß
e3c05b5620 Stabilize Diaspora::Federation::Receive.comment.saves the signature data 2019-04-26 15:56:09 +02:00
Jonne Haß
b1cc37e939 Avoid using sleep in the API specs 2019-04-26 13:40:43 +02:00
Jonne Haß
5df1e08610 migrate authorizations scopes column to text 2019-04-26 13:40:43 +02:00
Jonne Haß
3f77507b15 make notifications controller spec stable 2019-04-26 12:26:26 +02:00
Benjamin Neff
e0a6189ec4 Merge branch 'next-minor' into develop 2019-03-30 15:05:47 +01:00
Benjamin Neff
fc0de7bbd0 Merge branch 'next-minor' into develop 2019-02-26 01:02:52 +01:00
Dennis Schubert
c30ea112df Merge branch 'next-minor' into develop 2019-02-19 03:04:13 +01:00
Benjamin Neff
d5735c7981 Merge branch 'next-minor' into develop 2019-02-19 01:58:32 +01:00
Benjamin Neff
707e358e48 Merge branch 'next-minor' into develop 2019-02-19 01:30:08 +01:00
Benjamin Neff
cdfcccd75d Merge branch 'next-minor' into develop 2019-01-14 03:15:51 +01:00
Dennis Schubert
97805e6602 Merge branch 'next-minor' into develop 2019-01-13 02:17:22 +01:00
Benjamin Neff
7ad758a8d9 Merge branch 'next-minor' into develop 2019-01-07 02:04:26 +01:00
Benjamin Neff
cf1b0fb414 Merge branch 'next-minor' into develop 2019-01-06 22:32:39 +01:00
Benjamin Neff
2b2852267a Merge branch 'next-minor' into develop 2019-01-06 22:18:48 +01:00
Hank Grabowski
3080d1c559 Authentication cucumber tests fixed by updating to for new scopes names 2019-01-01 11:05:55 -05:00
Hank Grabowski
ce01946eb0 Fixed new pronto warnings after develop branch sync 2018-12-30 17:04:35 -05:00
Hank Grabowski
89f918c486 Merge branch 'api' of github.com:frankrousseau/diaspora into api 2018-12-30 16:38:02 -05:00
Hank Grabowski
e127502be5 API Branch Final Cleanup Before PR 2018-12-30 22:33:04 +01:00
Hank Grabowski
9c730fc0f3 OpenID Scopes and Security updates 2018-12-30 22:33:04 +01:00
Hank Grabowski
a53495c9aa API Paging library and used in appropriate controllers with full tests 2018-12-30 22:33:04 +01:00
Hank Grabowski
16bf5d8130 Add Poll Voting Method to Interactions Endpoint 2018-12-30 22:33:04 +01:00
Hank Grabowski
02cf6a9eb2 Photos API Endpoint and unit tests complete 2018-12-30 22:33:04 +01:00
Hank Grabowski
7dba616e4e Search API Endpoint and unit test complete 2018-12-30 22:33:04 +01:00
Hank Grabowski
2f432eb560 Users Controller and unit tests complete 2018-12-30 22:33:04 +01:00
Hank Grabowski
09c13fdf67 Notifications API Endpoint and unit test complete 2018-12-30 22:33:04 +01:00
Hank Grabowski
803abba5c1 Interactions API endpoint complete with full tests 2018-12-30 22:33:04 +01:00
HankG
0f4789a5cb Contacts API Feature complete with full tests 2018-12-30 22:33:04 +01:00
Hank Grabowski
7ae36de2cf Tags API Endpoint complete with full tests 2018-12-30 22:33:04 +01:00
Hank Grabowski
db7fe69ce4 Aspects API Endpoint complete with full tests 2018-12-30 22:31:33 +01:00
Hank Grabowski
173461ac3d Reshares API Endpoint complete with full unit tests 2018-12-30 22:31:33 +01:00
Hank Grabowski
45c8277f2f Conversations API Test Removed 'convo' Abbreviations 2018-12-30 22:31:33 +01:00
HankG
4923338bcf Conversations API Endpoint Feature complete with full tests 2018-12-30 22:31:33 +01:00
HankG
48b1428c57 Streams Controller API feature complete and fully tested 2018-12-30 22:31:33 +01:00
Hank Grabowski
bb2261b47d Posts API Endpoint feature complete with full unit tests 2018-12-30 22:31:33 +01:00
Hank Grabowski
f64a8e04ed Comments API Endpoint complete with full unit tests 2018-12-30 22:31:33 +01:00
Hank Grabowski
7ee9565a04 Likes API endpoint complete 2018-12-30 22:31:33 +01:00
Frank Rousseau
a56d998499 Fix code style 2018-12-30 22:31:33 +01:00
Frank Rousseau
758c673f68 Fix post controller test 2018-12-30 22:31:33 +01:00
Frank Rousseau
5326ddf6c3 Adapt error formatting to documentation 2018-12-30 22:31:33 +01:00
Frank Rousseau
df11297654 Fix like deletion 2018-12-30 22:31:33 +01:00
Frank Rousseau
84ac19a090 Clean API routes
* Remove routes without matching controller
* Rename stream routes to match specifications
* Remove public stream route and related controller
2018-12-30 22:31:33 +01:00
Frank Rousseau
f8969ddfeb Make Post API match specs
https://diaspora.github.io/api-documentation/routes/posts.html
2018-12-30 22:31:33 +01:00
Frank Rousseau
ec47fc67ab Make the comment API match the API specs 2018-12-30 22:31:33 +01:00
Frank Rousseau
317b78394a Improve API error management
* Fix active record not found case
* Display backtrace in error logs
2018-12-30 22:31:33 +01:00
Frank Rousseau
bf2a188f82 Remove default paramter for api routes 2018-12-30 22:31:33 +01:00
Frank Rousseau
ffd5f575bc Make API likes controller match specs 2018-12-30 22:31:33 +01:00
Frank Rousseau
646c743385 Fix stream API routes
Put streams under the subpath `/streams`.
2018-12-30 22:31:33 +01:00
Frank Rousseau
f6b57384e7 Changes to use V1 API version instead of V0 2018-12-30 22:31:33 +01:00
Frank Rousseau
ec18844e8f Move API controllers from v0 to v1 2018-12-30 22:31:33 +01:00
Frank Rousseau
b4dc13f1ce Fix code styles 2018-12-30 22:31:33 +01:00
Frank Rousseau
e6fd043206 Adapt API controllers to recent service changes 2018-12-30 22:31:33 +01:00
Frank Rousseau
36bc122510 Adapt some API route syntax 2018-12-30 22:31:33 +01:00
Frank Rousseau
064beb6f4e Adapt API tests to recent changes 2018-12-30 22:31:33 +01:00
Frank Rousseau
72a3b92b50 Make syntax compliant with the pronto configuration 2018-12-30 22:31:33 +01:00
Frank Rousseau
2a8c0ddd51 Follow official specs 2018-12-30 22:31:33 +01:00
Frank Rousseau
13e2841f13 Merge conv deletion and visibility deletion 2018-12-30 22:31:33 +01:00
Frank Rousseau
f9e0dee2dc Make messages API conformed with docs 2018-12-30 22:31:33 +01:00
Frank Rousseau
5040363f7a Make conversation API data format ok with docs
* Base the API requesting on GUID instead of ID
* Include read field
* Do not include messages in conversation results
2018-12-30 22:31:33 +01:00
Frank Rousseau
2be3e9eaf3 Fix styles for some API controllers
* Comments
* Likes
* Streams
2018-12-30 22:31:33 +01:00
Frank Rousseau
fa53656b3b Add conversation visibilities API controller 2018-12-30 22:31:33 +01:00
Frank Rousseau
f8ba88408b Add messages API controller 2018-12-30 22:31:33 +01:00
Frank Rousseau
559f370116 Add conversations API controller 2018-12-30 22:31:33 +01:00
Frank Rousseau
b37c14ce0e Add service for conversations 2018-12-30 22:31:33 +01:00
Frank Rousseau
c45b785370 Add conversation presenter 2018-12-30 22:31:33 +01:00
Frank Rousseau
f0aecd5790 Add routes for conversation
Including messages and visibilities
2018-12-30 22:31:33 +01:00
Frank Rousseau
35860e2866 Add locales for conversation API controller 2018-12-30 22:31:33 +01:00
Frank Rousseau
5a0759a3d9 Add exception handlers in base API controller
* For record not found returns a 404 response
* For wrong parameters returns a 400 response
* For other exceptions returns a 500 response
2018-12-30 22:31:33 +01:00
theworldbright
6cad0a965a Add likes API route 2018-12-30 22:31:33 +01:00
theworldbright
41750e38da Add streams API routes 2018-12-30 22:31:33 +01:00
theworldbright
c9ba1ee197 Combine Comment index with Post show API route 2018-12-30 22:31:33 +01:00
theworldbright
47dd44ff39 Add comments API routes 2018-12-30 22:31:33 +01:00
theworldbright
552d3efb29 Add posts API routes 2018-12-30 22:31:33 +01:00
Frank Rousseau
6b9b19c284 Merge pull request #24 from frankrousseau/api-final-cleanup
API Final Cleanup
2018-12-30 22:12:53 +01:00
Hank Grabowski
f07912ebdd API Branch Final Cleanup Before PR 2018-12-30 11:50:58 -05:00
Benjamin Neff
3fe0ef350f Merge branch 'next-minor' into develop 2018-12-28 01:39:56 +01:00
Frank Rousseau
8ffb814166 Merge pull request #22 from frankrousseau/api-openid-updates
WIP: API OpenID Updates
2018-12-27 00:24:02 +01:00
Hank Grabowski
a8d69c48dc OpenID Scopes and Security updates 2018-12-26 14:13:13 -05:00
Frank Rousseau
6ba26496ec Merge pull request #20 from frankrousseau/api-paging-updates
API Paging Updates
2018-12-18 13:44:18 +01:00
Hank Grabowski
7109773b83 API Paging library and used in appropriate controllers with full tests 2018-12-17 22:07:33 -05:00
Frank Rousseau
43c111bd98 Merge pull request #21 from frankrousseau/api-poll-participation-updates
API Poll Participation
2018-12-16 17:23:27 +01:00
Hank Grabowski
ff6d0064d0 Add Poll Voting Method to Interactions Endpoint 2018-12-16 11:06:27 -05:00
Frank Rousseau
32157036d3 Merge pull request #17 from frankrousseau/api-photos-updates
Photos API Endpoint
2018-12-11 01:16:05 +01:00
Hank Grabowski
8851f664e5 Photos API Endpoint and unit tests complete 2018-12-10 12:43:50 -05:00
Frank Rousseau
f284d379dd Merge pull request #19 from frankrousseau/api-search-updates
API Search Endpoint
2018-12-04 15:46:48 +01:00
Hank Grabowski
68d7d59286 Search API Endpoint and unit test complete 2018-12-04 09:24:17 -05:00
Frank Rousseau
df756c5f9f Merge pull request #15 from frankrousseau/api-users-updates
User API Updates
2018-12-04 15:06:33 +01:00
Hank Grabowski
c3852a8e9c Users Controller and unit tests complete 2018-12-04 08:48:16 -05:00
Frank Rousseau
a5bdabea9b Merge pull request #18 from frankrousseau/api-notifications-updates
API Notifications Endpoint
2018-12-04 14:01:58 +01:00
Hank Grabowski
ef762c4920 Notifications API Endpoint and unit test complete 2018-12-04 07:51:57 -05:00
Frank Rousseau
2bfeefe3b3 Merge pull request #16 from frankrousseau/api-interactions-updates
Interactions API Endpoint
2018-12-04 09:22:53 +01:00
Hank Grabowski
6e469825cd Interactions API endpoint complete with full tests 2018-12-03 20:56:50 -05:00
Frank Rousseau
3257e569b9 Merge pull request #14 from frankrousseau/api-contacts-updates
Contacts API Endpoint Complete with Tests
2018-12-02 02:23:57 +01:00
HankG
8a60870f04 Contacts API Feature complete with full tests 2018-12-01 15:21:16 -05:00
Benjamin Neff
6824ef5baf Merge branch 'next-minor' into develop 2018-11-25 22:38:03 +01:00
Benjamin Neff
0d45e709f2 Merge branch 'next-minor' into develop 2018-11-19 00:51:10 +01:00
Benjamin Neff
5b0066a426 Merge branch 'next-minor' into develop 2018-11-18 19:36:51 +01:00
Benjamin Neff
24fbd59d21 Merge pull request #7931 from SuperTux88/update-gems
Update gems
2018-11-17 23:40:12 +01:00
Benjamin Neff
8fc75e8955 Bump twitter-text 2018-11-17 21:20:51 +01:00
Benjamin Neff
81c833c4e3 Bump rails-assets-pica 2018-11-17 21:20:05 +01:00
Benjamin Neff
5bc32d0aad Bump rails-assets-cropperjs 2018-11-17 21:15:59 +01:00
Benjamin Neff
b30c4e4e97 Merge branch 'next-minor' into develop 2018-11-17 21:08:23 +01:00
Frank Rousseau
b17e519cb4 Merge pull request #10 from frankrousseau/api-tag-updates
Api Tag Endpoint Feature Complete With Tests
2018-11-11 18:07:40 +01:00
Frank Rousseau
6fa99072d1 Merge branch 'api' into api-tag-updates 2018-11-11 18:06:50 +01:00
Hank Grabowski
d5e1cbeefa Tags API Endpoint complete with full tests 2018-11-11 11:45:21 -05:00
Frank Rousseau
82978bb67f Merge pull request #12 from frankrousseau/api-aspects-updates
API Aspects Endpoint Feature Complete With Full Tests
2018-11-11 17:45:06 +01:00
Hank Grabowski
97af2441ee Aspects API Endpoint complete with full tests 2018-11-11 11:30:19 -05:00
Frank Rousseau
6924781bb0 Merge pull request #13 from frankrousseau/api-reshare-update
API Reshare Endpoint Feature Complete With Full Tests
2018-11-11 16:22:05 +01:00
Hank Grabowski
9757637afa Reshares API Endpoint complete with full unit tests 2018-11-11 09:53:13 -05:00
Frank Rousseau
29058d028f Merge pull request #11 from frankrousseau/api-conversations-updates
Conversations API Test Removed 'convo' Abbreviations
2018-11-09 11:08:37 +01:00
Benjamin Neff
652b0064e6 Merge branch 'next-minor' into develop 2018-11-08 20:58:35 +01:00
Hank Grabowski
6bae98d980 Conversations API Test Removed 'convo' Abbreviations 2018-11-08 13:08:52 -05:00
Dennis Schubert
ddaa5c0064 Merge branch 'next-minor' into develop 2018-11-08 05:15:54 +01:00
Dennis Schubert
cd16f29c39 Merge branch 'next-minor' into develop 2018-11-08 05:14:36 +01:00
Dennis Schubert
ffe6fc0aa1 Merge branch 'next-minor' into develop 2018-11-08 05:08:16 +01:00
Dennis Schubert
cee30c36a0 Merge branch 'next-minor' into develop 2018-11-08 05:06:53 +01:00
Frank Rousseau
f428f840f6 Merge pull request #9 from frankrousseau/api-conversations-updates
Conversations API Endpoint Feature complete with full tests
2018-11-07 18:37:25 +01:00
Frank Rousseau
61b134f81d Merge pull request #8 from frankrousseau/api-streams-updates
Streams Controller API feature complete and fully tested
2018-11-06 21:21:24 +01:00
HankG
8b6c32e655 Conversations API Endpoint Feature complete with full tests 2018-11-06 14:52:55 -05:00
HankG
5bfe7048eb Streams Controller API feature complete and fully tested 2018-11-06 13:58:47 -05:00
Frank Rousseau
169136f292 Merge pull request #7 from frankrousseau/api-posts-updates
Posts API Endpoint feature complete with full unit tests
2018-11-05 22:35:05 +01:00
Hank Grabowski
6798ba974c Posts API Endpoint feature complete with full unit tests 2018-11-05 08:30:54 -05:00
Benjamin Neff
0c2cd2ef1b Merge branch 'next-minor' into develop 2018-11-04 03:07:50 +01:00
Benjamin Neff
d3bb7ade78 Merge branch 'next-minor' into develop 2018-11-02 01:39:11 +01:00
Frank Rousseau
b8198efc6c Merge pull request #6 from frankrousseau/api-comments-updates
Comments API Endpoint complete with full unit tests
2018-11-02 00:42:04 +01:00
Hank Grabowski
038b6f49a9 Comments API Endpoint complete with full unit tests 2018-11-01 14:14:34 -04:00
Frank Rousseau
9faf38671b Merge pull request #5 from frankrousseau/api-likes-get-details
Likes API endpoint complete
2018-11-01 16:37:21 +01:00
Hank Grabowski
d6915ff5d0 Likes API endpoint complete 2018-11-01 11:06:45 -04:00
Frank Rousseau
2c94994f32 Fix code style 2018-11-01 13:56:18 +01:00
Frank Rousseau
4370315d6c Fix post controller test 2018-11-01 13:56:18 +01:00
Frank Rousseau
a7ea3ba254 Adapt error formatting to documentation 2018-11-01 13:56:18 +01:00
Frank Rousseau
79fe1c2a7e Fix like deletion 2018-11-01 13:56:18 +01:00
Frank Rousseau
27ea63979f Clean API routes
* Remove routes without matching controller
* Rename stream routes to match specifications
* Remove public stream route and related controller
2018-11-01 13:56:18 +01:00
Frank Rousseau
c1ece44c53 Make Post API match specs
https://diaspora.github.io/api-documentation/routes/posts.html
2018-11-01 13:56:18 +01:00
Frank Rousseau
bcbcf6bce3 Make the comment API match the API specs 2018-11-01 13:56:18 +01:00
Frank Rousseau
55dbbad869 Improve API error management
* Fix active record not found case
* Display backtrace in error logs
2018-11-01 13:56:18 +01:00
Frank Rousseau
1b85655d71 Remove default paramter for api routes 2018-11-01 13:56:18 +01:00
Frank Rousseau
348790292b Make API likes controller match specs 2018-11-01 13:56:18 +01:00
Frank Rousseau
39265ab9b5 Fix stream API routes
Put streams under the subpath `/streams`.
2018-11-01 13:56:18 +01:00
Frank Rousseau
797afb1c9b Changes to use V1 API version instead of V0 2018-11-01 13:56:18 +01:00
Frank Rousseau
100b1a4286 Move API controllers from v0 to v1 2018-11-01 13:56:18 +01:00
Frank Rousseau
3532a340c2 Fix code styles 2018-11-01 13:56:18 +01:00
Frank Rousseau
2d40801bb4 Adapt API controllers to recent service changes 2018-11-01 13:56:18 +01:00
Frank Rousseau
f23e947d0c Adapt some API route syntax 2018-11-01 13:56:18 +01:00
Frank Rousseau
b00df8c2e7 Adapt API tests to recent changes 2018-11-01 13:56:18 +01:00
Frank Rousseau
50e034769f Make syntax compliant with the pronto configuration 2018-11-01 13:56:18 +01:00
Frank Rousseau
71d324a8e4 Follow official specs 2018-11-01 13:56:18 +01:00
Frank Rousseau
3f00195eed Merge conv deletion and visibility deletion 2018-11-01 13:56:18 +01:00
Frank Rousseau
bbbe3aea7f Make messages API conformed with docs 2018-11-01 13:56:18 +01:00
Frank Rousseau
454be1b468 Make conversation API data format ok with docs
* Base the API requesting on GUID instead of ID
* Include read field
* Do not include messages in conversation results
2018-11-01 13:56:18 +01:00
Frank Rousseau
d03b830b07 Fix styles for some API controllers
* Comments
* Likes
* Streams
2018-11-01 13:56:18 +01:00
Frank Rousseau
84f972b368 Add conversation visibilities API controller 2018-11-01 13:56:18 +01:00
Frank Rousseau
43a8cbff5d Add messages API controller 2018-11-01 13:56:18 +01:00
Frank Rousseau
0af04a5c1e Add conversations API controller 2018-11-01 13:56:18 +01:00
Frank Rousseau
1879adcde4 Add service for conversations 2018-11-01 13:56:18 +01:00
Frank Rousseau
40d42f4b58 Add conversation presenter 2018-11-01 13:56:18 +01:00
Frank Rousseau
604075c570 Add routes for conversation
Including messages and visibilities
2018-11-01 13:56:18 +01:00
Frank Rousseau
f4f7eb8726 Add locales for conversation API controller 2018-11-01 13:56:18 +01:00
Frank Rousseau
f66bd9e1af Add exception handlers in base API controller
* For record not found returns a 404 response
* For wrong parameters returns a 400 response
* For other exceptions returns a 500 response
2018-11-01 13:56:18 +01:00
theworldbright
e84e3e64c6 Add likes API route 2018-11-01 13:56:18 +01:00
theworldbright
44742109b0 Add streams API routes 2018-11-01 13:56:18 +01:00
theworldbright
ea3395378f Combine Comment index with Post show API route 2018-11-01 13:56:18 +01:00
theworldbright
47c7de22ae Add comments API routes 2018-11-01 13:56:18 +01:00
theworldbright
c432bb4891 Add posts API routes 2018-11-01 13:56:18 +01:00
Dennis Schubert
c1e5f61502 Merge branch 'next-minor' into develop 2018-10-28 22:09:13 +01:00
Dennis Schubert
0da2e9c102 Merge branch 'next-minor' into develop 2018-10-27 00:13:56 +02:00
Dennis Schubert
a201e3b2c2 updated 17 locale files [ci skip] 2018-10-27 00:12:25 +02:00
Dennis Schubert
21f9a9d134 Merge branch 'next-minor' into develop 2018-10-15 02:45:09 +02:00
Dennis Schubert
53a7508222 Merge branch 'next-minor' into develop 2018-10-15 02:41:57 +02:00
Dennis Schubert
a928e40d7f Merge branch 'next-minor' into develop 2018-10-14 06:03:12 +02:00
Dennis Schubert
bb84767a96 Merge branch 'next-minor' into develop 2018-10-08 02:58:01 +02:00
Dennis Schubert
9bab794ea4 Merge branch 'next-minor' into develop 2018-10-08 02:50:36 +02:00
Dennis Schubert
26212ba3e0 Merge branch 'next-minor' into develop 2018-10-08 02:43:11 +02:00
Dennis Schubert
a91579e92a Merge branch 'next-minor' into develop 2018-10-04 04:38:10 +02:00
Dennis Schubert
3ebe0e56a8 Merge branch 'next-minor' into develop 2018-10-04 04:37:06 +02:00
Dennis Schubert
fe5c95e0ba Merge branch 'next-minor' into develop 2018-09-30 21:44:49 +02:00
Dennis Schubert
883eb54ecf Merge branch 'next-minor' into develop 2018-09-30 18:00:57 +02:00
Dennis Schubert
24c7e472d4 Merge branch 'next-minor' into develop 2018-09-30 17:59:12 +02:00
Dennis Schubert
026e63b961 Merge branch 'next-minor' into develop 2018-09-08 02:25:44 +02:00
Benjamin Neff
c9f65332de Merge branch 'next-minor' into develop 2018-09-06 02:33:43 +02:00
Dennis Schubert
232f76e69d Merge branch 'next-minor' into develop 2018-09-06 01:40:55 +02:00
Dennis Schubert
f66248c315 Merge branch 'next-minor' into develop 2018-09-05 03:19:44 +02:00
Dennis Schubert
60b5443850 Merge pull request #7857 from SuperTux88/fix-comment-title-without-text
Fix comment notification subject for posts without text
2018-09-05 03:13:45 +02:00
Dennis Schubert
11dac58dc7 Merge pull request #7856 from SuperTux88/bump-json-jwt
Bump json-jwt
2018-09-05 03:12:52 +02:00
Benjamin Neff
4c4c3d8bf0 Bump json-jwt and openid_connect
Fixes CVE-2018-1000539
2018-09-05 02:19:34 +02:00
Benjamin Neff
2eb17e109b Fix comment notification subject for posts without text
Fixes #7854
2018-09-05 01:32:36 +02:00
Benjamin Neff
76c64ec1f8 Merge branch 'next-minor' into develop 2018-08-24 19:49:37 +02:00
Benjamin Neff
9b3f90dc90 Merge branch 'next-minor' into develop 2018-07-20 11:07:18 +02:00
Benjamin Neff
7fef695e29 Merge pull request #7834 from SuperTux88/fix-photo-uploader-preview
Fix preview with uploaded photos
2018-07-18 01:56:57 +02:00
Benjamin Neff
d06ef4505c Wait for the image actually uploaded and removed again 2018-07-17 20:48:37 +02:00
Benjamin Neff
80bc90afa9 Fix preview with uploaded photos 2018-07-17 20:48:37 +02:00
Benjamin Neff
e5687dd7e0 Merge branch 'next-minor' into develop 2018-07-17 01:25:53 +02:00
Benjamin Neff
1289b3b541 Merge branch 'next-minor' into develop 2018-07-13 10:22:04 +02:00
Benjamin Neff
ea15403d57 Merge pull request #7655 from Flaburgan/6721-fix-upload-progress-bar
Fix multiple photos upload progress bar
2018-07-11 01:37:02 +02:00
Benjamin Neff
dcbdb69e22 Merge branch 'next-minor' into develop 2018-07-11 01:35:50 +02:00
flaburgan
af02d01d41 Fix progress when uploading multiple photo at the same time 2018-07-09 17:48:30 +02:00
Benjamin Neff
9ff1646cbb Merge branch 'next-minor' into develop 2018-06-30 23:27:39 +02:00
Benjamin Neff
4aa08ddf14 Merge branch 'next-minor' into develop 2018-06-27 02:46:26 +02:00
Benjamin Neff
b94ef57bbc Merge branch 'next-minor' into develop 2018-06-20 01:56:25 +02:00
Benjamin Neff
f9a59f2ff0 Merge branch 'next-minor' into develop 2018-06-20 00:50:34 +02:00
Benjamin Neff
0b9ba559c7 Merge branch 'next-minor' into develop 2018-06-18 02:48:47 +02:00
Benjamin Neff
299c04a24a Merge pull request #7781 from SuperTux88/enable-csp-by-default
Enable Content-Security-Policy header by default
2018-06-16 21:21:07 +02:00
Benjamin Neff
8983901b1a Merge branch 'next-minor' into develop 2018-06-16 21:19:41 +02:00
Benjamin Neff
f3d2a54050 Merge branch 'next-minor' into develop 2018-06-16 04:36:13 +02:00
Benjamin Neff
212da3a2b7 Merge branch 'next-minor' into develop 2018-06-16 01:23:10 +02:00
Benjamin Neff
f863cf08a0 Merge branch 'next-minor' into develop 2018-05-16 19:10:09 +02:00
Benjamin Neff
0cb212e6cb Merge branch 'next-minor' into develop 2018-05-16 00:54:46 +02:00
Benjamin Neff
2a60cb30a1 Merge branch 'next-minor' into develop 2018-05-03 21:33:10 +02:00
Benjamin Neff
22d1ad995c Merge branch 'next-minor' into develop 2018-04-30 22:54:33 +02:00
Dennis Schubert
360ea20367 Merge branch 'next-minor' into develop 2018-04-23 20:37:03 +02:00
Dennis Schubert
74bac8c495 Merge branch 'next-minor' into develop 2018-04-23 20:33:20 +02:00
Benjamin Neff
c061425022 Add changelog entry for #7788 [ci skip] 2018-04-16 01:32:41 +02:00
Benjamin Neff
c643743df0 Merge pull request #7788 from SuperTux88/remove-mention-backport
Remove backporting of mention syntax
2018-04-16 01:27:47 +02:00
Benjamin Neff
d5f5e1991b Merge branch 'next-minor' into develop 2018-04-16 01:26:56 +02:00
Benjamin Neff
8daf934c45 Remove backporting of mention syntax
fixes #7276, #7392 and #7640
2018-04-15 15:49:23 +02:00
Benjamin Neff
9171f6b5ef Revert "Revert "Bump twitter-text""
Bump twitter-text on develop branch again

This reverts commit 15ff67499b.
2018-04-12 04:01:52 +02:00
Benjamin Neff
25fc4c746a Merge branch 'next-minor' into develop 2018-04-12 04:01:39 +02:00
Benjamin Neff
bd175cfb12 Bump rails-assets-cropperjs 2018-04-12 02:50:41 +02:00
Benjamin Neff
c1ebc4d338 Merge branch 'next-minor' into develop 2018-04-12 02:49:11 +02:00
Benjamin Neff
66175f6908 Merge branch 'next-minor' into develop 2018-04-12 01:56:07 +02:00
Benjamin Neff
c0a4895854 Enable Content-Security-Policy header by default 2018-04-10 21:29:34 +02:00
Benjamin Neff
89f7f97294 Merge branch 'next-minor' into develop 2018-04-10 01:58:07 +02:00
Dennis Schubert
ae17248b2e Merge pull request #7734 from Fensterbank/client-side-picture-resize
Resize images on client-side before uploading
2018-04-02 10:38:51 +02:00
Benjamin Neff
c84411ea62 Merge branch 'next-minor' into develop 2018-03-25 08:37:11 +02:00
Jonne Haß
b7fa28a5a1 Merge pull request #7746 from ujdhesa/develop
Update for sq translation
2018-03-24 17:49:14 +01:00
Besnik Bleta
a867d64631 Update for sq translation 2018-03-24 18:13:12 +02:00
Benjamin Neff
38d92cc84b Merge branch 'next-minor' into develop 2018-03-22 23:17:15 +01:00
Benjamin Neff
0d07d9f3de Merge branch 'next-minor' into develop 2018-03-18 23:14:20 +01:00
Jonne Haß
e1b1491f75 Merge branch 'next-minor' into develop 2018-03-16 11:31:34 +01:00
Benjamin Neff
12cb2be641 Merge branch 'next-minor' into develop 2018-03-13 00:02:52 +01:00
Frédéric Bolvin
6d55b15604 Resize images on client-side before uploading 2018-03-11 11:20:16 +01:00
Dennis Schubert
29daea1b0a Merge branch 'next-minor' into develop 2018-03-10 04:46:01 +01:00
Benjamin Neff
f14547b2ea Merge branch 'next-minor' into develop 2018-03-10 00:01:36 +01:00
Benjamin Neff
b263cf7e6d Merge branch 'next-minor' into develop 2018-03-07 00:39:52 +01:00
Benjamin Neff
e7c6496a09 Merge pull request #7730 from Fensterbank/fix-profile-picture-csp
Allow blob: URIs to be used as a content source in CSP header
2018-03-04 01:49:09 +01:00
Frédéric Bolvin
23e4062342 Allow blob: URIs to be used as a content source in CSP header 2018-03-03 21:12:18 +01:00
Dennis Schubert
c4839613ea Merge branch 'next-minor' into develop 2018-02-27 00:48:47 +01:00
Dennis Schubert
f1d71eb592 Merge branch 'next-minor' into develop 2018-02-27 00:47:37 +01:00
Benjamin Neff
198dddd69e Merge branch 'next-minor' into develop 2018-02-25 23:03:17 +01:00
Dennis Schubert
ab903af80b Merge branch 'next-minor' into develop 2018-02-25 04:35:53 +01:00
Dennis Schubert
5d23c6bfcf Merge branch 'next-minor' into develop 2018-02-25 04:34:08 +01:00
Dennis Schubert
3bc0fc16a2 Merge branch 'next-minor' into develop 2018-02-25 04:33:07 +01:00
Dennis Schubert
1903bfd307 Merge pull request #7581 from Fensterbank/improved-profile-picture-editor
Profile photo upload with cropping function
2018-02-25 04:17:44 +01:00
Benjamin Neff
0cb2a8f4d7 Merge branch 'next-minor' into develop 2018-02-22 00:49:32 +01:00
Benjamin Neff
0b921c6657 Merge branch 'next-minor' into develop 2018-02-17 19:26:15 +01:00
Frédéric Bolvin
d7abaaced0 implemented new profile photo upload with cropping function 2018-02-16 19:43:32 +01:00
Dennis Schubert
049db8626d Merge branch 'next-minor' into develop 2018-02-10 16:13:44 +01:00
Dennis Schubert
948e31b10c Merge branch 'next-minor' into develop 2018-02-09 03:15:38 +01:00
Benjamin Neff
e9e08831e6 Merge branch 'next-minor' into develop 2018-02-08 23:20:12 +01:00
Benjamin Neff
fc2397c062 Merge branch 'next-minor' into develop 2018-02-08 22:55:43 +01:00
Dennis Schubert
ea606b374a Merge branch 'next-minor' into develop 2018-02-03 16:43:30 +01:00
Dennis Schubert
3121de7954 Merge branch 'next-minor' into develop 2018-02-01 23:49:55 +01:00
Dennis Schubert
f6e359a669 Merge branch 'next-minor' into develop 2018-02-01 23:42:04 +01:00
Benjamin Neff
750481497f Merge branch 'next-minor' into develop 2018-01-31 22:17:07 +01:00
Benjamin Neff
1d683295e1 Merge branch 'next-minor' into develop 2018-01-21 21:30:59 +01:00
Dennis Schubert
9ec07911de Merge branch 'next-minor' into develop 2018-01-12 17:56:17 +01:00
Benjamin Neff
b3d3445a7e Merge branch 'next-minor' into develop 2018-01-09 00:06:44 +01:00
Dennis Schubert
13d24cc611 Merge branch 'next-minor' into develop 2018-01-08 21:15:49 +01:00
Benjamin Neff
e059b8ad48 Merge branch 'next-minor' into develop 2018-01-05 03:46:06 +01:00
Benjamin Neff
d3632e116a Merge branch 'next-minor' into develop 2018-01-05 01:50:27 +01:00
Benjamin Neff
a2ca74265c Merge branch 'next-minor' into develop 2017-12-30 15:41:04 +01:00
Benjamin Neff
03ee954c10 Merge branch 'next-minor' into develop 2017-12-26 03:38:10 +01:00
Benjamin Neff
151a169791 Merge branch 'next-minor' into develop 2017-12-25 20:55:27 +01:00
Benjamin Neff
fb084e47af Merge branch 'next-minor' into develop 2017-12-24 02:50:36 +01:00
Benjamin Neff
c3c0059734 Merge branch 'next-minor' into develop 2017-12-18 04:57:11 +01:00
Benjamin Neff
d42801a737 Merge branch 'next-minor' into develop 2017-12-18 04:41:49 +01:00
Jonne Haß
c8d1043590 add carrierwave error messages 2017-12-03 14:53:44 +01:00
Benjamin Neff
21980681b1 Merge branch 'next-minor' into develop 2017-11-01 00:50:23 +01:00
Benjamin Neff
6351399197 Merge branch 'next-minor' into develop 2017-10-27 02:27:11 +02:00
Benjamin Neff
42a8129016 Merge branch 'next-minor' into develop 2017-10-21 00:46:22 +02:00
Benjamin Neff
30a940f483 Merge branch 'next-minor' into develop 2017-10-20 02:56:20 +02:00
Benjamin Neff
cae06d95ea Merge branch 'next-minor' into develop 2017-10-20 01:25:37 +02:00
Benjamin Neff
66095e3f03 Merge branch 'next-minor' into develop 2017-10-18 01:08:48 +02:00
Benjamin Neff
d6bec055e7 Merge branch 'next-minor' into develop 2017-10-17 01:39:46 +02:00
Benjamin Neff
4bbb25fedf Merge branch 'next-minor' into develop 2017-09-28 23:39:56 +02:00
Benjamin Neff
0029f2c1da Merge branch 'next-minor' into develop 2017-09-28 23:11:56 +02:00
Benjamin Neff
829882cf58 Merge branch 'next-minor' into develop 2017-09-28 03:28:30 +02:00
Benjamin Neff
760b928902 Merge branch 'next-minor' into develop 2017-09-26 04:07:43 +02:00
Benjamin Neff
d410b62323 Merge branch 'next-minor' into develop 2017-09-19 20:28:36 +02:00
Benjamin Neff
9f18d5ba82 Merge branch 'next-minor' into develop 2017-09-18 03:25:02 +02:00
Benjamin Neff
26a9e50ef9 Merge branch 'next-minor' into develop 2017-09-17 19:36:00 +02:00
Steffen van Bergerem
c9ba7f697b Merge branch 'next-minor' into develop 2017-09-04 02:49:22 +02:00
Benjamin Neff
c1022ef8ad Merge branch 'next-minor' into develop 2017-09-03 23:53:33 +02:00
Benjamin Neff
94e904464f Merge branch 'next-minor' into develop 2017-08-31 02:45:22 +02:00
Steffen van Bergerem
f9029dbdaf Merge branch 'next-minor' into develop 2017-08-29 12:55:17 +02:00
Benjamin Neff
295bb15f73 Merge branch 'next-minor' into develop 2017-08-29 02:17:47 +02:00
Benjamin Neff
e7a1fe6e78 Merge branch 'next-minor' into develop 2017-08-26 03:16:23 +02:00
Steffen van Bergerem
95ac7d0123 Merge branch 'next-minor' into develop 2017-08-25 01:51:47 +02:00
Steffen van Bergerem
974fbd4d03 Merge branch 'next-minor' into develop 2017-08-24 14:57:59 +02:00
Steffen van Bergerem
2ffdbc4b05 Merge branch 'next-minor' into develop 2017-08-23 21:55:59 +02:00
Steffen van Bergerem
e39df04dc4 Merge branch 'next-minor' into develop 2017-08-23 21:50:41 +02:00
Benjamin Neff
697d626269 Merge branch 'next-minor' into develop 2017-08-19 22:41:27 +02:00
Benjamin Neff
f5fc142f63 Merge branch 'next-minor' into develop 2017-08-19 18:26:14 +02:00
Benjamin Neff
8d5d09521a Merge branch 'next-minor' into develop 2017-08-19 15:04:14 +02:00
Steffen van Bergerem
680894d121 Merge branch 'next-minor' into develop 2017-08-19 12:39:42 +02:00
Steffen van Bergerem
9ffbf2f788 Merge branch 'next-minor' into develop 2017-08-19 12:31:31 +02:00
Benjamin Neff
eb70d24dfa Merge branch 'next-minor' into develop 2017-08-19 07:39:59 +02:00
Benjamin Neff
0ae9dbf77f Merge branch 'next-minor' into develop 2017-08-17 11:42:15 +02:00
Benjamin Neff
6569bbaf1f Merge branch 'next-minor' into develop 2017-08-17 03:36:46 +02:00
Benjamin Neff
3b6a98b7b4 Merge branch 'next-minor' into develop 2017-08-17 00:51:22 +02:00
Dennis Schubert
19a967328d Merge pull request #7544 from svbergerem/gender-neutral-comments-specs
Use gender-neutral forms in comments and specs
2017-08-16 23:56:34 +02:00
Steffen van Bergerem
68145723bb Use gender-neutral forms in comments and specs 2017-08-16 23:23:34 +02:00
Benjamin Neff
db14b58eeb Merge branch 'next-minor' into develop 2017-08-16 20:42:30 +02:00
Benjamin Neff
11372035b8 Start 0.8.0.0 cycle 2017-08-15 01:49:51 +02:00
877 changed files with 96685 additions and 81942 deletions

View File

@@ -2,7 +2,8 @@
"env": {
"browser": true,
"jasmine": true,
"jquery": true
"jquery": true,
"es6": true
},
"globals": {
@@ -15,7 +16,6 @@
"Handlebars": false,
"HandlebarsTemplates": false,
"ImagePaths": false,
"jsxc": false,
"L": false,
"OSM": false,
"PerfectScrollbar": false,
@@ -97,7 +97,7 @@
"no-catch-shadow": 0,
"no-class-assign": 2,
"no-cond-assign": 2,
"no-confusing-arrow": 2,
"no-confusing-arrow": [2, {"allowParens": true}],
"no-console": 2,
"no-const-assign": 2,
"no-constant-condition": 2,

View File

@@ -15,8 +15,8 @@ jobs:
fail-fast: false
matrix:
ruby:
- 2.7
- 2.6
- '3.2'
- '3.3'
db:
- mysql
- postgresql
@@ -44,11 +44,11 @@ jobs:
- 5432:5432
steps:
- name: Install system dependencies
run: sudo apt update && sudo apt install -y build-essential curl git gsfonts imagemagick libcurl4-openssl-dev libidn11-dev libmagickwand-dev libssl-dev libxml2-dev libxslt1-dev
run: sudo apt update && sudo apt install -y build-essential curl git gsfonts imagemagick libcurl4-openssl-dev libidn11-dev libmagickwand-dev libssl-dev libxml2-dev libxslt1-dev yarnpkg
- name: Start MySQL
run: sudo systemctl start mysql.service
if: matrix.db == 'mysql'
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

62
.github/workflows/lint.yml vendored Normal file
View File

@@ -0,0 +1,62 @@
## SECURITY WARNING:
##
## Do not change this job unless you know what you're doing.
##
## This GitHub Action runs on: pull_request_target, which means the jobs run in
## a context where they have access to a Access Token with write access to the
## target repo, even if the PR is opened from an external contributor from their
## fork.
##
## This means that if we're not careful, we could be running third-party code
## within an authenticated scope, which isn't good. To mitigate this, this
## implementation does:
##
## 1. checkout the target branch (i.e. the project's original sources)
## 2. install the Gems from there, and install them into a directory that's
## outside the repository contents.
## 3. checkout the PRs HEAD
## 4. restore a bunch of files that would allow code execution from the
## project's upstream sources, namely:
## - bin/bundle - we'll run that in our Job
## - Gemfile/Gemfile.lock - to avoid loading a gem with an identical
## version number from a in-repo vendored directory
name: Lint
on:
pull_request_target:
permissions:
contents: read
statuses: write
pull-requests: write
jobs:
pronto:
runs-on: ubuntu-latest
steps:
- name: Install system dependencies
run: sudo apt update && sudo apt install -y build-essential curl git gsfonts imagemagick libcurl4-openssl-dev libidn11-dev libmagickwand-dev libssl-dev libxml2-dev libxslt1-dev yarnpkg
- name: Checkout Target branch
uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1"
bundler-cache: true
- name: Checkout PR HEAD
run: |
git fetch -q origin +refs/pull/${{ github.event.pull_request.number }}/head:
git checkout -qf FETCH_HEAD
- name: Restore the bundle binstub and Gemfiles from the target branch
run: |
git restore -s ${{ github.base_ref }} -- bin/bundle
git restore -s ${{ github.base_ref }} -- Gemfile
git restore -s ${{ github.base_ref }} -- Gemfile.lock
- name: Run Pronto
run: bin/bundle exec pronto run -f github_status github_pr_review -c ${{ github.base_ref }}
env:
PRONTO_PULL_REQUEST_ID: ${{ github.event.pull_request.number }}
PRONTO_GITHUB_ACCESS_TOKEN: ${{ github.token }}

5
.gitignore vendored
View File

@@ -1,8 +1,3 @@
# XMPP certificates, keys and user data
config/certs/*.crt
config/certs/*.key
config/prosody.cfg.lua
# Trademark sillyness
app/views/home/_show.*
app/views/terms/terms.*

View File

@@ -1,7 +1,7 @@
require: rubocop-rails
AllCops:
TargetRubyVersion: 2.6
TargetRubyVersion: 3.0
NewCops: enable
Exclude:
- "bin/**/*"
@@ -39,7 +39,7 @@ Metrics/PerceivedComplexity:
# Some blocks are longer.
Metrics/BlockLength:
ExcludedMethods:
AllowedMethods:
- "namespace"
- "create_table"
Exclude:
@@ -73,6 +73,11 @@ Layout/HashAlignment:
EnforcedHashRocketStyle: table
EnforcedColonStyle: table
# This rule makes haml files less readable, as there is no 'end' there.
Layout/CaseIndentation:
Exclude:
- "app/views/**/*"
# Mixing the styles looks just silly.
Style/HashSyntax:
EnforcedStyle: ruby19_no_mixed_keys
@@ -168,6 +173,11 @@ Style/Documentation:
Naming/BinaryOperatorParameterName:
Enabled: false
# Defining constants in tests is fine, and it's good to have them close to the test where they are used.
Lint/ConstantDefinitionInBlock:
Exclude:
- "spec/**/*"
# There are valid cases, for example debugging Cucumber steps,
# also they'll fail CI anyway
Lint/Debugger:

View File

@@ -1 +1 @@
2.7
3.3

View File

@@ -70,7 +70,7 @@ linters:
enabled: true
IdSelector:
enabled: true
enabled: false
ImportantRule:
enabled: true

View File

@@ -1,3 +1,131 @@
# 1.0.0 (unreleased)
## Refactor
## Bug fixes
## Features
# 0.9.1.0 (unreleased)
## Refactor
* Improved compatibility with non-specification-compliant OpenGraph metadata [#8465](https://github.com/diaspora/diaspora/pull/8465)
## Bug fixes
* Fix processing for a specific set of uploaded images, like scenes full of snow, by allowing for a larger on-disk cache for ImageMagick [#8460](https://github.com/diaspora/diaspora/pull/8460)
* Fix a bug with parsing certain OpenGraph metadata structures [#8463](https://github.com/diaspora/diaspora/pull/8463)
## Features
* For admins, the offending content's author is now visible in the reports overview [#8464](https://github.com/diaspora/diaspora/pull/8464)
# 0.9.0.0
## New configuration file!
Diaspora\* now uses TOML for the configuration file. We recommend you to migrate to this new format, as with the next major release (1.0) diaspora\* will no longer read the YAML based configuration file at `config/diaspora.yml`. To do so, please copy `config/diaspora.toml.example` to `config/diaspora.toml` and migrate your configuration.
## API!
With the release of diaspora\* Version 0.9, we now officially support building applications on top of the diaspora\* API! Please check out [the official API documentation](https://diaspora.github.io/api-documentation/) for instructions, and please do file bugs if you notice something that could be improved!
We are looking forward to seeing many creative applications!
## The chat integration has been removed
After [a discussion with our community on Discourse](https://discourse.diasporafoundation.org/t/2718), we decided to remove the pieces of XMPP chat integration that were put in place a while ago. When we first added the chat support, we merged the implementation in an unfinished state in the hopes that the open issues will be addressed eventually, and the implementation would end up more polished. This ended up not being the case. After careful consideration and discussion, we did not manage to come up with clear reasons why we need a chat implementation, so we decided that the best way forward would be to remove it.
Although the chat was never enabled per default and was marked as experimental, some production pods did set up the integration and offered an XMPP service to their users. After this release, diaspora\* will no longer contain a chat applet, so users will no longer be able to use the webchat inside diaspora\*. The existing module that is used to enable users to authenticate to Prosody using their diaspora\* credentials will continue to work, but contact list synchronization might not work without further changes to the Prosody module, which is developed independently from this project.
## Changes around the appserver and related configuration
With this release, we switched from `unicorn` to `puma` to run our applications. For podmins running the default setup, this should significantly reduce memory usage, with similar or even better frontend performance! However, as great as this change is, some configuration changes are required.
- The `single_process_mode` and `embed_sidekiq_worker` configurations have been removed. This mode was never truly a "single-process" mode, as it just spawned the Background Workers inside the runserver. If you're using `script/server` to start your pod, this change does not impact you, but if you're running diaspora\* using other means, and you relied on this "single"-process mode, please ensure that Sidekiq workers get started.
- The format of the `listen` configuration has changed. If you have not set that field in your configuration, you can skip this. Otherwise, make sure to adjust your configuration accordingly:
- Listening to Unix sockets with a relative path has changed from `unix:tmp/diaspora.sock` into `unix://tmp/diaspora.sock`.
- Listening to Unix sockets with an absolute path has changed from `unix:/run/diaspora/diaspora.sock` to `unix:///run/diaspora/diaspora.sock`.
- Listening to a local port has changed from `127.0.0.1:3000` to `tcp://127.0.0.1:3000`.
- The `PORT` environment variable and the `-p` parameter to `script/server` have been removed. If you used that to run diaspora\* on a non-standard port, please use the `listen` configuration.
- The `unicorn_worker` configuration has been dropped. With Puma, there should not be a need to increase the number of workers above a single worker in any pod of any size.
- The `unicorn_timeout` configuration has been renamed to `web_timeout`.
- **If you don't run your pod with `script/server`**, you have to update your setup. If you previously called `bin/bundle exec unicorn -c config/unicorn.rb` to run diaspora\*, you now have to run `bin/puma -C config/puma.rb`! Please update your systemd-Units or similar accordingly.
## Yarn for frontend dependencies
We use yarn to install the frontend dependencies now, so you need to have that installed. See here for how to install it: https://yarnpkg.com/en/docs/install
## Suggested Ruby version: 3.3
We recommend setting up new pods using Ruby 3.3, and updating existing pods to this version as well. Ruby 2.7 is EOL and no longer supported.
## Changes to script/server for production pods
If you're currently running your production pod with `./script/server` in a tmux or something similar, please be careful. We made some internal changes that result in the script no longer automatically restarting the server if it crashes - instead, it will just shut down. We strongly recommend running your pod using your system's unit manager, for example with [this systemd unit](https://wiki.diasporafoundation.org/Automatic_startup_methods#Recommended:_systemd).
## Security
* Fix a potential 2FA brute force attack ([CVE-2024-0227](https://github.com/devise-two-factor/devise-two-factor/security/advisories/GHSA-chcr-x7hc-8fp8)).
Thanks to Christian Reitter ([Radically Open Security](https://www.radicallyopensecurity.com/)) and Chris MacNaughton ([Centauri Solutions](https://centauri.solutions)).
## Refactor
* Add bootstrapping for using ECMAScript 6 with automatic transpiling for compatibility [#7581](https://github.com/diaspora/diaspora/pull/7581) [#8397](https://github.com/diaspora/diaspora/pull/8397)
* Remove backporting of mention syntax [#7788](https://github.com/diaspora/diaspora/pull/7788)
* Enable Content-Security-Policy header by default [#7781](https://github.com/diaspora/diaspora/pull/7781)
* Do not show getting started after account import [#8036](https://github.com/diaspora/diaspora/pull/8036)
* Remove the JSXC/Prosody integration [#8069](https://github.com/diaspora/diaspora/pull/8069) [#8341](https://github.com/diaspora/diaspora/pull/8341)
* Replace `factory_girl` with `factory_bot` [#8218](https://github.com/diaspora/diaspora/pull/8218)
* Drop relay support [#8243](https://github.com/diaspora/diaspora/pull/8243)
* Use yarn to manage the frontend dependencies [#8364](https://github.com/diaspora/diaspora/pull/8364)
* Upgrade to latest `diaspora_federation`, remove support for old federation protocol [#8368](https://github.com/diaspora/diaspora/pull/8368)
* Remove support for `therubyracer` [#8337](https://github.com/diaspora/diaspora/issues/8337)
* Replace `unicorn` with `puma` [#8392](https://github.com/diaspora/diaspora/pull/8392)
* Drop `strip_exif` flag and always remove exif data from uploaded images [#8417](https://github.com/diaspora/diaspora/pull/8417)
* Replace `apparition` with `cuprite` [#8418](https://github.com/diaspora/diaspora/pull/8418)
* Remove `i18n-inflector-rails` for translations [#8420](https://github.com/diaspora/diaspora/pull/8420)
* Add ruby 3 support [#8423](https://github.com/diaspora/diaspora/pull/8423) [#8426](https://github.com/diaspora/diaspora/pull/8426) [#8427](https://github.com/diaspora/diaspora/pull/8427) [#8448](https://github.com/diaspora/diaspora/pull/8448)
* Add CORS headers to nodeinfo endpoints to allow for client-side fetching [#8436](https://github.com/diaspora/diaspora/pull/8436)
* Replace eye with foreman [#8449](https://github.com/diaspora/diaspora/pull/8449)
## Bug fixes
* Fix multiple photos upload progress bar [#7655](https://github.com/diaspora/diaspora/pull/7655)
* Photo-upload file picker now correctly restricts possible file types [#8205](https://github.com/diaspora/diaspora/pull/8205)
* Make inline code inside links show the link color [#8387](https://github.com/diaspora/diaspora/pull/8387)
* Fix fetching public posts on first account search was missing some data [#8390](https://github.com/diaspora/diaspora/pull/8390)
* Add redirect from mobile UI photo URLs to post when not using mobile UI [#8400](https://github.com/diaspora/diaspora/pull/8400)
* Escape mentions before markdown parsing in mobile UI [#8398](https://github.com/diaspora/diaspora/pull/8398)
* Cleanup duplicate pods in database [#8403](https://github.com/diaspora/diaspora/pull/8403)
* Fix scrolling issue after closing photo viewer on photos page [#8404](https://github.com/diaspora/diaspora/pull/8404)
* Filter unicode emojis from email headers [#8421](https://github.com/diaspora/diaspora/pull/8421)
* Do not show disabled services anymore [#8406](https://github.com/diaspora/diaspora/pull/8406)
* Update search endpoint to be aware of ignored users [#8363](https://github.com/diaspora/diaspora/pull/8363)
## Features
* Add client-side cropping of profile image uploads [#7581](https://github.com/diaspora/diaspora/pull/7581)
* Add client-site rescaling of post images if they exceed the maximum possible size [#7734](https://github.com/diaspora/diaspora/pull/7734)
* Add backend for archive import [#7660](https://github.com/diaspora/diaspora/pull/7660) [#8254](https://github.com/diaspora/diaspora/pull/8254) [#8264](https://github.com/diaspora/diaspora/pull/8264) [#8010](https://github.com/diaspora/diaspora/pull/8010) [#8260](https://github.com/diaspora/diaspora/pull/8260) [#8302](https://github.com/diaspora/diaspora/pull/8302) [#8298](https://github.com/diaspora/diaspora/pull/8298)
* For pods running PostgreSQL, make sure that no upper-case/mixed-case tags exist, and create a `lower(name)` index on tags to speed up ActsAsTaggableOn [#8206](https://github.com/diaspora/diaspora/pull/8206)
* Allow podmins/moderators to see all local public posts to improve moderation [#8232](https://github.com/diaspora/diaspora/pull/8232) [#8320](https://github.com/diaspora/diaspora/pull/8320)
* Add support for directly paste images to upload them [#8237](https://github.com/diaspora/diaspora/pull/8237)
* Add support for webp images and convert new png/jpg to webp to save space and bandwidth [#8358](https://github.com/diaspora/diaspora/pull/8358)
* Show total and active pods count in the pods list for podmins [#8383](https://github.com/diaspora/diaspora/pull/8383)
* Allow to select multiple aspects when posting on mobile [#8217](https://github.com/diaspora/diaspora/pull/8217)
* Add info links to drawer in mobile UI [#8405](https://github.com/diaspora/diaspora/pull/8405)
* Tell users that there is no help in mobile version, allow to switch to desktop [#8407](https://github.com/diaspora/diaspora/pull/8407)
* Add Smart App Banner on iOS devices [#8409](https://github.com/diaspora/diaspora/pull/8409)
* Add a more detailed modal when reporting a post or a comment [#8035](https://github.com/diaspora/diaspora/pull/8035)
* Re-introduce likes on comments [#8203](https://github.com/diaspora/diaspora/pull/8203) [#8439](https://github.com/diaspora/diaspora/pull/8439) [#8442](https://github.com/diaspora/diaspora/pull/8442)
* New redesigned registration page [#8285](https://github.com/diaspora/diaspora/pull/8285)
* Allow comments to be fetched [#8441](https://github.com/diaspora/diaspora/pull/8441)
# 0.7.18.2
To avoid potential security issues, diaspora\* now makes sure that ImageMagick image processing always runs with a restricted `policy.xml`, regardless of the global system settings.
# 0.7.18.1
## Bug fixes
* Update binstubs to fix diaspora\* being unable to start when multiple bundler versions were available [#8392](https://github.com/diaspora/diaspora/pull/8392/commits/bfd42a1914a99ac9c71ecb16bbf6fa5bb118148a)
# 0.7.18.0
## Refactor
@@ -69,7 +197,7 @@
* Testing: Replaced phantomjs with headless Chrome/Chromium [#8234](https://github.com/diaspora/diaspora/pull/8234)
## Bug fixes
* Update comment counter when weleting a comment in the Single Post View [#7938](https://github.com/diaspora/diaspora/pull/7938)
* Update comment counter when deleting a comment in the Single Post View [#7938](https://github.com/diaspora/diaspora/pull/7938)
* Link diaspora only poduptime list [#8174](https://github.com/diaspora/diaspora/pull/8174)
* Delete a user's invitation code during account deletion [#8202](https://github.com/diaspora/diaspora/pull/8202)
* Bump mimemagic [#8231](https://github.com/diaspora/diaspora/pull/8231)

View File

@@ -1,6 +0,0 @@
web1: env RAILS_ENV=integration1 bundle exec rails s -p 3001
worker1: env RAILS_ENV=integration1 VVERBOSE=1 QUEUE=* bundle exec rake resque:work
redis1: env RAILS_ENV=integration1 redis-server ./redis-integration1.conf
web2: env RAILS_ENV=integration2 bundle exec rails s -p 3002
worker2: env RAILS_ENV=integration2 VVERBOSE=1 QUEUE=* bundle exec rake resque:work
redis2: env RAILS_ENV=integration2 redis-server ./redis-integration2.conf

197
Gemfile
View File

@@ -2,34 +2,39 @@
source "https://rubygems.org"
gem "rails", "6.1.6.1"
gem "rails", "6.1.7.8"
# needed for actionmailer, can be removed when upgrading to rails 7
gem "net-imap", require: false
gem "net-pop", require: false
gem "net-smtp", require: false
# Legacy Rails features, remove me!
# responders (class level)
gem "responders", "3.0.1"
gem "responders", "3.1.1"
# Appserver
gem "unicorn", "6.1.0", require: false
gem "unicorn-worker-killer", "0.4.5"
gem "puma", "6.4.2", require: false
# Federation
gem "diaspora_federation-json_schema", "0.2.8"
gem "diaspora_federation-rails", "0.2.8"
gem "diaspora_federation-json_schema", "1.1.0"
gem "diaspora_federation-rails", "1.1.0"
# API and JSON
gem "acts_as_api", "1.0.1"
gem "json", "2.6.2"
gem "json-schema", "3.0.0"
gem "json", "2.7.2"
gem "json-schema", "4.3.0"
gem "yajl-ruby", "1.4.3"
# Authentication
gem "devise", "4.8.1"
gem "devise", "4.9.4"
gem "devise_lastseenable", "0.0.6"
gem "devise-two-factor", "4.0.2"
gem "rqrcode", "2.1.1"
gem "devise-two-factor", "4.1.0"
gem "rqrcode", "2.2.0"
# Captcha
@@ -37,29 +42,29 @@ gem "simple_captcha2", "0.5.0", require: "simple_captcha"
# Background processing
gem "redis", "4.7.0"
gem "sidekiq", "6.5.1"
gem "redis", "4.8.1"
gem "sidekiq", "6.5.12"
# Scheduled processing
gem "sidekiq-cron", "1.6.0"
gem "sidekiq-cron", "1.12.0"
# Compression
gem "terser", "1.1.10"
gem "terser", "1.2.2"
# Configuration
gem "configurate", "0.5.0"
gem "toml-rb", "2.1.2"
gem "configurate", "0.6.0"
gem "toml-rb", "3.0.1"
# Cross-origin resource sharing
gem "rack-cors", "1.1.1", require: "rack/cors"
gem "rack-cors", "2.0.2", require: "rack/cors"
# CSS
gem "autoprefixer-rails", "10.4.7.0"
gem "autoprefixer-rails", "10.4.16.0"
gem "bootstrap-sass", "3.4.1"
gem "bootstrap-switch-rails", "3.3.3" # 3.3.4 and 3.3.5 is broken, see https://github.com/Bttstrp/bootstrap-switch/issues/691
gem "sassc-rails", "2.1.2"
@@ -68,78 +73,51 @@ gem "sprockets-rails", "3.4.2"
# Database
group :mysql, optional: true do
gem "mysql2", "0.5.4"
gem "mysql2", "0.5.6"
end
group :postgresql, optional: true do
gem "pg", "1.4.1"
gem "pg", "1.5.6"
end
gem "activerecord-import", "1.4.0"
gem "activerecord-import", "1.7.0"
# File uploading
gem "carrierwave", "2.2.2"
gem "fog-aws", "3.14.0"
gem "mini_magick", "4.11.0"
gem "carrierwave", "3.0.7"
gem "fog-aws", "3.22.0"
gem "mini_magick", "4.12.0"
# GUID generation
gem "uuid", "2.3.9"
# JavaScript
gem "babel-transpiler", "0.7.0"
gem "handlebars_assets", "0.23.9"
gem "jquery-rails", "4.5.0"
gem "jquery-rails", "4.6.0"
gem "jquery-ui-rails", "7.0.0"
gem "js_image_paths", "0.2.0"
gem "js-routes", "2.2.4"
source "https://gems.diasporafoundation.org" do
gem "rails-assets-jquery", "3.6.0" # Should be kept in sync with jquery-rails
gem "rails-assets-jquery.ui", "1.11.4"
gem "rails-assets-highlightjs", "9.12.0"
gem "rails-assets-markdown-it", "8.4.2"
gem "rails-assets-markdown-it-diaspora-mention", "1.2.0"
gem "rails-assets-markdown-it-footnote", "3.0.3"
gem "rails-assets-markdown-it-hashtag", "0.4.0"
gem "rails-assets-markdown-it--markdown-it-for-inline", "0.1.1"
gem "rails-assets-markdown-it-sanitizer", "0.4.3"
gem "rails-assets-markdown-it-sub", "1.0.0"
gem "rails-assets-markdown-it-sup", "1.0.0"
gem "rails-assets-backbone", "1.3.3"
gem "rails-assets-bootstrap", "3.4.1"
gem "rails-assets-bootstrap-markdown", "2.10.0"
gem "rails-assets-corejs-typeahead", "1.2.1"
gem "rails-assets-fine-uploader", "5.13.0"
# jQuery plugins
gem "rails-assets-autosize", "4.0.2"
gem "rails-assets-blueimp-gallery", "2.33.0"
gem "rails-assets-jquery.are-you-sure", "1.9.0"
gem "rails-assets-jquery-placeholder", "2.3.1"
gem "rails-assets-jquery-textchange", "0.2.3"
gem "rails-assets-utatti-perfect-scrollbar", "1.4.0"
end
gem "markdown-it-html5-embed", "1.0.0"
gem "js-routes", "2.2.8"
# Localization
gem "http_accept_language", "2.1.1"
gem "i18n-inflector-rails", "1.0.7"
gem "rails-i18n", "6.0.0"
gem "rails-i18n", "7.0.9"
# Map
gem "leaflet-rails", "1.7.0"
gem "leaflet-rails", "1.9.4"
# Parsing
gem "nokogiri", "1.13.7"
gem "open_graph_reader", "0.7.2" # also update User-Agent in features/support/webmock.rb and open_graph_cache_spec.rb
gem "redcarpet", "3.5.1"
gem "ruby-oembed", "0.16.1"
gem "twitter-text", "1.14.7"
gem "nokogiri", "1.16.5"
gem "open_graph_reader", "0.9.1" # also update User-Agent in features/support/webmock.rb and open_graph_cache_spec.rb
gem "redcarpet", "3.6.0"
gem "ruby-oembed", "0.17.0"
gem "twitter-text", "3.1.0"
# Rate limitting
gem "rack-attack", "6.7.0"
# RTL support
@@ -147,47 +125,44 @@ gem "string-direction", "1.2.2"
# Security Headers
gem "secure_headers", "6.3.3"
gem "secure_headers", "6.5.0"
# Services
gem "omniauth", "2.1.0"
gem "omniauth-rails_csrf_protection", "1.0.1"
gem "omniauth", "2.1.2"
gem "omniauth-rails_csrf_protection", "1.0.2"
gem "omniauth-tumblr", "1.2"
gem "omniauth-twitter", "1.4.0"
gem "omniauth-wordpress", "0.2.2"
gem "twitter", "7.0.0"
gem "twitter", "8.0.0"
# OpenID Connect
gem "openid_connect", "1.3.0"
gem "openid_connect", "2.3.0"
# Serializers
gem "active_model_serializers", "0.9.8"
# XMPP chat dependencies
gem "diaspora-prosody-config", "0.0.7"
gem "rails-assets-diaspora_jsxc", "0.1.5.develop.7", source: "https://gems.diasporafoundation.org"
gem "active_model_serializers", "0.9.12"
# Tags
gem "acts-as-taggable-on", "9.0.1"
gem "acts-as-taggable-on", "10.0.0"
# URIs and HTTP
gem "addressable", "2.8.0", require: "addressable/uri"
gem "faraday", "0.17.5"
gem "faraday-cookie_jar", "0.0.7"
gem "faraday_middleware", "0.14.0"
gem "typhoeus", "1.4.0"
gem "addressable", "2.8.6", require: "addressable/uri"
gem "faraday", "2.9.0"
gem "faraday-cookie_jar", "0.0.7"
gem "faraday-follow_redirects", "0.3.0"
gem "faraday-typhoeus", "1.1.0", require: false
gem "typhoeus", "1.4.1"
# Views
gem "gon", "6.4.0"
gem "hamlit", "2.16.0"
gem "hamlit", "3.0.3"
gem "mobile-fu", "1.4.0"
gem "rails-timeago", "2.20.0"
gem "will_paginate", "3.3.1"
gem "will_paginate", "4.0.0"
# Logging
@@ -202,17 +177,10 @@ gem "rubyzip", "2.3.2", require: "zip"
# https://github.com/gitlabhq/gitlabhq/issues/3826
# https://github.com/gitlabhq/gitlabhq/pull/3852
# https://github.com/discourse/discourse/pull/238
gem "minitest", "5.15.0"
gem "minitest", "5.23.1"
gem "versionist", "2.0.1"
# Windows and OSX have an execjs compatible runtime built-in, Linux users should
# install Node.js or use "therubyracer".
#
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem "therubyracer", :platform => :ruby
group :production do # we don"t install these on travis to speed up test runs
# Analytics
@@ -221,7 +189,7 @@ group :production do # we don"t install these on travis to speed up test runs
# Process management
gem "eye", "0.10.0"
gem "foreman", "0.88.1", require: false
# Redirects
@@ -230,30 +198,32 @@ group :production do # we don"t install these on travis to speed up test runs
# Third party asset hosting
gem "asset_sync", "2.15.2", require: false
gem "asset_sync", "2.19.1", require: false
end
group :development do
# Linters
gem "haml_lint", "0.40.0", require: false
gem "pronto", "0.11.0", require: false
gem "pronto-eslint", "0.11.0", require: false
gem "haml_lint", "0.58.0", require: false
gem "pronto", "0.11.2", require: false
gem "pronto-eslint", "0.11.1", require: false
gem "pronto-haml", "0.11.1", require: false
gem "pronto-rubocop", "0.11.1", require: false
gem "pronto-rubocop", "0.11.5", require: false
gem "pronto-scss", "0.11.0", require: false
gem "rubocop", "0.93.1", require: false
gem "rubocop-rails", "2.9.1", require: false
gem "rubocop", "1.64.0", require: false
gem "rubocop-rails", "2.25.0", require: false
gem "faraday-retry", require: false # used by pronto/octokit
# Debugging
gem "pry"
gem "pry-byebug"
# test coverage
gem "simplecov", "0.21.2", require: false
gem "simplecov", "0.22.0", require: false
gem "turbo_dev_assets", "0.0.2"
gem "listen", "3.7.1"
gem "listen", "3.9.0"
end
group :test do
@@ -265,34 +235,33 @@ group :test do
# Cucumber (integration tests)
gem "apparition", "0.6.0"
gem "capybara", "3.35.3"
gem "database_cleaner-active_record", "2.0.1"
gem "capybara", "3.40.0"
gem "cuprite", "0.15"
gem "database_cleaner-active_record", "2.1.0"
gem "cucumber-api-steps", "0.14", require: false
# General helpers
gem "factory_girl_rails", "4.9.0"
gem "shoulda-matchers", "4.5.1"
gem "timecop", "0.9.5"
gem "webmock", "3.14.0", require: false
gem "factory_bot_rails", "6.4.3"
gem "shoulda-matchers", "6.2.0"
gem "timecop", "0.9.8"
gem "webmock", "3.23.1", require: false
gem "diaspora_federation-test", "0.2.8"
gem "diaspora_federation-test", "1.1.0"
end
group :development, :test do
# RSpec (unit tests, some integration tests)
gem "rspec-rails", "5.1.2"
gem "rspec-rails", "6.1.2"
# Cucumber (integration tests)
gem "cucumber-rails", "2.5.1", require: false
gem "cucumber-rails", "3.0.0", require: false
# Jasmine (client side application tests (JS))
gem "chrome_remote", "0.3.0"
gem "jasmine", "3.10.0"
gem "jasmine-jquery-rails", "2.0.3"
gem "rails-assets-jasmine-ajax", "4.0.0", source: "https://gems.diasporafoundation.org"
gem "sinon-rails", "1.15.0"
# For `assigns` in controller specs

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1,2 @@
web: bin/bundle exec unicorn -c config/unicorn.rb -p $PORT
web: bin/puma -C config/puma.rb
sidekiq: bin/bundle exec sidekiq

View File

@@ -5,7 +5,6 @@
//= link contact-list.js
//= link jquery3.js
//= link jquery_ujs.js
//= link jsxc.js
//= link bookmarklet.js
//= link mobile/bookmarklet.js

View File

@@ -14,7 +14,7 @@
//= require_tree ./collections
//= require_tree ./views
//= require utatti-perfect-scrollbar/dist/perfect-scrollbar
//= require perfect-scrollbar/dist/perfect-scrollbar
var app = {
collections: {},

View File

@@ -12,12 +12,17 @@ app.collections.Comments = Backbone.Collection.extend({
make : function(text) {
var self = this;
var comment = new app.models.Comment({ "text": text });
var comment = new app.models.Comment({"text": text}, {post: this.post});
var deferred = comment.save({}, {
url: "/posts/"+ this.post.id +"/comments",
success: function() {
comment.set({author: app.currentUser.toJSON(), parent: self.post });
// Need interactions after make
comment.interactions = new app.models.LikeInteractions(
_.extend({comment: comment, post: self.post}, comment.get("interactions"))
);
self.add(comment);
}
});

View File

@@ -4,7 +4,11 @@ app.collections.Likes = Backbone.Collection.extend({
model: app.models.Like,
initialize : function(models, options) {
this.url = "/posts/" + options.post.id + "/likes"; //not delegating to post.url() because when it is in a stream collection it delegates to that url
// A comment- like has a post reference and a comment reference
this.url = (options.comment != null) ?
// not delegating to post.url() because when it is in a stream collection it delegates to that url
"/comments/" + options.comment.id + "/likes" :
"/posts/" + options.post.id + "/likes";
}
});
// @license-end

View File

@@ -1,6 +1,17 @@
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
app.models.Comment = Backbone.Model.extend({
urlRoot: "/comments"
urlRoot: "/comments",
initialize: function(model, options) {
options = options || {};
this.post = model.post || options.post || this.collection.post;
this.interactions = new app.models.LikeInteractions(
_.extend({comment: this, post: this.post}, this.get("interactions"))
);
this.likes = this.interactions.likes;
this.likesCount = this.attributes.likes_count;
this.userLike = this.interactions.userLike();
}
});
// @license-end

View File

@@ -0,0 +1,58 @@
// This class contains code extracted from interactions.js to factorize likes management between posts and comments
app.models.LikeInteractions = Backbone.Model.extend({
initialize: function(options) {
this.likes = new app.collections.Likes(this.get("likes"), options);
this.post = options.post;
},
likesCount: function() {
return this.get("likes_count");
},
userLike: function() {
return this.likes.select(function(like) {
return like.get("author") && like.get("author").guid === app.currentUser.get("guid");
})[0];
},
toggleLike: function() {
if (this.userLike()) {
this.unlike();
} else {
this.like();
}
},
like: function() {
var self = this;
this.likes.create({}, {
success: function() {
self.post.set({participation: true});
self.trigger("change");
self.set({"likes_count": self.get("likes_count") + 1});
self.likes.trigger("change");
},
error: function(model, response) {
app.flashMessages.handleAjaxError(response);
}
});
},
unlike: function() {
var self = this;
this.userLike().destroy({
success: function() {
// TODO: unlike always sets participation to false in the UI, even if there are more participations left
// in the backend (from manually participating, other likes or comments)
self.post.set({participation: false});
self.trigger("change");
self.set({"likes_count": self.get("likes_count") - 1});
self.likes.trigger("change");
},
error: function(model, response) {
app.flashMessages.handleAjaxError(response);
}});
}
});

View File

@@ -4,7 +4,7 @@ app.models.Post = Backbone.Model.extend(_.extend({}, app.models.formatDateMixin,
urlRoot : "/posts",
initialize : function() {
this.interactions = new app.models.Post.Interactions(_.extend({post : this}, this.get("interactions")));
this.interactions = new app.models.PostInteractions(_.extend({post: this}, this.get("interactions")));
this.delegateToInteractions();
},

View File

@@ -1,75 +1,27 @@
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
//require ../post
app.models.Post.Interactions = Backbone.Model.extend({
initialize : function(options){
app.models.PostInteractions = app.models.LikeInteractions.extend({
initialize: function(options) {
app.models.LikeInteractions.prototype.initialize.apply(this, arguments);
this.post = options.post;
this.comments = new app.collections.Comments(this.get("comments"), {post : this.post});
this.likes = new app.collections.Likes(this.get("likes"), {post : this.post});
this.reshares = new app.collections.Reshares(this.get("reshares"), {post : this.post});
this.comments = new app.collections.Comments(this.get("comments"), {post: this.post});
this.reshares = new app.collections.Reshares(this.get("reshares"), {post: this.post});
},
likesCount : function(){
return this.get("likes_count");
},
resharesCount : function(){
resharesCount: function() {
return this.get("reshares_count");
},
commentsCount : function(){
commentsCount: function() {
return this.get("comments_count");
},
userLike : function(){
return this.likes.select(function(like){
return like.get("author") && like.get("author").guid === app.currentUser.get("guid");
})[0];
},
userReshare : function(){
userReshare: function() {
return this.reshares.select(function(reshare){
return reshare.get("author") && reshare.get("author").guid === app.currentUser.get("guid");
})[0];
},
toggleLike : function() {
if(this.userLike()) {
this.unlike();
} else {
this.like();
}
},
like : function() {
var self = this;
this.likes.create({}, {
success: function() {
self.post.set({participation: true});
self.trigger("change");
self.set({"likes_count" : self.get("likes_count") + 1});
self.likes.trigger("change");
},
error: function(model, response) {
app.flashMessages.handleAjaxError(response);
}
});
},
unlike : function() {
var self = this;
this.userLike().destroy({success : function() {
self.post.set({participation: false});
self.trigger('change');
self.set({"likes_count" : self.get("likes_count") - 1});
self.likes.trigger("change");
},
error: function(model, response) {
app.flashMessages.handleAjaxError(response);
}});
},
comment: function(text, options) {
var self = this;
options = options || {};
@@ -109,7 +61,7 @@ app.models.Post.Interactions = Backbone.Model.extend({
});
},
userCanReshare : function(){
userCanReshare: function() {
var isReshare = this.post.get("post_type") === "Reshare"
, rootExists = (isReshare ? this.post.get("root") : true)
, publicPost = this.post.get("public")

View File

@@ -29,6 +29,25 @@ app.pages.AdminPods = app.views.Base.extend({
_showMessages: function() {
var msgs = document.createDocumentFragment();
if (gon.totalCount && gon.totalCount > 0) {
let totalPods = $("<div class='alert alert-info' role='alert' />")
.append(Diaspora.I18n.t("admin.pods.total", {count: gon.totalCount}));
if (gon.activeCount) {
if (gon.activeCount === 0) {
totalPods
.append(" " + Diaspora.I18n.t("admin.pods.none_active"));
}
if (gon.activeCount === gon.totalCount) {
totalPods
.append(" " + Diaspora.I18n.t("admin.pods.all_active"));
} else {
totalPods
.append(" " + Diaspora.I18n.t("admin.pods.active", {count: gon.activeCount}));
}
}
msgs.appendChild(totalPods[0]);
}
if( gon.uncheckedCount && gon.uncheckedCount > 0 ) {
var unchecked = $("<div class='alert alert-info' role='alert' />")
.append(Diaspora.I18n.t("admin.pods.unchecked", {count: gon.uncheckedCount}));

View File

@@ -5,14 +5,12 @@ app.pages.Contacts = Backbone.View.extend({
el: "#contacts_container",
events: {
"click #chat_privilege_toggle" : "toggleChatPrivilege",
"click #change_aspect_name" : "showAspectNameForm",
"click .conversation_button": "showMessageModal",
"click .invitations-button": "showInvitationsModal"
},
initialize: function(opts) {
this.chatToggle = $("#chat_privilege_toggle i");
this.stream = opts.stream;
this.stream.render();
$("#people-stream.contacts .header i").tooltip({"placement": "bottom"});
@@ -27,22 +25,6 @@ app.pages.Contacts = Backbone.View.extend({
this.setupAspectSorting();
},
toggleChatPrivilege: function() {
if (this.chatToggle.hasClass("enabled")) {
this.chatToggle.tooltip("destroy")
.removeClass("enabled")
.removeAttr("data-original-title")
.attr("title", Diaspora.I18n.t("contacts.aspect_chat_is_not_enabled"))
.tooltip({"placement": "bottom"});
} else {
this.chatToggle.tooltip("destroy")
.addClass("enabled")
.removeAttr("data-original-title")
.attr("title", Diaspora.I18n.t("contacts.aspect_chat_is_enabled"))
.tooltip({"placement": "bottom"});
}
},
showAspectNameForm: function() {
$(".header > h3").hide();
var aspectName = $.trim($(".header h3 #aspect_name").text());

View File

@@ -1,10 +0,0 @@
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
app.pages.Registration = Backbone.View.extend({
initialize: function() {
$("input#user_email").popover({
placement: "left",
trigger: "focus"
}).popover("show");
}
});
// @license-end

View File

@@ -24,6 +24,7 @@ app.Router = Backbone.Router.extend({
"posts/:id(/)": "singlePost",
"profile/edit(/)": "settings",
"public(/)": "stream",
"local_public(/)": "stream",
"stream(/)": "stream",
"tags/:name(/)": "followed_tags",
"u/:name(/)": "profile",
@@ -172,10 +173,6 @@ app.Router = Backbone.Router.extend({
});
},
registration: function() {
app.page = new app.pages.Registration();
},
settings: function() {
app.page = new app.pages.Settings();
},

View File

@@ -4,6 +4,7 @@ app.views.Base = Backbone.View.extend({
initialize : function() {
this.setupRenderEvents();
this.setupReport();
},
presenter : function(){
@@ -102,22 +103,25 @@ app.views.Base = Backbone.View.extend({
this.model.set(_.inject(this.formAttrs, _.bind(setValueFromField, this), {}));
},
report: function(evt) {
if(evt) { evt.preventDefault(); }
var msg = prompt(Diaspora.I18n.t('report.prompt'), Diaspora.I18n.t('report.prompt_default'));
if (msg == null) {
return;
setupReport: function() {
const reportForm = document.getElementById("report-content-form");
if (reportForm) {
reportForm.addEventListener("submit", this.onSubmitReport);
}
var data = {
report: {
item_id: this.model.id,
item_type: $(evt.currentTarget).data("type"),
text: msg
}
},
onSubmitReport: function(ev) {
if (ev) { ev.preventDefault(); }
const form = ev.currentTarget;
$("#reportModal").modal("hide");
const textarea = document.getElementById("report-reason-field");
const report = {
item_id: form.dataset.reportId,
item_type: form.dataset.reportType,
text: textarea.value
};
var report = new app.models.Report();
report.save(data, {
new app.models.Report().save({report: report}, {
success: function() {
app.flashMessages.success(Diaspora.I18n.t("report.status.created"));
},
@@ -127,11 +131,21 @@ app.views.Base = Backbone.View.extend({
});
},
report: function(evt) {
if (evt) { evt.preventDefault(); }
const form = document.getElementById("report-content-form");
form.dataset.reportId = this.model.id;
form.dataset.reportType = evt.currentTarget.dataset.type;
document.getElementById("report-reason-field").value = "";
document.getElementById("report-reason-field").focus();
$("#reportModal").modal();
},
destroyConfirmMsg: function() { return Diaspora.I18n.t("confirm_dialog"); },
destroyModel: function(evt) {
evt && evt.preventDefault();
var url = this.model.urlRoot + "/" + this.model.id;
const url = this.model.urlRoot + "/" + this.model.id;
if( confirm(_.result(this, "destroyConfirmMsg")) ) {
this.$el.addClass("deleting");

View File

@@ -27,16 +27,14 @@ app.views.AspectsDropdown = app.views.Base.extend({
},
// change class and text of the dropdown button
_updateButton: function(inAspectClass) {
var button = this.$('.btn.dropdown-toggle'),
_updateButton: function() {
let button = this.$(".btn.dropdown-toggle"),
selectedAspects = this.$(".dropdown-menu > li.selected").length,
buttonText;
if (selectedAspects === 0) {
button.removeClass(inAspectClass).addClass('btn-default');
buttonText = Diaspora.I18n.t("aspect_dropdown.select_aspects");
} else {
button.removeClass('btn-default').addClass(inAspectClass);
if (selectedAspects === 1) {
buttonText = this.$(".dropdown-menu > li.selected .text").first().text();
} else {

View File

@@ -6,35 +6,52 @@ app.views.Comment = app.views.Content.extend({
className : "comment media",
tooltipSelector: "time",
events : function() {
subviews: {
".likes-on-comment": "likesInfoView"
},
events: function() {
return _.extend({}, app.views.Content.prototype.events, {
"click .comment_delete": "destroyModel",
"click .comment_report": "report"
"click .comment_report": "report",
"click .like": "toggleLike"
});
},
initialize : function(options){
initialize: function(options) {
this.templateName = options.templateName || this.templateName;
this.model.interactions.on("change", this.render, this);
this.model.on("change", this.render, this);
},
presenter : function() {
presenter: function() {
return _.extend(this.defaultPresenter(), {
canRemove: this.canRemove(),
text: app.helpers.textFormatter(this.model.get("text"), this.model.get("mentioned_people"))
text: app.helpers.textFormatter(this.model.get("text"), this.model.get("mentioned_people")),
likesCount: this.model.attributes.likesCount,
userLike: this.model.interactions.userLike()
});
},
ownComment : function() {
ownComment: function() {
return app.currentUser.authenticated() && this.model.get("author").diaspora_id === app.currentUser.get("diaspora_id");
},
postOwner : function() {
postOwner: function() {
return app.currentUser.authenticated() && this.model.get("parent").author.diaspora_id === app.currentUser.get("diaspora_id");
},
canRemove : function() {
canRemove: function() {
return app.currentUser.authenticated() && (this.ownComment() || this.postOwner());
},
toggleLike: function(evt) {
if (evt) { evt.preventDefault(); }
this.model.interactions.toggleLike();
},
likesInfoView: function() {
return new app.views.LikesInfo({model: this.model});
}
});

View File

@@ -9,8 +9,7 @@ app.views.Help = app.views.StaticContentView.extend({
"click .faq-link-sharing": "sharing",
"click .faq-link-posts-and-posting": "postsAndPosting",
"click .faq-link-tags": "tags",
"click .faq-link-keyboard-shortcuts": "keyboardShortcuts",
"click .faq-link-chat": "chat"
"click .faq-link-keyboard-shortcuts": "keyboardShortcuts"
},
/* eslint-disable camelcase */
@@ -41,31 +40,22 @@ app.views.Help = app.views.StaticContentView.extend({
}
};
this.CHAT_SUBS = {
add_contact_roster_a: {
toggle_privilege: this.getChatIcons(),
contacts_page: this.linkHtml(Routes.contacts(), Diaspora.I18n.t("chat.contacts_page"))
}
};
this.data = {
title_header: Diaspora.I18n.t( 'title_header' ),
title_getting_help: Diaspora.I18n.t( 'getting_help.title' ),
title_account_and_data_management: Diaspora.I18n.t( 'account_and_data_management.title' ),
title_aspects: Diaspora.I18n.t( 'aspects.title' ),
title_mentions: Diaspora.I18n.t( 'mentions.title' ),
title_pods: Diaspora.I18n.t( 'pods.title' ),
title_posts_and_posting: Diaspora.I18n.t( 'posts_and_posting.title' ),
title_private_posts: Diaspora.I18n.t( 'private_posts.title' ),
title_public_posts: Diaspora.I18n.t( 'public_posts.title' ),
title_resharing_posts: Diaspora.I18n.t( 'resharing_posts.title' ),
title_header: Diaspora.I18n.t("title_header"),
title_getting_help: Diaspora.I18n.t("getting_help.title"),
title_account_and_data_management: Diaspora.I18n.t("account_and_data_management.title"),
title_aspects: Diaspora.I18n.t("aspects.title"),
title_mentions: Diaspora.I18n.t("mentions.title"),
title_pods: Diaspora.I18n.t("pods.title"),
title_posts_and_posting: Diaspora.I18n.t("posts_and_posting.title"),
title_private_posts: Diaspora.I18n.t("private_posts.title"),
title_public_posts: Diaspora.I18n.t("public_posts.title"),
title_resharing_posts: Diaspora.I18n.t("resharing_posts.title"),
title_profile: Diaspora.I18n.t("profile.title"),
title_sharing: Diaspora.I18n.t( 'sharing.title' ),
title_tags: Diaspora.I18n.t( 'tags.title' ),
title_keyboard_shortcuts: Diaspora.I18n.t( 'keyboard_shortcuts.title' ),
title_miscellaneous: Diaspora.I18n.t( 'miscellaneous.title' ),
title_chat: Diaspora.I18n.t( 'chat.title' ),
chat_enabled: this.chatEnabled()
title_sharing: Diaspora.I18n.t("sharing.title"),
title_tags: Diaspora.I18n.t("tags.title"),
title_keyboard_shortcuts: Diaspora.I18n.t("keyboard_shortcuts.title"),
title_miscellaneous: Diaspora.I18n.t("miscellaneous.title")
};
return this;
@@ -201,27 +191,8 @@ app.views.Help = app.views.StaticContentView.extend({
e.preventDefault();
},
chat: function(e){
this.renderStaticSection("chat", "faq_chat", this.CHAT_SUBS);
this.menuClicked(e);
e.preventDefault();
},
linkHtml: function(url, text) {
return "<a href=\"" + url + "\" target=\"_blank\">" + text + "</a>";
},
chatEnabled: function(){
return gon.appConfig.chat.enabled;
},
getChatIcons: function(){
return "<div class=\"help-chat-icons\">" +
" <i class=\"entypo-lock-open\"></i>" +
" <i class=\"entypo-chat\"></i>" +
" <i class=\"entypo-trash\"></i>" +
"</div>";
}
});
// @license-end

View File

@@ -2,23 +2,16 @@
app.views.Photos = app.views.InfScroll.extend({
className: "clearfix row",
postClass : app.views.Photo,
initialize : function() {
this.stream = this.model;
this.collection = this.stream.items;
new app.views.Gallery({el: this.$el});
// viable for extraction
this.stream.fetch();
this.setupInfiniteScroll();
},
postRenderTemplate: function(){
var photoAttachments = $("#main-stream > div");
if(photoAttachments.length > 0) {
new app.views.Gallery({ el: photoAttachments });
}
}
});
// @license-end

View File

@@ -27,12 +27,13 @@ app.views.PodEntry = app.views.Base.extend({
presenter: function() {
return _.extend({}, this.defaultPresenter(), {
/* jshint camelcase: false */
hasPort: (this.model.get("port") >= 0),
is_unchecked: (this.model.get("status")==="unchecked"),
has_no_errors: (this.model.get("status")==="no_errors"),
has_errors: (this.model.get("status")!=="no_errors"),
status_text: Diaspora.I18n.t("admin.pods.states."+this.model.get("status")),
pod_url: (this.model.get("ssl") ? "https" : "http") + "://" + this.model.get("host") +
(this.model.get("port") ? ":" + this.model.get("port") : ""),
(this.model.get("port") >= 0 ? ":" + this.model.get("port") : ""),
response_time_fmt: this._fmtResponseTime()
/* jshint camelcase: true */
});

View File

@@ -31,7 +31,7 @@ app.views.PublisherAspectSelector = app.views.AspectsDropdown.extend({
}
this._updateSelectedAspectIds();
this._updateButton('btn-default');
this._updateButton();
// update the globe or lock icon
var icon = this.$("#visibility-icon");
@@ -48,7 +48,7 @@ app.views.PublisherAspectSelector = app.views.AspectsDropdown.extend({
updateAspectsSelector: function(ids){
this._selectAspects(ids);
this._updateSelectedAspectIds();
this._updateButton('btn-default');
this._updateButton();
},
// take care of the form fields that will indicate the selected aspects

View File

@@ -5,139 +5,102 @@
// progress. Attaches previews of finished uploads to the publisher.
app.views.PublisherUploader = Backbone.View.extend({
allowedExtensions: ["jpg", "jpeg", "png", "gif"],
sizeLimit: 4194304, // bytes
initialize: function(opts) {
this.publisher = opts.publisher;
this.uploader = new qq.FineUploaderBasic({
element: this.el,
button: this.el,
text: {
fileInputTitle: Diaspora.I18n.t("photo_uploader.upload_photos")
},
request: {
endpoint: Routes.photos(),
params: {
/* eslint-disable camelcase */
authenticity_token: $("meta[name='csrf-token']").attr("content"),
/* eslint-enable camelcase */
photo: {
pending: true
}
}
},
validation: {
allowedExtensions: this.allowedExtensions,
sizeLimit: this.sizeLimit
},
messages: {
typeError: Diaspora.I18n.t("photo_uploader.invalid_ext"),
sizeError: Diaspora.I18n.t("photo_uploader.size_error"),
emptyError: Diaspora.I18n.t("photo_uploader.empty")
},
callbacks: {
onProgress: _.bind(this.progressHandler, this),
onSubmit: _.bind(this.submitHandler, this),
onComplete: _.bind(this.uploadCompleteHandler, this),
onError: function(id, name, errorReason) {
if (app.flashMessages) { app.flashMessages.error(errorReason); }
}
}
});
this.info = $("<div id=\"fileInfo\" />");
this.publisher.wrapperEl.before(this.info);
this.publisher.photozoneEl.on("click", ".x", _.bind(this._removePhoto, this));
},
progressHandler: function(id, fileName, loaded, total) {
var progress = Math.round(loaded / total * 100);
this.info.text(fileName + " " + progress + "%").fadeTo(200, 1);
this.publisher.photozoneEl
.find("li.loading").first().find(".progress-bar")
.width(progress + "%");
},
submitHandler: function() {
this.$el.addClass("loading");
this._addPhotoPlaceholder();
// Initialize the PostPhotoUploader and subscribe its events
this.uploader = new Diaspora.PostPhotoUploader(this.el, opts.dropZoneElementIds);
this.uploader.onUploadStarted = _.bind(this.uploadStartedHandler, this);
this.uploader.onProgress = _.bind(this.progressHandler, this);
this.uploader.onUploadCompleted = _.bind(this.uploadCompleteHandler, this);
},
// add photo placeholders to the publisher to indicate an upload in progress
_addPhotoPlaceholder: function() {
_addPhotoPlaceholder: function(id) {
var publisher = this.publisher;
publisher.setButtonsEnabled(false);
publisher.wrapperEl.addClass("with_attachments");
publisher.photozoneEl.append(
"<li class=\"publisher_photo loading\" style=\"position:relative;\">" +
"<li id=\"upload-" + id + "\"class=\"publisher_photo loading\" style=\"position:relative;\">" +
" <div class=\"progress\">" +
" <div class=\"progress-bar progress-bar-striped active\" role=\"progressbar\"></div>"+
" </div>" +
" <img src=\"\"+Handlebars.helpers.imageUrl(\"ajax-loader2.gif\")+\"\" class=\"ajax-loader\" alt=\"\" />"+
" <div class=\"spinner\"></div>" +
"</li>"
);
},
uploadCompleteHandler: function(_id, fileName, response) {
uploadStartedHandler: function(id) {
this.$el.addClass("loading");
this._addPhotoPlaceholder(id);
},
progressHandler: function(id, fileName, progress) {
this.publisher.photozoneEl
.find("li.loading#upload-" + id + " .progress-bar")
.width(progress + "%");
},
uploadCompleteHandler: function(id, fileName, response) {
if (response.success){
this.info.text(Diaspora.I18n.t("photo_uploader.completed", {file: fileName})).fadeTo(2000, 0);
var photoId = response.data.photo.id,
image = response.data.photo.unprocessed_image;
var id = response.data.photo.id,
url = response.data.photo.unprocessed_image.url;
this._addFinishedPhoto(id, url);
this._addFinishedPhoto(id, photoId, image);
this.trigger("change");
} else {
this._cancelPhotoUpload();
this.trigger("change");
this.info.text(Diaspora.I18n.t("photo_uploader.error", {file: fileName}));
this._cancelPhotoUpload(id);
this.publisher.wrapperEl.find("#photodropzone_container").first().after(
"<div id=\"upload_error\">" +
Diaspora.I18n.t("photo_uploader.error", {file: fileName}) +
Diaspora.I18n.t("photo_uploader.error", {file: fileName}) +
"</div>"
);
this.trigger("change");
}
},
// replace the first photo placeholder with the finished uploaded image and
// add the id to the publishers form
_addFinishedPhoto: function(id, url) {
_addFinishedPhoto: function(id, photoId, image) {
var publisher = this.publisher;
// add form input element
publisher.$(".content_creation form").append(
"<input type=\"hidden\", value=\""+id+"\" name=\"photos[]\" />"
"<input type=\"hidden\", value=\"" + photoId + "\" name=\"photos[]\" />"
);
// replace placeholder
var placeholder = publisher.photozoneEl.find("li.loading").first();
var placeholder = publisher.photozoneEl.find("li.loading#upload-" + id);
var imgElement = document.createElement("img");
imgElement.src = image.thumb_medium.url;
imgElement.classList.add("hidden");
imgElement.dataset.id = photoId;
imgElement.dataset.small = image.thumb_small.url;
imgElement.dataset.scaled = image.scaled_full.url;
placeholder
.removeClass("loading")
.prepend(
"<div class=\"x\"></div>"+
"<div class=\"circle\"></div>"
)
.find("img").attr({"src": url, "data-id": id}).removeClass("ajax-loader");
placeholder
.find("div.progress").remove();
'<div class="x"></div>' +
'<div class="circle"></div>' +
imgElement.outerHTML
).removeClass("loading");
placeholder.find("div.progress").remove();
placeholder.find("img").on("load", function(ev) {
$(ev.target).removeClass("hidden");
placeholder.find(".spinner").remove();
});
// no more placeholders? enable buttons
if( publisher.photozoneEl.find("li.loading").length === 0 ) {
if (publisher.photozoneEl.find("li.loading").length === 0) {
this.$el.removeClass("loading");
publisher.setButtonsEnabled(true);
}
},
_cancelPhotoUpload: function() {
var publisher = this.publisher;
var placeholder = publisher.photozoneEl.find("li.loading").first();
placeholder
.removeClass("loading")
.find("img").remove();
_cancelPhotoUpload: function(id) {
this.publisher.photozoneEl.find("li.loading#upload-" + id).remove();
},
// remove an already uploaded photo
@@ -155,7 +118,7 @@ app.views.PublisherUploader = Backbone.View.extend({
photo.fadeOut(400, function() {
photo.remove();
if( self.publisher.$(".publisher_photo").length === 0 ) {
if (self.publisher.$(".publisher_photo").length === 0) {
// no more photos left...
self.publisher.wrapperEl.removeClass("with_attachments");
}
@@ -164,9 +127,7 @@ app.views.PublisherUploader = Backbone.View.extend({
});
}
});
return false;
}
});
// @license-end

View File

@@ -11,7 +11,6 @@
//= require ./publisher/poll_creator_view
//= require ./publisher/services_view
//= require ./publisher/uploader_view
//= require jquery-textchange
app.views.Publisher = Backbone.View.extend({
@@ -22,7 +21,7 @@ app.views.Publisher = Backbone.View.extend({
"focus textarea" : "open",
"submit form" : "createStatusMessage",
"click #submit" : "createStatusMessage",
"textchange #status_message_text": "checkSubmitAvailability",
"input #status_message_text": "checkSubmitAvailability",
"click #locator" : "showLocation",
"click #poll_creator" : "togglePollCreator",
"click #hide_location" : "destroyLocation",
@@ -52,10 +51,6 @@ app.views.Publisher = Backbone.View.extend({
this.$(".question_mark").hide();
}
// this has to be here, otherwise for some reason the callback for the
// textchange event won't be called in Backbone...
this.inputEl.bind("textchange", $.noop);
$("body").click(function(event) {
var $target = $(event.target);
if ($target.closest("#publisher").length === 0 && !$target.hasClass("dropdown-backdrop")) {
@@ -113,6 +108,7 @@ app.views.Publisher = Backbone.View.extend({
this.viewUploader = new app.views.PublisherUploader({
el: this.$("#file-upload"),
dropZoneElementIds: ["publisher-textarea-wrapper"],
publisher: this
});
this.viewUploader.on("change", this.checkSubmitAvailability, this);
@@ -133,10 +129,6 @@ app.views.Publisher = Backbone.View.extend({
if (photoAttachments.length > 0) {
new app.views.Gallery({el: photoAttachments});
}
},
onChange: function() {
self.inputEl.trigger("textchange");
}
};
@@ -284,13 +276,13 @@ app.views.Publisher = Backbone.View.extend({
getUploadedPhotos: function() {
var photos = [];
$("li.publisher_photo img").each(function() {
var file = $(this).attr("src").substring("/uploads/images/".length);
var photo = $(this);
photos.push(
{
"sizes": {
"small" : "/uploads/images/thumb_small_" + file,
"medium" : "/uploads/images/thumb_medium_" + file,
"large" : "/uploads/images/scaled_full_" + file
"small": photo.data("small"),
"medium": photo.attr("src"),
"large": photo.data("scaled")
}
}
);
@@ -368,8 +360,7 @@ app.views.Publisher = Backbone.View.extend({
// clear text
this.inputEl.val("");
this.inputEl.trigger("keyup")
.trigger("keydown");
this.inputEl.trigger("input");
autosize.update(this.inputEl);
// remove photos
@@ -403,9 +394,6 @@ app.views.Publisher = Backbone.View.extend({
// clear poll form
this.viewPollCreator.clearInputs();
// force textchange plugin to update lastValue
this.inputEl.data("lastValue", "");
return this;
},
@@ -445,7 +433,8 @@ app.views.Publisher = Backbone.View.extend({
},
checkSubmitAvailability: function() {
if( this._submittable() ) {
if (this._submittable()) {
this.open();
this.setButtonsEnabled(true);
} else {
this.setButtonsEnabled(false);
@@ -484,7 +473,7 @@ app.views.Publisher = Backbone.View.extend({
},
_beforeUnload: function(e) {
if(this._submittable() && this.inputEl.val() !== this.prefillText){
if (this._submittable() && this.inputEl.val() !== this.prefillText) {
var confirmationMessage = Diaspora.I18n.t("confirm_unload");
(e || window.event).returnValue = confirmationMessage; //Gecko + IE
return confirmationMessage; //Webkit, Safari, Chrome, etc.

View File

@@ -7,7 +7,7 @@ app.views.StreamPost = app.views.Post.extend({
subviews : {
".feedback": "feedbackView",
".comments": "commentStreamView",
".likes": "likesInfoView",
".likes-on-post": "likesInfoView",
".reshares": "resharesInfoView",
".post-controls": "postControlsView",
".post-content": "postContentView",

View File

@@ -0,0 +1,121 @@
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
Diaspora.PostPhotoUploader = class {
/**
* Initializes a new instance of PostPhotoUploader
* This class handles uploading photos and provides client side scaling
*/
constructor(el, dropZoneElementIds, aspectIds) {
this.element = el;
this.dropZoneElementIds = dropZoneElementIds;
this.sizeLimit = 4194304;
this.aspectIds = aspectIds;
this.onProgress = null;
this.onUploadStarted = null;
this.onUploadCompleted = null;
/**
* Shows a message using flash messages or alert for mobile.
* @param {string} type - The type of the message, e.g. "error" or "success".
* @param text - The text to display.
*/
this.showMessage = (type, text) => (app.flashMessages ? app.flashMessages[type](text) : alert(text));
/**
* Returns true if the given parameter is a function
* @param {param} - The object to check
* @returns {boolean}
*/
this.func = param => (typeof param === "function");
this.initFineUploader();
}
/**
* Initializes the fine uploader component
*/
initFineUploader() {
this.fineUploader = new qq.FineUploaderBasic({
element: this.element,
button: this.element,
text: {
fileInputTitle: Diaspora.I18n.t("photo_uploader.upload_photos")
},
request: {
endpoint: Routes.photos(),
params: {
/* eslint-disable camelcase */
authenticity_token: $("meta[name='csrf-token']").attr("content"),
photo: {
pending: true,
aspect_ids: this.aspectIds
}
/* eslint-enable camelcase */
}
},
paste: {
targetElement: document.getElementById("status_message_text"),
promptForName: true
},
validation: {
acceptFiles: "image/png, image/jpeg, image/gif, image/webp",
allowedExtensions: ["jpg", "jpeg", "png", "gif", "webp"],
sizeLimit: (window.Promise && qq.supportedFeatures.scaling ? null : this.sizeLimit)
},
messages: {
typeError: Diaspora.I18n.t("photo_uploader.invalid_ext"),
sizeError: Diaspora.I18n.t("photo_uploader.size_error"),
emptyError: Diaspora.I18n.t("photo_uploader.empty")
},
callbacks: {
onSubmit: (id, name) => this.onPictureSelected(id, name),
onUpload: (id, name) => (this.func(this.onUploadStarted) && this.onUploadStarted(id, name)),
onProgress: (id, fileName, loaded, total) =>
(this.func(this.onProgress) && this.onProgress(id, fileName, Math.round(loaded / total * 100))),
onComplete: (id, name, json) => (this.func(this.onUploadCompleted) && this.onUploadCompleted(id, name, json)),
onError: (id, name, errorReason) => this.showMessage("error", errorReason)
}
});
if (this.dropZoneElementIds instanceof Array) {
var dropZoneElements = this.dropZoneElementIds.map(id => document.getElementById(id)).filter(el => el);
if (dropZoneElements.length > 0) {
this.dragAndDropModule = new qq.DragAndDrop({
dropZoneElements: dropZoneElements,
callbacks: {
processingDroppedFilesComplete: (files) => this.fineUploader.addFiles(files)
}
});
}
}
}
/**
* Called when a picture from user's device has been selected.
* Scales the images using Pica if the image exceeds the file size limit
* @param {number} id - The current file's id.
* @param {string} name - The current file's name.
*/
onPictureSelected(id, name) {
// scale image because it's bigger than the size limit and the browser supports it
if (this.fineUploader.getSize(id) > this.sizeLimit && window.Promise && qq.supportedFeatures.scaling) {
this.fineUploader.scaleImage(id, {
maxSize: 3072,
customResizer: !qq.ios() && (i => window.pica().resize(i.sourceCanvas, i.targetCanvas))
}).then(scaledImage => {
this.fineUploader.addFiles({
blob: scaledImage,
name: name
});
});
// since we are adding the smaller scaled image afterwards, we return false
return false;
}
// return true to upload the image without scaling
return true;
}
};
// @license-end

View File

@@ -0,0 +1,253 @@
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
Diaspora.ProfilePhotoUploader = class {
/**
* Initializes a new instance of ProfilePhotoUploader
*/
constructor() {
// get several elements we will use a few times
this.fileInput = document.querySelector("#file-upload");
this.picture = document.querySelector("#profile_photo_upload .avatar");
this.info = document.querySelector("#fileInfo");
this.cropContainer = document.querySelector(".crop-container");
this.spinner = document.querySelector("#file-upload-spinner");
/**
* Creates a button
* @param {string} icon - The entypo icon class.
* @param {function} onClick - Is called when button has been clicked.
*/
this.createButton = (icon, onClick) =>
($(`<button class="btn btn-default" type="button"><i class="entypo-${icon}"></i></button>`)
.on("click", onClick));
/**
* Shows a message using flash messages or alert for mobile.
* @param {string} type - The type of the message, e.g. "error" or "success".
* @param text - The text to display.
*/
this.showMessage = (type, text) => (app.flashMessages ? app.flashMessages[type](text) : alert(text));
this.initFineUploader();
}
/**
* Initializes the fine uploader component
*/
initFineUploader() {
this.fineUploader = new qq.FineUploaderBasic({
element: this.fileInput,
validation: {
acceptFiles: "image/png, image/jpeg",
allowedExtensions: ["jpg", "jpeg", "png"]
},
request: {
endpoint: Routes.photos(),
params: {
/* eslint-disable camelcase */
authenticity_token: $("meta[name='csrf-token']").attr("content"),
/* eslint-enable camelcase */
photo: {"pending": true, "aspect_ids": "all", "set_profile_photo": true}
}
},
button: this.fileInput,
autoUpload: false,
messages: {
typeError: Diaspora.I18n.t("photo_uploader.invalid_ext"),
sizeError: Diaspora.I18n.t("photo_uploader.size_error"),
emptyError: Diaspora.I18n.t("photo_uploader.empty")
},
callbacks: {
onProgress: (id, fileName, loaded, total) => {
(this.info.innerText = `${fileName} ${Math.round(loaded / total * 100)}%`);
},
onSubmit: (id, name) => this.onPictureSelected(id, name),
onComplete: (id, name, responseJSON) => this.onUploadCompleted(id, name, responseJSON),
onError: (id, name) => this.showMessage("error", Diaspora.I18n.t("photo_uploader.error", {file: name}))
},
text: {
fileInputTitle: ""
},
scaling: {
sendOriginal: false,
sizes: [
{maxSize: 1600}
]
}
});
}
/**
* Called when a picture from user's device has been selected.
* @param {number} id - The current file's id.
* @param {string} name - The current file's name.
*/
onPictureSelected(id, name) {
this.setLoading(true);
this.fileName = name;
const file = this.fileInput.querySelector("input").files[0];
// ensure browser's file reader support
if (FileReader && file) {
const fileReader = new FileReader();
fileReader.onload = () => this.initCropper(fileReader.result);
fileReader.readAsDataURL(file);
} else {
this.setLoading(false);
}
}
/**
* Initializes the cropper and all controls.
* @param {object|string} imageData - The base64 image data
*/
initCropper(imageData) {
// cache the current picture source if the user cancels
this.previousPicture = this.picture.getAttribute("src");
this.mimeType = imageData.split(";base64")[0].substring(5);
this.picture.onload = () => {
// set the preferred size style of the cropper based on picture orientation
const isPortrait = this.picture.naturalHeight > this.picture.naturalWidth;
this.picture.setAttribute("style", (isPortrait ? "max-height:600px;max-width:none;" : "max-width:600px;"));
this.buildControls();
this.setLoading(false);
// eslint-disable-next-line no-undef
this.cropper = new Cropper(this.picture, {
aspectRatio: 1,
zoomable: false,
autoCropArea: 1,
preview: ".preview"
});
};
this.picture.setAttribute("src", imageData);
}
/**
* Creates image manipulation controls and previews.
*/
buildControls() {
this.controls = {
rotateLeft: this.createButton("ccw", () => this.cropper.rotate(-45)),
rotateRight: this.createButton("cw", () => this.cropper.rotate(45)),
reset: this.createButton("cycle", () => this.cropper.reset()),
accept: this.createButton("check", () => this.cropImage()),
cancel: this.createButton("trash", () => this.cancel())
};
this.controlRow = $("<div class='controls'>").appendTo(this.cropContainer);
// rotation buttons on the left
this.controlRow.append($("<div class='btn-group buttons-left' role='group'>").append([
this.controls.rotateLeft,
this.controls.rotateRight
]));
// preview images in the middle
this.controlRow.append("<div class='preview'>");
// main buttons on the right
this.controlRow.append($("<div class='btn-group buttons-right' role='group'>").append([
this.controls.reset,
this.controls.cancel,
this.controls.accept
]));
}
/**
* Called when the user clicked accept button. Sets file data and triggers file upload.
*/
cropImage() {
const canvas = this.cropper.getCroppedCanvas();
// replace the stored file with the new canvas
this.fineUploader.clearStoredFiles();
this.fineUploader.addFiles([{
canvas: canvas,
name: this.fileName,
quality: 100,
type: this.mimeType
}]);
// reset all controls
this.cancel();
this.picture.setAttribute("src", canvas.toDataURL(this.mimeType));
// finally start uploading
this.setLoading(true);
this.fineUploader.uploadStoredFiles();
}
/**
* Is called after the file upload has been completed and the profile photo changed.
* @param {number} id - The current file's id.
* @param {string} fileName - The current file's name.
* @param {object} responseJSON - The server's json response.
*/
onUploadCompleted(id, fileName, responseJSON) {
this.setLoading(false);
this.fileInput.classList.remove("hidden");
if (responseJSON.data !== undefined) {
/* flash message prompt */
this.showMessage("success", Diaspora.I18n.t("photo_uploader.looking_good"));
this.info.innerText = Diaspora.I18n.t("photo_uploader.completed", {"file": fileName});
const photoId = responseJSON.data.photo.id;
const url = responseJSON.data.photo.unprocessed_image.url;
const oldPhoto = $("#photo_id");
if (oldPhoto.length === 0) {
$("#update_profile_form")
.prepend(`<input type="hidden" value="${photoId}" id="photo_id" name="photo_id"/>`);
} else {
oldPhoto.val(photoId);
}
this.picture.setAttribute("src", url);
$(`.avatar[alt="${gon.user.diaspora_id}"]`).attr("src", url);
} else {
this.cancel();
}
}
/**
* Toggles loading state by hiding or showing several elements
* @param {boolean} loading - True if loading state should be enabled.
*/
setLoading(loading) {
if (loading) {
this.fileInput.classList.add("hidden");
this.picture.classList.add("hidden");
this.spinner.classList.remove("hidden");
} else {
this.picture.classList.remove("hidden");
this.spinner.classList.add("hidden");
}
}
/**
* Destroys the cropper and resets all elements to initial state.
*/
cancel() {
this.cropper.destroy();
this.picture.onload = null;
this.picture.setAttribute("style", "");
this.picture.setAttribute("src", this.previousPicture);
this.controlRow.remove();
this.fileInput.classList.remove("hidden");
this.info.innerText = "";
this.mimeType = null;
this.name = null;
}
};
// @license-end

View File

@@ -1,9 +1,9 @@
//= require jquery3
//= require handlebars.runtime
//= require main
//= require fine-uploader/fine-uploader.core
//= require fine-uploader/fine-uploader/fine-uploader
//= require mobile/mobile
//= require jquery.autoSuggest.custom
//= require contact-list
//= require sinon
//= require jasmine-ajax
//= require jasmine-ajax/lib/mock-ajax

View File

@@ -1,50 +0,0 @@
//= require emojione
//= require favico.js/favico
//= require jquery.ui/ui/resizable
//= require jquery.ui/ui/draggable
//= require jquery.slimscroll/jquery.slimscroll
//= require jquery-colorbox
//= require jquery-fullscreen-plugin
//= require diaspora_jsxc
// initialize jsxc xmpp client
$(document).ready(function() {
if (app.currentUser.authenticated()) {
$.post("/user/auth_token", null, function(data) {
if (jsxc && data['token']) {
var jid = app.currentUser.get('diaspora_id');
jsxc.init({
root: '/assets/diaspora_jsxc',
rosterAppend: 'body',
otr: {
debug: true,
SEND_WHITESPACE_TAG: true,
WHITESPACE_START_AKE: true
},
onlineHelp: "/help/chat",
priority: {
online: 1,
chat: 1
},
displayRosterMinimized: function() {
return false;
},
xmpp: {
url: $('script#jsxc').data('endpoint'),
username: jid.replace(/@.*?$/g, ''),
domain: jid.replace(/^.*?@/g, ''),
jid: jid,
password: data.token,
resource: 'diaspora-jsxc',
overwrite: true,
onlogin: true
}
});
} else {
console.error('No token found! Authenticated!?');
}
}, 'json');
}
});

View File

@@ -4,23 +4,23 @@
*/
//= require js_image_paths
//= require js-routes
//= require underscore
//= require backbone
//= require autosize
//= require underscore/underscore-umd
//= require backbone/backbone
//= require autosize/dist/autosize
//= require charcount
//= require jquery-placeholder
//= require jquery-placeholder/jquery.placeholder
//= require jquery.timeago
//= require jquery.ui/ui/core
//= require jquery.ui/ui/widget
//= require jquery.ui/ui/mouse
//= require jquery.ui/ui/sortable
//= require jquery-ui/core
//= require jquery-ui/widget
//= require jquery-ui/widgets/mouse
//= require jquery-ui/widgets/sortable
//= require keycodes
//= require jquery.autoSuggest.custom
//= require fine-uploader/fine-uploader.core
//= require fine-uploader/fine-uploader/fine-uploader
//= require handlebars.runtime
//= require_tree ../templates
//= require posix-bracket-expressions
//= require markdown-it
//= require markdown-it/dist/markdown-it
//= require markdown-it-diaspora-mention
//= require markdown-it-for-inline
//= require markdown-it-footnote
@@ -40,11 +40,13 @@
//= require bootstrap
//= require osmlocator
//= require bootstrap-switch
//= require blueimp-gallery
//= require blueimp-gallery/blueimp-gallery-indicator
//= require blueimp-gallery/js/blueimp-gallery
//= require blueimp-gallery/js/blueimp-gallery-indicator
//= require leaflet
//= require api/authorization_page
//= require bootstrap-markdown/bootstrap-markdown
//= require bootstrap-markdown/js/bootstrap-markdown
//= require helpers/markdown_editor
//= require helpers/protocol_handler
//= require jquery.are-you-sure
//= require cropperjs/dist/cropper.js
//= require pica/dist/pica

View File

@@ -4,22 +4,22 @@
*/
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later
//= require jquery-textchange
//= require charcount
//= require js-routes
//= require autosize
//= require autosize/dist/autosize
//= require keycodes
//= require jquery.autoSuggest.custom
//= require fine-uploader/fine-uploader.core
//= require fine-uploader/fine-uploader/fine-uploader
//= require jquery.timeago
//= require underscore
//= require underscore/underscore-umd
//= require bootstrap
//= require pica/dist/pica
//= require diaspora
//= require helpers/i18n
//= require helpers/profile_photo_uploader
//= require helpers/tags_autocomplete
//= require bootstrap-markdown/bootstrap-markdown
//= require bootstrap-markdown/js/bootstrap-markdown
//= require helpers/markdown_editor
//= require helpers/post_photo_uploader
//= require widgets/timeago
//= require mobile/mobile_application
//= require mobile/mobile_file_uploader
@@ -32,4 +32,5 @@
//= require mobile/mobile_conversations
//= require mobile/mobile_post_actions
//= require mobile/mobile_drawer
//= require mobile/mobile_profile_photo_uploader
// @license-end

View File

@@ -52,6 +52,8 @@
$.post(form.attr("action") + "?format=mobile", form.serialize(), function(data){
Diaspora.Mobile.Comments.updateStream(form, data);
// Register new comments
$(".stream").trigger("comments.loaded");
}, "html").fail(function(response) {
Diaspora.Mobile.Alert.handleAjaxError(response);
Diaspora.Mobile.Comments.resetCommentBox(form);
@@ -107,10 +109,12 @@
url: toggleReactionsLink.attr("href"),
success: function (data) {
toggleReactionsLink.addClass("active").removeClass("loading");
$(data).insertAfter(bottomBar.children(".show-comments").first());
$(data).insertAfter(bottomBar.children(".post-actions-container").first());
self.showCommentBox(commentActionLink);
bottomBarContainer.getCommentsContainer().find("time.timeago").timeago();
bottomBarContainer.activate();
// Inform the comment action for new comments
$(".stream").trigger("comments.loaded");
},
error: function(){
bottomBarContainer.deactivate();

View File

@@ -2,97 +2,74 @@
//= require js_image_paths
function createUploader(){
var aspectIds = gon.preloads.aspect_ids;
var fileInfo = $("#fileInfo-publisher");
new qq.FineUploaderBasic({
element: document.getElementById("file-upload-publisher"),
request: {
endpoint: Routes.photos(),
params: {
/* eslint-disable camelcase */
authenticity_token: $("meta[name='csrf-token']").attr("content"),
photo: {
aspect_ids: aspectIds,
/* eslint-enable camelcase */
pending: true
}
}
},
validation: {
allowedExtensions: ["jpg", "jpeg", "png", "gif"],
sizeLimit: 4194304
},
button: document.getElementById("file-upload-publisher"),
text: {
fileInputTitle: Diaspora.I18n.t("photo_uploader.upload_photos")
},
// Initialize the PostPhotoUploader and subscribe its events
this.uploader = new Diaspora.PostPhotoUploader(document.getElementById("file-upload-publisher"),
["publisher-textarea-wrapper", "status_message_text", "file-upload-publisher"]);
callbacks: {
onProgress: function(id, fileName, loaded, total) {
var progress = Math.round(loaded / total * 100);
$("#fileInfo-publisher").text(fileName + " " + progress + "%");
},
onSubmit: function() {
$("#publisher-textarea-wrapper").addClass("with_attachments");
$("#photodropzone").append(
"<li class='publisher_photo loading' style='position:relative;'>" +
"<img alt='Ajax-loader2' src='" + ImagePaths.get("ajax-loader2.gif") + "' />" +
"</li>"
);
},
onComplete: function(_id, fileName, responseJSON) {
if (responseJSON.data === undefined) {
return;
}
this.uploader.onUploadStarted = _.bind(uploadStartedHandler, this);
this.uploader.onProgress = _.bind(progressHandler, this);
this.uploader.onUploadCompleted = _.bind(uploadCompletedHandler, this);
$("#fileInfo-publisher").text(Diaspora.I18n.t("photo_uploader.completed", {"file": fileName}));
var id = responseJSON.data.photo.id,
url = responseJSON.data.photo.unprocessed_image.url,
currentPlaceholder = $("li.loading").first();
function progressHandler(fileName, progress) {
fileInfo.text(fileName + " " + progress + "%");
}
$("#publisher-textarea-wrapper").addClass("with_attachments");
$("#new_status_message").append("<input type='hidden' value='" + id + "' name='photos[]' />");
function uploadStartedHandler() {
$("#publisher-textarea-wrapper").addClass("with_attachments");
$("#photodropzone").append(
"<li class='publisher_photo loading' style='position:relative;'>" +
"<img alt='Ajax-loader2' src='" + ImagePaths.get("ajax-loader2.gif") + "' />" +
"</li>"
);
}
// replace image placeholders
var img = currentPlaceholder.find("img");
img.attr("src", url);
img.attr("data-id", id);
currentPlaceholder.removeClass("loading");
currentPlaceholder.append("<div class='x'>X</div>" +
"<div class='circle'></div>");
function uploadCompletedHandler(_id, fileName, responseJSON) {
if (responseJSON.data === undefined) {
return;
}
var publisher = $("#publisher");
fileInfo.text(Diaspora.I18n.t("photo_uploader.completed", {"file": fileName}));
var id = responseJSON.data.photo.id,
image = responseJSON.data.photo.unprocessed_image,
currentPlaceholder = $("li.loading").first();
publisher.find("input[type='submit']").removeAttr("disabled");
$("#publisher-textarea-wrapper").addClass("with_attachments");
$("#new_status_message").append("<input type='hidden' value='" + id + "' name='photos[]' />");
$(".x").bind("click", function() {
var photo = $(this).closest(".publisher_photo");
photo.addClass("dim");
$.ajax({
url: "/photos/" + photo.children("img").attr("data-id"),
dataType: "json",
type: "DELETE",
success: function() {
photo.fadeOut(400, function() {
photo.remove();
if ($(".publisher_photo").length === 0) {
$("#publisher-textarea-wrapper").removeClass("with_attachments");
}
});
// replace image placeholders
var img = currentPlaceholder.find("img");
img.attr("src", image.thumb_medium.url);
img.attr("data-small", image.thumb_small.url);
img.attr("data-scaled", image.scaled_full.url);
img.attr("data-id", id);
currentPlaceholder.removeClass("loading");
currentPlaceholder.append("<div class='x'>X</div>" +
"<div class='circle'></div>");
var publisher = $("#publisher");
publisher.find("input[type='submit']").removeAttr("disabled");
$(".x").bind("click", function() {
var photo = $(this).closest(".publisher_photo");
photo.addClass("dim");
$.ajax({
url: "/photos/" + photo.children("img").attr("data-id"),
dataType: "json",
type: "DELETE",
success: function() {
photo.fadeOut(400, function() {
photo.remove();
if ($(".publisher_photo").length === 0) {
$("#publisher-textarea-wrapper").removeClass("with_attachments");
}
});
});
},
onError: function(id, name, errorReason) {
alert(errorReason);
}
},
messages: {
typeError: Diaspora.I18n.t("photo_uploader.invalid_ext"),
sizeError: Diaspora.I18n.t("photo_uploader.size_error"),
emptyError: Diaspora.I18n.t("photo_uploader.empty")
}
});
}
});
});
}
}
window.addEventListener("load", function() {
createUploader();

View File

@@ -3,6 +3,11 @@
initialize: function() {
$(".like-action", ".stream").bind("tap click", this.onLike);
$(".reshare-action", ".stream").bind("tap click", this.onReshare);
// Add handler to newly loaded comments
var self = this;
$(".stream").bind("comments.loaded", function() {
$(".like-action", ".stream").bind("tap click", self.onLike);
});
},
showLoader: function(link) {
@@ -75,8 +80,8 @@
onLike: function(evt){
evt.preventDefault();
var link = $(evt.target).closest(".like-action"),
likeCounter = $(evt.target).closest(".stream-element").find(".like-count");
var link = $(evt.target).closest(".like-action").first(),
likeCounter = $(evt.target).find(".like-count").first();
if(!link.hasClass("loading") && link.hasClass("inactive")) {
Diaspora.Mobile.PostActions.like(likeCounter, link);

View File

@@ -11,7 +11,8 @@ Diaspora.ProfilePhotoUploader.prototype = {
new qq.FineUploaderBasic({
element: document.getElementById("file-upload"),
validation: {
allowedExtensions: ["jpg", "jpeg", "png"],
acceptFiles: "image/png, image/jpeg, image/gif, image/webp",
allowedExtensions: ["png", "jpg", "jpeg", "gif", "webp"],
sizeLimit: 4194304
},
request: {

View File

@@ -48,4 +48,74 @@ $(document).ready(function(){
});
new Diaspora.MarkdownEditor("#status_message_text");
$(".dropdown-menu > li").bind("tap click", function(evt) {
let target = $(evt.target).closest("li");
// visually toggle the aspect selection
if (target.is(".radio")) {
_toggleRadio(target);
} else if (target.is(".aspect-selector")) {
// don't close the dropdown
evt.stopPropagation();
_toggleCheckbox(target);
}
_updateSelectedAspectIds();
_updateButton();
// update the globe or lock icon
let icon = $("#visibility-icon");
if (target.find(".text").text().trim() === Diaspora.I18n.t("stream.public")) {
icon.removeClass("entypo-lock");
icon.addClass("entypo-globe");
} else {
icon.removeClass("entypo-globe");
icon.addClass("entypo-lock");
}
});
function _toggleRadio(target) {
$(".dropdown-menu > li").removeClass("selected");
target.toggleClass("selected");
}
function _toggleCheckbox(target) {
$(".dropdown-menu > li.radio").removeClass("selected");
target.toggleClass("selected");
}
// take care of the form fields that will indicate the selected aspects
function _updateSelectedAspectIds() {
let form = $("#new_status_message");
// remove previous selection
form.find('input[name="aspect_ids[]"]').remove();
// create fields for current selection
form.find(".dropdown-menu > li.selected").each(function() {
let uid = _.uniqueId("aspect_ids_");
let id = $(this).data("aspect_id");
form.append('<input id="' + uid + '" name="aspect_ids[]" type="hidden" value="' + id + '">');
});
}
// change class and text of the dropdown button
function _updateButton() {
let button = $(".btn.dropdown-toggle"),
selectedAspects = $(".dropdown-menu > li.selected").length,
buttonText;
switch (selectedAspects) {
case 0:
buttonText = Diaspora.I18n.t("aspect_dropdown.select_aspects");
break;
case 1:
buttonText = $(".dropdown-menu > li.selected .text").first().text();
break;
default:
buttonText = Diaspora.I18n.t("aspect_dropdown.toggle", {count: selectedAspects.toString()});
}
button.find(".text").text(buttonText);
}
});

View File

@@ -1,4 +1,4 @@
@import 'utatti-perfect-scrollbar/css/perfect-scrollbar';
@import 'perfect-scrollbar/css/perfect-scrollbar';
@import 'color-variables';
@import 'bootstrap-complete';
@@ -24,6 +24,9 @@
// font overrides
@import 'typography';
// New design, can be used adding the .modern-design class to a <div> around the page which is ported
@import 'modern-design';
// layout
@import 'sidebar';
@@ -40,6 +43,7 @@
// profile and settings pages
@import 'settings';
@import 'cropperjs/dist/cropper';
// new SPV
@import 'header';
@@ -82,8 +86,6 @@
@import 'stream';
@import 'stream_element';
@import 'comments';
@import 'diaspora_jsxc';
@import 'chat';
@import 'markdown-content';
@import 'oembed';
@import 'media-embed';
@@ -95,14 +97,14 @@
// code
@import 'code';
@import 'highlightjs/github';
@import 'highlightjs/styles/github';
// statistics
@import 'statistics';
// gallery
@import 'blueimp-gallery';
@import 'blueimp-gallery/blueimp-gallery-indicator';
@import 'blueimp-gallery/css/blueimp-gallery';
@import 'blueimp-gallery/css/blueimp-gallery-indicator';
@import 'gallery';
// settings

View File

@@ -1,7 +1,7 @@
/* Mixin file for sass. Here is where we define our variables and
browser compatability functions used in all scss/sass files */
/* Transision defaults */
// Transition defaults
$speed: 0.1s;
$easing: linear;
@@ -138,3 +138,21 @@ $default-border-radius: 3px;
.glyphicon-ok { display: none;}
}
}
@mixin aspect-dropdown-link($anchor-size) {
$link-text-color: #333;
a {
cursor: pointer;
padding-left: 10px;
.text {
color: $link-text-color;
font-size: $anchor-size;
}
&:hover {
background: $background-grey;
}
}
}

View File

@@ -1,26 +1,19 @@
@import 'mixins';
.aspect-dropdown {
li {
@include selectable-list;
@include aspect-dropdown-link(1em);
.status_indicator {
width: 19px;
height: 14px;
display: inline-block;
}
a {
.text {
color: #333333;
}
&:hover {
background: $background-grey;
}
cursor: pointer;
padding-left: 10px;
}
}
}
.aspect-membership {
max-height: 300px;
overflow: auto;

View File

@@ -1,14 +0,0 @@
body > .container-fluid.chat-roster-shown {
padding-right: 224px;
#back-to-top { right: 244px; }
}
body > .container-fluid.chat-roster-hidden {
#back-to-top { right: 54px; }
}
// This element is instanciated by JSXC. Does not have to follow naming conventions
// scss-lint:disable IdSelector, SelectorFormat
#jsxc_roster {
top: $navbar-height;
}
// scss-lint:enable IdSelector, SelectorFormat

View File

@@ -5,3 +5,12 @@ pre {
white-space: pre;
code { white-space: pre; }
}
// For inline-code inside links, let's force the color to the default link
// color to make them be recognizable as links.
p a {
code,
pre {
color: $link-color;
}
}

View File

@@ -44,7 +44,7 @@ body {
pre code { border: 0; }
@import 'highlightjs/darcula';
@import 'highlightjs/styles/darcula';
#single-post-content .head {
.author-name { color: lighten($gray-lighter, 27%); }

View File

@@ -24,13 +24,9 @@
.comments > .comment,
.comment.new-comment-form-wrapper {
.avatar {
height: 35px;
width: 35px;
}
margin: 0;
border-top: 1px dotted $border-grey;
padding: 10px 0;
padding: 10px 0 0;
.info {
margin-top: 5px;
@@ -57,8 +53,6 @@
}
}
.comment.new-comment-form-wrapper { padding-bottom: 0; }
.submit-button {
margin-top: 10px;
input {
@@ -84,6 +78,25 @@
}
}
.likes-on-comment {
&.likes {
margin-top: 6px;
}
.media {
margin: 0 0 2px;
&:not(.display-avatars) .entypo-heart {
display: none;
}
}
.expand-likes {
display: inline-block;
margin-bottom: 4px;
}
}
.new-comment {
&:not(.open) .submit-button,
&:not(.open) .md-header {

View File

@@ -37,9 +37,6 @@
text-decoration: none;
margin-right: 25px;
}
#chat_privilege_toggle > .enabled {
color: $text-color-active;
}
.contacts-header-icon {
font-size: 24.5px;
line-height: 40px;

View File

@@ -14,6 +14,14 @@ $margin: 15px;
top: $margin;
}
.slide-error {
background-image: image-url("blueimp-gallery/img/error.svg");
}
.slide-loading {
background-image: image-url("blueimp-gallery/img/loading.gif");
}
.too-tall {
margin-bottom: $margin * 2 + $thumbnail-size;
max-height: none;

View File

@@ -1,9 +1,4 @@
#hello-there {
#profile_photo_upload .avatar {
max-height: 200px;
max-width: 200px;
}
.well .avatar {
min-width: 50px;
}

View File

@@ -91,18 +91,6 @@ ul#help_nav {
border-radius: 0px 0px 4px 4px;
background-color: white;
padding: 10px 20px;
div.help-chat-icons{
text-align: center;
font-size: 50px;
line-height: 70px;
[class^="entypo-"], [class*="entypo-"] {
color: $text-color-pale;
&.entypo-chat { color: $text-color-active; }
}
}
}
}
}

View File

@@ -1,8 +1,5 @@
.bottom-bar {
border-radius: 0 0 5px 5px;
z-index: 3;
display: block;
position: relative;
padding: 8px 10px 10px;
background: $background-grey;
margin-top: 10px;
@@ -10,6 +7,17 @@
min-height: 22px;
overflow: hidden;
&,
.comment-stats {
border-bottom-left-radius: $border-radius-small;
border-bottom-right-radius: $border-radius-small;
}
.post-actions-container {
display: flex;
justify-content: space-between;
}
> a,
.show-comments,
.show-comments > [class^="entypo"] {
@@ -37,8 +45,7 @@
}
}
.post-stats {
float: right;
%stats {
position: relative;
display: flex;
@@ -46,9 +53,9 @@
color: $text-color;
font-family: $font-family-base;
font-size: $font-size-base;
line-height: 22px;
line-height: 24px;
margin-left: 5px;
vertical-align: top;
vertical-align: text-bottom;
z-index: 2;
}
@@ -67,17 +74,36 @@
}
.entypo-reshare.active { color: $blue; }
.entypo-heart.active { color: $red; }
}
.post-action {
.post-stats {
@extend %stats;
}
.comment-stats {
@extend %stats;
background: $background-grey;
border-top: 1px solid $border-grey;
flex-direction: row-reverse;
padding: 3px;
}
%action {
display: flex;
margin: 0 7px;
.disabled { color: $medium-gray; }
}
.post-action {
@extend %action;
}
.comment-action {
@extend %action;
}
.add-comment-switcher { padding-top: 10px; }
&.inactive {
@@ -91,16 +117,19 @@
.stream-element .comments {
margin: 0;
margin-top: 10px;
padding: 0;
width: 100%;
.content { padding: 0; }
.comment {
border-top: 1px solid $border-medium-grey;
padding: 10px 0 0;
background-color: $framed-background;
border: 1px solid $border-medium-grey;
border-radius: 5px;
margin-top: 10px;
&:first-child { padding-top: 20px; }
.media {
padding: 6px;
}
}
}

View File

@@ -145,6 +145,9 @@ $mobile-navbar-height: 46px;
bottom: 0;
overflow: auto;
width: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
li {
font-size: 1.8rem;
@@ -195,6 +198,21 @@ $mobile-navbar-height: 46px;
margin: 0;
padding: 0;
}
.info-links {
li {
font-size: 1.2rem;
line-height: 1.2;
}
a {
padding: 8px 25px;
}
.switch-to-touch {
display: none;
}
}
}
#main-nav, #drawer {

View File

@@ -1,5 +1,5 @@
.md-editor {
border: 1px solid $light-grey;
border: 1px solid $border-medium-grey;
border-radius: $btn-border-radius-base;
&.active { border-color: $text-grey; }

View File

@@ -21,6 +21,10 @@
@import 'typography';
// New design, can be used adding the .modern-design class to a <div> around the page which is ported
@import 'modern-design';
@import 'registration';
a {
color: #2489ce;
text-decoration: none;
@@ -516,9 +520,13 @@ h3.ltr {
font-style: inherit;
font-weight: inherit;
margin: 0;
padding: 15px 15px;
padding: 12px;
vertical-align: baseline;
word-wrap: break-word;
p:last-child {
margin: 0;
}
}
form#new_conversation.new_conversation {
@@ -632,6 +640,12 @@ h1.session {
}
}
}
.spinner {
height: 50px;
margin-top: 10px;
width: 50px;
}
}
#birth-date {
@@ -652,40 +666,44 @@ form#update_profile_form {
.submit_block { margin-bottom: 20px; }
}
select#user_language, select#user_color_theme, #user_auto_follow_back_aspect_id, #aspect_ids_ {
padding: 3px;
}
.hero-unit-mobile {
padding: 10px;
font-size: 14px;
line-height: 18px;
color: inherit;
background-color: $background-grey;
border-radius: 10px;
color: inherit;
font-size: 14px;
line-height: 18px;
padding: 10px;
}
.search-mobile {
text-align: center;
padding-top: 30px;
text-align: center;
}
input#q.search {
margin-bottom: 20px;
}
select#aspect_ids_ {
width: auto !important;
float: right;
margin: 0px;
.aspect-dropdown {
li {
@include selectable-list;
@include aspect-dropdown-link(128%);
.status-indicator {
display: inline-block;
height: 14px;
width: 19px;
}
}
}
#file-upload-spinner {
top: 0px;
top: 0;
}
#publisher_mobile {
#publisher-mobile {
float: right;
margin-left: 5px;
}
#file-upload-publisher {

View File

@@ -56,4 +56,8 @@
width: 50px;
}
}
select {
padding: 3px;
}
}

View File

@@ -0,0 +1,66 @@
$breakpoint: 700px;
$subtle: $text-dark-grey;
$default-size: 16px;
$smaller: .9em;
$default-margin: 16px; // Will be 1rem once the default-size will be set on <html>
$double-margin: $default-margin * 2;
$triple-margin: $default-margin * 3;
$radius: 4px;
.modern-design {
font-size: $default-size;
// Style
h1 {
font-size: 3em;
margin: $double-margin 0;
@media screen and (max-width: $breakpoint) {
font-size: 2em;
margin: $default-margin 0;
}
}
section {
margin-bottom: $double-margin;
}
section:last-child {
margin-bottom: 0;
}
.advice {
color: $subtle;
font-size: $smaller;
font-style: italic;
}
// End of style
// Layout
// This cleans the famous children "margin-top" problem
.small-container::before,
.small-container::after {
content: ' ';
display: table;
}
.small-container {
margin: auto;
max-width: 800px;
@media screen and (max-width: $breakpoint) {
padding: 10px;
}
}
.flex-container {
display: flex;
justify-content: space-between;
}
// End of layout
}

View File

@@ -1,54 +1,79 @@
.page-registrations {
// For the mobile version which doesn't have the same global CSS
background: $body-bg;
#main {
padding: 0;
padding-top: 46px;
}
// End specific mobile
// Overriding bootstrap
.form-control {
display: inline-block;
width: 320px;
}
// End Overriding bootstrap
.fields {
margin: $triple-margin 0;
@media screen and (max-width: $breakpoint) {
flex-direction: column-reverse;
margin: $double-margin 0;
}
section {
border-left: solid 3px $brand-primary;
padding-left: 10px;
}
}
.advice {
max-width: 450px;
}
.captcha {
align-items: center;
display: flex;
.captcha-img {
margin-left: 5px;
order: 2;
}
}
.import-and-ball-container {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.import-instructions {
align-self: flex-start;
background-color: lighten($brand-primary, 40);
border: 2px solid lighten($brand-primary, 20);
border-radius: $radius;
font-size: $smaller;
margin-left: $default-margin;
padding: $default-margin;
width: 240px;
@media screen and (max-width: $breakpoint) {
margin-bottom: $double-margin;
margin-left: 0;
width: 100%;
}
}
.ball {
background: image-url('branding/ball.png') no-repeat;
background-size: contain;
height: 633px;
max-width: 100%;
}
height: 250px;
width: 250px;
.v-center {
display: table;
height: 633px;
}
@media (max-width: $screen-xs-max) {
.v-center {
height: auto;
@media screen and (max-width: $breakpoint) {
display: none;
}
}
.content {
display: table-cell;
vertical-align: middle;
h1 {
font-size: 35px;
margin: 12px 0;
}
}
form {
max-width: 500px;
}
.captcha-img {
left: 10px;
position: absolute;
top: 169px;
width: 120px;
}
.form-control.captcha-input {
border-bottom: 1px solid $input-border;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
box-sizing: border-box;
line-height: $line-height-base;
padding-left: 130px;
}
.terms > a {
color: inherit;
text-decoration: underline;
}
}

View File

@@ -13,6 +13,7 @@
padding-right: 10px;
}
}
// scss-lint:enable SelectorFormat
.enclosed-checkbox label {
@@ -28,9 +29,31 @@
max-width: 200px;
width: auto;
}
.crop-container {
.controls {
display: flex;
justify-content: space-between;
margin-top: 10px;
}
}
.preview {
border-radius: 4px;
height: 50px;
overflow: hidden;
width: 50px;
}
.spinner {
height: 50px;
width: 50px;
}
}
.settings-visibility { margin-left: 10px; }
.settings-visibility {
margin-left: 10px;
}
.page-profiles.action-edit textarea {
max-width: 100%;

View File

@@ -116,9 +116,6 @@
.no-comments { text-align: center; }
a {
color: $link-color;
}
.count {
float: left;
i {
@@ -144,6 +141,7 @@
.comment.new-comment-form-wrapper {
padding: 10px;
}
.comments > .comment { padding-bottom: 0; }
.count,
.interaction-avatars {
@@ -164,4 +162,19 @@
width: $line-height-computed;
}
}
.likes {
font-size: 12px;
line-height: 16px;
.bd { display: inline-block; }
img { display: inline; }
}
.display-avatars .entypo-heart {
display: inline-block;
font-size: 16px;
line-height: 18px;
margin-right: 5px;
vertical-align: top;
}
}

View File

@@ -191,6 +191,16 @@
}
}
.comments {
.likes {
line-height: 10px;
}
.expand-likes {
line-height: 20px;
}
}
.status-message-location {
color: $text-grey;
font-size: $font-size-small;

View File

@@ -36,5 +36,19 @@
<div class="collapsible comment-content markdown-content">
{{{text}}}
</div>
{{#if loggedIn}}
<div class="info">
<a href="#" class="like" rel='nofollow'>
{{~#if userLike~}}
{{~t "stream.unlike"~}}
{{~else~}}
{{~t "stream.like"~}}
{{~/if~}}
</a>
</div>
{{/if}}
<div class="likes likes-on-comment"> </div>
</div>
</div>

View File

@@ -1,6 +0,0 @@
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ add_contact_roster_q }}</h4>
</a>
<div class='answer hideable'>{{{ add_contact_roster_a }}}</div>
</div>

View File

@@ -64,12 +64,6 @@
<a href="#" class="section-unselected faq-link" data-section="miscellaneous" data-items="back_to_top photo_albums subscribe_feed diaspora_app">{{ title_miscellaneous }}</a>
<span class="section-selected">{{ title_miscellaneous }}</span>
</li>
{{#if chat_enabled }}
<li>
<a href="#" class="section-unselected faq-link-chat" data-section="chat" data-items="add_contact_roster i_m_a_podmin">{{ title_chat }}</a>
<span class="section-selected">{{ title_chat }}</span>
</li>
{{/if}}
</ul>
</div>
</div>

View File

@@ -1,6 +1,6 @@
{{#if likesCount}}
<div class="comment">
<div class="media">
<div class="media{{#if displayAvatars}} display-avatars{{/if}}">
<i class="entypo-heart"></i>
<div class="bd">
@@ -8,9 +8,7 @@
<a href="#" class="expand-likes gray">
{{t "stream.likes" count=likesCount}}
</a>
{{else}}
{{#each likes}}
{{#linkToAuthor author}}
{{{personImage this 'small' 'micro'}}}

View File

@@ -7,7 +7,7 @@
{{/if}}
</i>
</td>
<td class="pod-title" title="{{host}}">{{host}}</td>
<td class="pod-title" title="{{host}}">{{host}}{{#if hasPort}}:{{port}}{{/if}}</td>
<td class="added">
<small><time datetime="{{created_at}}" title="{{localTime created_at}}"></time></small>
</td>

View File

@@ -37,7 +37,7 @@
{{#unless preview}}
<div class="feedback nsfw-hidden"> </div>
<div class="likes nsfw-hidden"> </div>
<div class="likes likes-on-post nsfw-hidden"> </div>
<div class="reshares nsfw-hidden"> </div>
<div class="comments nsfw-hidden"> </div>
{{/unless}}

View File

@@ -14,7 +14,8 @@ module Admin
gon.unchecked_count = Pod.unchecked.count
gon.version_failed_count = Pod.version_failed.count
gon.error_count = Pod.check_failed.count
gon.active_count = Pod.active.count
gon.total_count = Pod.count
render "admins/pods"
end
format.mobile { render "admins/pods" }

View File

@@ -120,6 +120,7 @@ module Api
@scopes = endpoint.scopes
save_request_parameters
@app = UserApplicationPresenter.new @o_auth_application, @scopes
override_content_security_policy_directives(form_action: %w[])
render :new
end

View File

@@ -28,7 +28,7 @@ module Api
class DiscoveryController < ApplicationController
def configuration
render json: OpenIDConnect::Discovery::Provider::Config::Response.new(
issuer: root_url,
issuer: AppConfig.environment.url,
registration_endpoint: api_openid_connect_clients_url,
authorization_endpoint: new_api_openid_connect_authorization_url,
token_endpoint: api_openid_connect_access_tokens_url,

View File

@@ -1,15 +0,0 @@
# frozen_string_literal: true
module Api
module V0
class BaseController < ApplicationController
include Api::OpenidConnect::ProtectedResourceEndpoint
protected
def current_user
current_token ? current_token.authorization.user : nil
end
end
end
end

View File

@@ -0,0 +1,79 @@
# frozen_string_literal: true
module Api
module V1
class AspectsController < Api::V1::BaseController
before_action except: %i[create update destroy] do
require_access_token %w[contacts:read]
end
before_action only: %i[create update destroy] do
require_access_token %w[contacts:modify]
end
def index
aspects_query = current_user.aspects
aspects_page = index_pager(aspects_query).response
aspects_page[:data] = aspects_page[:data].map {|a| aspect_as_json(a, false) }
render_paged_api_response aspects_page
end
def show
aspect = current_user.aspects.where(id: params[:id]).first
if aspect
render json: aspect_as_json(aspect, true)
else
render_error 404, "Aspect with provided ID could not be found"
end
end
def create
params.require(%i[name])
aspect = current_user.aspects.build(name: params[:name])
if aspect&.save
render json: aspect_as_json(aspect, true)
else
render_error 422, "Failed to create the aspect"
end
rescue ActionController::ParameterMissing
render_error 422, "Failed to create the aspect"
end
def update
aspect = current_user.aspects.where(id: params[:id]).first
if !aspect
render_error 404, "Failed to update the aspect"
elsif aspect.update!(aspect_params(true))
render json: aspect_as_json(aspect, true)
else
render_error 422, "Failed to update the aspect"
end
rescue ActionController::ParameterMissing, ActiveRecord::RecordInvalid
render_error 422, "Failed to update the aspect"
end
def destroy
aspect = current_user.aspects.where(id: params[:id]).first
if aspect&.destroy
head :no_content
else
render_error 422, "Failed to delete the aspect"
end
end
private
def aspect_params(allow_order=false)
parameters = params.permit(:name)
parameters[:order_id] = params[:order] if params.has_key?(:order) && allow_order
parameters
end
def aspect_as_json(aspect, as_full)
AspectPresenter.new(aspect).as_api_json(as_full)
end
end
end
end

View File

@@ -0,0 +1,77 @@
# frozen_string_literal: true
module Api
module V1
class BaseController < ApplicationController
include Api::OpenidConnect::ProtectedResourceEndpoint
protect_from_forgery unless: -> { request.format.json? }
protected
rescue_from Exception do |e|
logger.error e.message
logger.error e.backtrace.join("\n")
render_error 500, e.message
end
rescue_from Rack::OAuth2::Server::Resource::Bearer::Unauthorized do |e|
logger.error e.message
render_error 403, e.message
end
rescue_from Rack::OAuth2::Server::Resource::Forbidden do |e|
logger.error e.message
render_error 403, e.message
end
rescue_from ActiveRecord::RecordNotFound do |e|
logger.error e.message
render_error 404, "No record found for the given id"
end
rescue_from ActiveRecord::RecordInvalid do |e|
logger.error e.message
render_error 422, e.message
end
rescue_from ActionController::ParameterMissing do |e|
logger.error e.message
render_error 422, e.message.split("\n").first
end
def current_user
current_token ? current_token.authorization.user : nil
end
def index_pager(query)
Api::Paging::RestPaginatorBuilder.new(query, request).index_pager(params)
end
def render_paged_api_response(page)
link_header = []
link_header << %(<#{page[:links][:next]}>; rel="next") if page[:links][:next]
link_header << %(<#{page[:links][:previous]}>; rel="previous") if page[:links][:previous]
response.set_header("Link", link_header.join(", ")) if link_header.present?
render json: page[:data]
end
def render_error(code, message)
render json: {code: code, message: message}, status: code
end
def time_pager(query)
Api::Paging::RestPaginatorBuilder.new(query, request).time_pager(params)
end
def private_read?
access_token? %w[private:read]
end
def private_modify?
access_token? %w[private:modify]
end
end
end
end

View File

@@ -0,0 +1,118 @@
# frozen_string_literal: true
module Api
module V1
class CommentsController < Api::V1::BaseController
before_action except: %i[create destroy] do
require_access_token %w[public:read]
end
before_action only: %i[create destroy] do
require_access_token %w[interactions public:read]
end
rescue_from ActiveRecord::RecordNotFound do
render_error 404, "Post with provided guid could not be found"
end
rescue_from ActiveRecord::RecordInvalid do
render_error 422, "User is not allowed to comment"
end
def create
find_post
comment = comment_service.create(params.require(:post_id), params.require(:body))
rescue ActiveRecord::RecordNotFound
render_error 404, "Post with provided guid could not be found"
else
render json: comment_as_json(comment), status: :created
end
def index
find_post
comments_query = comment_service.find_for_post(params.require(:post_id))
params[:after] = Time.utc(1900).iso8601 if params.permit(:before, :after).empty?
comments_page = time_pager(comments_query).response
comments_page[:data] = comments_page[:data].map {|x| comment_as_json(x) }
render_paged_api_response comments_page
end
def destroy
find_post
if comment_and_post_validate(params.require(:post_id), params[:id])
comment_service.destroy!(params[:id])
head :no_content
end
rescue ActiveRecord::RecordInvalid
render_error 403, "User not allowed to delete the comment"
end
def report
find_post
post_guid = params.require(:post_id)
comment_guid = params.require(:comment_id)
return unless comment_and_post_validate(post_guid, comment_guid)
reason = params.require(:reason)
comment = comment_service.find!(comment_guid)
report = current_user.reports.new(
item_id: comment.id,
item_type: "Comment",
text: reason
)
if report.save
head :no_content
else
render_error 409, "This item already has been reported by this user"
end
end
private
def comment_and_post_validate(post_guid, comment_guid)
if !comment_exists(comment_guid)
render_error 404, "Comment not found for the given post"
false
elsif !comment_is_for_post(post_guid, comment_guid)
render_error 404, "Comment not found for the given post"
false
else
true
end
end
def comment_is_for_post(post_guid, comment_guid)
comments = comment_service.find_for_post(post_guid)
comment = comments.find {|comment| comment[:guid] == comment_guid }
comment ? true : false
end
def comment_exists(comment_guid)
comment = comment_service.find!(comment_guid)
comment ? true : false
rescue ActiveRecord::RecordNotFound
false
end
def comment_service
@comment_service ||= CommentService.new(current_user)
end
def post_service
@post_service ||= PostService.new(current_user)
end
def comment_as_json(comment)
CommentPresenter.new(comment, current_user).as_api_response
end
def find_post
post = post_service.find!(params[:post_id])
return post if post.public? || private_read?
raise ActiveRecord::RecordNotFound
end
end
end
end

View File

@@ -0,0 +1,62 @@
# frozen_string_literal: true
require "api/paging/index_paginator"
module Api
module V1
class ContactsController < Api::V1::BaseController
before_action except: %i[create destroy] do
require_access_token %w[contacts:read]
end
before_action only: %i[create destroy] do
require_access_token %w[contacts:modify]
end
rescue_from ActiveRecord::RecordNotFound do
render_error 404, "Aspect with provided ID could not be found"
end
def index
contacts_query = aspects_membership_service.contacts_in_aspect(params.require(:aspect_id))
contacts_page = index_pager(contacts_query).response
contacts_page[:data] = contacts_page[:data].map do |c|
ContactPresenter.new(c, current_user).as_api_json_without_contact
end
render_paged_api_response contacts_page
end
def create
aspect_id = params.require(:aspect_id)
person = Person.find_by(guid: params.require(:person_guid))
aspect_membership = aspects_membership_service.create(aspect_id, person.id) if person.present?
if aspect_membership
head :no_content
else
render_error 422, "Failed to add user to aspect"
end
rescue ActiveRecord::RecordNotUnique
render_error 422, "Failed to add user to aspect"
end
def destroy
aspect_id = params.require(:aspect_id)
person = Person.find_by(guid: params[:id])
result = aspects_membership_service.destroy_by_ids(aspect_id, person.id) if person.present?
if result && result[:success]
head :no_content
else
render_error 422, "Failed to remove user from aspect"
end
rescue ActiveRecord::RecordNotFound
render_error 404, "Aspect or contact on aspect not found"
end
def aspects_membership_service
AspectsMembershipService.new(current_user)
end
end
end
end

View File

@@ -0,0 +1,87 @@
# frozen_string_literal: true
module Api
module V1
class ConversationsController < Api::V1::BaseController
include ConversationsHelper
BOOLEAN_TYPE = ActiveModel::Type::Boolean.new
before_action do
require_access_token %w[conversations]
end
rescue_from ActiveRecord::RecordNotFound do
render_error 404, "Conversation with provided guid could not be found"
end
def index
mapped_params = {}
mapped_params[:only_after] = params[:only_after] if params.has_key?(:only_after)
mapped_params[:unread] = BOOLEAN_TYPE.cast(params[:only_unread]) if params.has_key?(:only_unread)
conversations_query = conversation_service.all_for_user(mapped_params)
conversations_page = pager(conversations_query, "conversations.created_at").response
conversations_page[:data] = conversations_page[:data].map {|x| conversation_as_json(x) }
render_paged_api_response conversations_page
end
def show
conversation = conversation_service.find!(params[:id])
render json: conversation_as_json(conversation)
end
def create
params.require(%i[subject body recipients])
recipients = recipient_ids
conversation = conversation_service.build(params[:subject], params[:body], recipients)
raise ActiveRecord::RecordInvalid unless conversation_valid?(conversation, recipients)
conversation.save!
Diaspora::Federation::Dispatcher.defer_dispatch(current_user, conversation)
render json: conversation_as_json(conversation), status: :created
rescue ActiveRecord::RecordInvalid, ActionController::ParameterMissing, ActiveRecord::RecordNotFound
render_error 422, "Couldn't accept or process the conversation"
end
def update
read = BOOLEAN_TYPE.cast(params.require(:read))
conversation = conversation_service.find!(params[:id])
conversation.update_read_for(current_user, read: read)
render json: conversation_as_json(conversation)
rescue ActiveRecord::RecordInvalid, ActionController::ParameterMissing, ActiveRecord::RecordNotFound
render_error 422, "Couldn't update the conversation"
end
def destroy
conversation = conversation_service.get_visibility(params[:id])
conversation.destroy!
head :no_content
end
private
def conversation_service
@conversation_service ||= ConversationService.new(current_user)
end
def conversation_as_json(conversation)
ConversationPresenter.new(conversation, current_user).as_api_json
end
def pager(query, sort_field)
Api::Paging::RestPaginatorBuilder.new(query, request).time_pager(params, sort_field)
end
def recipient_ids
params[:recipients].map {|p| Person.find_from_guid_or_username(id: p).id }
end
def conversation_valid?(conversation, recipients)
conversation.participants.length == (recipients.length + 1)
end
end
end
end

View File

@@ -0,0 +1,138 @@
# frozen_string_literal: true
module Api
module V1
class LikesController < Api::V1::BaseController
before_action do
require_access_token %w[public:read]
end
before_action only: %i[create destroy] do
require_access_token %w[interactions]
end
rescue_from ActiveRecord::RecordNotFound do
render_error 404, "Post with provided guid could not be found"
end
rescue_from ActiveRecord::RecordInvalid do
render_error 422, "User is not allowed to like"
end
def show
post = post_service.find!(params.require(:post_id))
raise ActiveRecord::RecordInvalid unless post.public? || private_read?
likes_query = find_likes
return unless likes_query
likes_page = index_pager(likes_query).response
likes_page[:data] = likes_page[:data].map {|x| like_json(x) }
render_paged_api_response likes_page
end
def create
post = post_service.find!(params.require(:post_id))
raise ActiveRecord::RecordInvalid unless post.public? || private_read?
if params[:comment_id].present?
create_for_comment
else
create_for_post
end
rescue ActiveRecord::RecordInvalid => e
if e.message == "Validation failed: Target has already been taken"
return render_error 409, "Like already exists"
end
raise
end
def destroy
post = post_service.find!(params.require(:post_id))
raise ActiveRecord::RecordInvalid unless post.public? || private_read?
if params[:comment_id].present?
destroy_for_comment
else
destroy_for_post
end
end
private
def find_likes
if params[:comment_id].present?
return unless comment_and_post_validate(params[:post_id], params[:comment_id])
like_service.find_for_comment(params[:comment_id])
else
like_service.find_for_post(params[:post_id])
end
end
def like_service
@like_service ||= LikeService.new(current_user)
end
def post_service
@post_service ||= PostService.new(current_user)
end
def comment_service
@comment_service ||= CommentService.new(current_user)
end
def like_json(like)
LikesPresenter.new(like).as_api_json
end
def create_for_post
like_service.create_for_post(params[:post_id])
head :no_content
end
def create_for_comment
return unless comment_and_post_validate(params[:post_id], params[:comment_id])
like_service.create_for_comment(params[:comment_id])
head :no_content
end
def destroy_for_post
if like_service.unlike_post(params[:post_id])
head :no_content
else
render_error 410, "Like doesnt exist"
end
end
def destroy_for_comment
return unless comment_and_post_validate(params[:post_id], params[:comment_id])
if like_service.unlike_comment(params[:comment_id])
head :no_content
else
render_error 410, "Like doesnt exist"
end
end
def comment_and_post_validate(post_guid, comment_guid)
if comment_is_for_post(post_guid, comment_guid)
true
else
render_error 404, "Comment not found for the given post"
false
end
end
def comment_is_for_post(post_guid, comment_guid)
comments = comment_service.find_for_post(post_guid)
comments.exists?(guid: comment_guid)
end
end
end
end

View File

@@ -0,0 +1,43 @@
# frozen_string_literal: true
module Api
module V1
class MessagesController < Api::V1::BaseController
before_action do
require_access_token %w[conversations]
end
rescue_from ActiveRecord::RecordNotFound do
render_error 404, "Conversation with provided guid could not be found"
end
def create
conversation = conversation_service.find!(params.require(:conversation_id))
text = params.require(:body)
message = current_user.build_message(conversation, text: text)
message.save!
Diaspora::Federation::Dispatcher.defer_dispatch(current_user, message)
render json: message_json(message), status: :created
rescue ActionController::ParameterMissing
render_error 422, "Couldnt accept or process the conversation"
end
def index
conversation = conversation_service.find!(params.require(:conversation_id))
messages_page = index_pager(conversation.messages).response
messages_page[:data] = messages_page[:data].map {|x| message_json(x) }
render_paged_api_response messages_page
end
private
def conversation_service
ConversationService.new(current_user)
end
def message_json(message)
MessagePresenter.new(message).as_api_json
end
end
end
end

View File

@@ -0,0 +1,57 @@
# frozen_string_literal: true
module Api
module V1
class NotificationsController < Api::V1::BaseController
BOOLEAN_TYPE = ActiveModel::Type::Boolean.new
before_action do
require_access_token %w[notifications]
end
rescue_from ActiveRecord::RecordNotFound do
render_error 404, "Notification with provided guid could not be found"
end
def show
notification = service.get_by_guid(params[:id])
if notification
render json: NotificationPresenter.new(notification).as_api_json
else
render_error 404, "Notification with provided guid could not be found"
end
end
def index
after_date = Date.iso8601(params[:only_after]) if params.has_key?(:only_after)
notifications_query = service.index(BOOLEAN_TYPE.cast(params[:only_unread]), after_date)
notifications_page = time_pager(notifications_query).response
notifications_page[:data] = notifications_page[:data].map do |note|
NotificationPresenter.new(note, default_serializer_options).as_api_json
end
render_paged_api_response notifications_page
rescue ArgumentError
render_error 422, "Could not process the notifications request"
end
def update
read = BOOLEAN_TYPE.cast(params.require(:read))
if service.update_status_by_guid(params[:id], read)
head :no_content
else
render_error 422, "Could not process the notifications request"
end
rescue ActionController::ParameterMissing
render_error 422, "Could not process the notifications request"
end
private
def service
@service ||= NotificationService.new(current_user)
end
end
end
end

View File

@@ -0,0 +1,76 @@
# frozen_string_literal: true
module Api
module V1
class PhotosController < Api::V1::BaseController
before_action except: %i[create destroy] do
require_access_token %w[public:read]
end
before_action only: %i[create destroy] do
require_access_token %w[public:modify]
end
rescue_from ActiveRecord::RecordNotFound do
render_error 404, "Photo with provided guid could not be found"
end
def index
query = if private_read?
current_user.photos
else
current_user.photos.where(public: true)
end
photos_page = time_pager(query).response
photos_page[:data] = photos_page[:data].map {|photo| photo_json(photo) }
render_paged_api_response photos_page
end
def show
photo = photo_service.visible_photo(params.require(:id))
raise ActiveRecord::RecordNotFound unless photo
raise ActiveRecord::RecordNotFound unless photo.public? || private_read?
render json: photo_json(photo)
end
def create
image = params.require(:image)
public_photo = params.has_key?(:aspect_ids)
raise RuntimeError unless public_photo || private_modify?
base_params = params.permit(:aspect_ids, :pending, :set_profile_photo)
photo = photo_service.create_from_params_and_file(base_params, image)
raise RuntimeError unless photo
render json: photo_json(photo)
rescue CarrierWave::IntegrityError, ActionController::ParameterMissing, RuntimeError
render_error 422, "Failed to create the photo"
end
def destroy
photo = current_user.photos.where(guid: params[:id]).first
raise ActiveRecord::RecordNotFound unless photo
raise ActiveRecord::RecordNotFound unless photo.public? || private_modify?
if current_user.retract(photo)
head :no_content
else
render_error 422, "Not allowed to delete the photo"
end
end
private
def photo_service
@photo_service ||= PhotoService.new(current_user)
end
def photo_json(photo)
PhotoPresenter.new(photo).as_api_json(true)
end
end
end
end

View File

@@ -0,0 +1,101 @@
# frozen_string_literal: true
module Api
module V1
class PostInteractionsController < Api::V1::BaseController
include PostsHelper
before_action do
require_access_token %w[public:read interactions]
end
rescue_from ActiveRecord::RecordNotFound do
render_error 404, "Post with provided guid could not be found"
end
def subscribe
post = find_post
return head :conflict if current_user.participations.find_by(target_id: post.id)
current_user.participate!(post)
head :no_content
rescue ActiveRecord::RecordInvalid
render_error 422, "Cannot subscribe to this post"
end
def hide
return render_error(422, "Missing parameter") if params[:hide].nil?
post = find_post
hidden = current_user.is_shareable_hidden?(post)
if (params[:hide] && !hidden) || (!params[:hide] && hidden)
current_user.toggle_hidden_shareable(post)
head :no_content
else
render_error(params[:hide] ? 409 : 410, params[:hide] ? "Post already hidden" : "Post not hidden")
end
end
def mute
post = find_post
participation = current_user.participations.find_by(target_id: post.id)
return head :gone unless participation
participation.destroy
head :no_content
end
def report
reason = params.require(:reason)
post = find_post
report = current_user.reports.new(
item_id: post.id,
item_type: "Post",
text: reason
)
if report.save
head :no_content
else
render_error 409, "Failed to create report on this post"
end
rescue ActionController::ParameterMissing
render_error 422, "Failed to create report on this post"
end
def vote
post = find_post
begin
poll_vote = poll_service.vote(post.id, params[:poll_answer])
rescue ActiveRecord::RecordNotFound
# This, but not the find_post above, should return a 422,
# we just keep poll_vote nil so it goes into the else below
end
if poll_vote
head :no_content
else
render_error 422, "Cant vote on this post"
end
rescue ActiveRecord::RecordInvalid
render_error 422, "Cant vote on this post"
end
private
def post_service
@post_service ||= PostService.new(current_user)
end
def poll_service
@poll_service ||= PollParticipationService.new(current_user)
end
def find_post
post = post_service.find!(params[:post_id])
raise ActiveRecord::RecordNotFound unless post.public? || private_read?
post
end
end
end
end

View File

@@ -0,0 +1,115 @@
# frozen_string_literal: true
module Api
module V1
class PostsController < Api::V1::BaseController
include PostsHelper
before_action except: %i[create destroy] do
require_access_token %w[public:read]
end
before_action only: %i[create destroy] do
require_access_token %w[public:modify]
end
rescue_from ActiveRecord::RecordNotFound do
render_error 404, "Post with provided guid could not be found"
end
def show
post = post_service.find!(params[:id])
raise ActiveRecord::RecordNotFound unless post.public? || private_read?
render json: post_as_json(post)
end
def create
creation_params = normalized_create_params
raise StandardError unless creation_params[:public] || private_modify?
@status_message = creation_service.create(creation_params)
render json: PostPresenter.new(@status_message, current_user).as_api_response
rescue StandardError
render_error 422, "Failed to create the post"
end
def destroy
post_service.destroy(params[:id], private_modify?)
head :no_content
rescue Diaspora::NotMine, Diaspora::NonPublic
render_error 403, "Not allowed to delete the post"
end
private
def normalized_create_params
mapped_parameters = {
status_message: {
text: params[:body]
},
public: params.require(:public),
aspect_ids: normalize_aspect_ids(params.permit(aspects: []))
}
add_location_params(mapped_parameters)
add_poll_params(mapped_parameters)
add_photo_ids(mapped_parameters)
mapped_parameters
end
def add_location_params(mapped_parameters)
return unless params.has_key?(:location)
location = params.require(:location)
mapped_parameters[:location_address] = location[:address]
mapped_parameters[:location_coords] = "#{location[:lat]},#{location[:lng]}"
end
def add_photo_ids(mapped_parameters)
return unless params.has_key?(:photos)
photo_guids = params[:photos]
return if photo_guids.empty?
photos = photo_guids.map {|guid| Photo.find_by!(guid: guid) }
.select {|p| p.author_id == current_user.person.id && p.pending }
raise InvalidArgument if photos.length != photo_guids.length
mapped_parameters[:photos] = photos
end
def add_poll_params(mapped_parameters)
return unless params.has_key?(:poll)
poll_data = params.require(:poll)
question = poll_data[:question]
answers = poll_data[:poll_answers]
raise InvalidArgument if question.blank?
raise InvalidArgument if answers.empty?
answers.each do |a|
raise InvalidArgument if a.blank?
end
mapped_parameters[:poll_question] = question
mapped_parameters[:poll_answers] = answers
end
def normalize_aspect_ids(aspects)
aspects.empty? ? [] : aspects[:aspects]
end
def post_service
@post_service ||= PostService.new(current_user)
end
def creation_service
@creation_service ||= StatusMessageCreationService.new(current_user)
end
def post_as_json(post)
PostPresenter.new(post, current_user).as_api_response
end
end
end
end

View File

@@ -0,0 +1,52 @@
# frozen_string_literal: true
module Api
module V1
class ResharesController < Api::V1::BaseController
before_action except: %i[create] do
require_access_token %w[public:read]
end
before_action only: %i[create] do
require_access_token %w[public:modify]
end
rescue_from ActiveRecord::RecordNotFound do
render_error 404, "Post with provided guid could not be found"
end
rescue_from Diaspora::NonPublic do
render_error 404, "Post with provided guid could not be found"
end
def show
reshares_query = reshare_service.find_for_post(params.require(:post_id))
reshares_page = index_pager(reshares_query).response
reshares_page[:data] = reshares_page[:data].map do |r|
{
guid: r.guid,
created_at: r.created_at,
author: PersonPresenter.new(r.author).as_api_json
}
end
render_paged_api_response reshares_page
end
def create
reshare = reshare_service.create(params.require(:post_id))
rescue ActiveRecord::RecordInvalid
render_error 409, "Reshare already exists"
rescue ActiveRecord::RecordNotFound, RuntimeError
render_error 422, "Failed to reshare"
else
render json: PostPresenter.new(reshare, current_user).as_api_response
end
private
def reshare_service
@reshare_service ||= ReshareService.new(current_user)
end
end
end
end

View File

@@ -0,0 +1,116 @@
# frozen_string_literal: true
module Api
module V1
class SearchController < Api::V1::BaseController
USER_FILTER_CONTACTS = "contacts"
USER_FILTER_RECEIVING_CONTACTS = "contacts:receiving"
USER_FILTER_SHARING_CONTACTS = "contacts:sharing"
USER_FILTER_ASPECTS_PREFIX = "aspect:"
USER_FILTERS_EXACT_MATCH = [USER_FILTER_CONTACTS, USER_FILTER_RECEIVING_CONTACTS,
USER_FILTER_SHARING_CONTACTS].freeze
USER_FILTERS_PREFIX_MATCH = [USER_FILTER_ASPECTS_PREFIX].freeze
before_action do
require_access_token %w[public:read]
end
rescue_from RuntimeError do |e|
render_error 422, e.message
end
def user_index
user_page = index_pager(people_query).response
user_page[:data] = user_page[:data].map {|p| PersonPresenter.new(p).as_api_json }
render_paged_api_response user_page
end
def post_index
posts_page = time_pager(posts_query, "posts.created_at", "created_at").response
posts_page[:data] = posts_page[:data].map {|post| PostPresenter.new(post).as_api_response }
render_paged_api_response posts_page
end
def tag_index
tags_page = index_pager(tags_query).response
tags_page[:data] = tags_page[:data].pluck(:name)
render_paged_api_response tags_page
end
private
def time_pager(query, query_time_field, data_time_field)
Api::Paging::RestPaginatorBuilder.new(query, request).time_pager(params, query_time_field, data_time_field)
end
def people_query
tag = params[:tag]
name_or_handle = params[:name_or_handle]
raise "Parameters tag and name_or_handle are exclusive" if tag.present? && name_or_handle.present?
query = if tag.present?
# scope filters to only searchable people already
Person.profile_tagged_with(tag)
elsif name_or_handle.present?
Person.searchable(contacts_read? && current_user) # rubocop:disable Rails/DynamicFindBy
.find_by_substring(name_or_handle)
else
raise "Missing parameter tag or name_or_handle"
end
query = query.where(closed_account: false)
user_filters.each do |filter|
query = query.contacts_of(current_user) if filter == USER_FILTER_CONTACTS
if filter == USER_FILTER_RECEIVING_CONTACTS
query = query.contacts_of(current_user).where(contacts: {receiving: true})
end
if filter == USER_FILTER_SHARING_CONTACTS
query = query.contacts_of(current_user).where(contacts: {sharing: true})
end
if filter.start_with?(USER_FILTER_ASPECTS_PREFIX) # rubocop:disable Style/Next
_, ids = filter.split(":", 2)
ids = ids.split(",").map {|id|
Integer(id) rescue raise("Invalid aspect filter") # rubocop:disable Style/RescueModifier
}
raise "Invalid aspect filter" unless current_user.aspects.where(id: ids).count == ids.size
query = Person.where(id: query.all_from_aspects(ids, current_user).select(:id))
end
end
query.distinct
end
def posts_query
opts = {}
opts[:public_only] = !private_read?
Stream::Tag.new(current_user, params.require(:tag), opts).stream_posts
end
def tags_query
ActsAsTaggableOn::Tag.autocomplete(params.require(:query))
end
def user_filters
@user_filters ||= Array(params[:filter]).uniq.tap do |filters|
raise "Invalid filter" unless filters.all? {|filter|
USER_FILTERS_EXACT_MATCH.include?(filter) ||
USER_FILTERS_PREFIX_MATCH.any? {|prefix| filter.start_with?(prefix) }
}
# For now all filters require contacts:read
require_access_token %w[contacts:read] unless filters.empty?
end
end
def contacts_read?
access_token? %w[contacts:read]
end
end
end
end

View File

@@ -0,0 +1,74 @@
# frozen_string_literal: true
module Api
module V1
class StreamsController < Api::V1::BaseController
before_action do
require_access_token %w[public:read]
end
before_action only: %w[aspects] do
require_access_token %w[contacts:read private:read]
end
before_action only: %w[followed_tags] do
require_access_token %w[tags:read]
end
def aspects
aspect_ids = params.has_key?(:aspect_ids) ? JSON.parse(params[:aspect_ids]) : []
@stream = Stream::Aspect.new(current_user, aspect_ids, max_time: stream_max_time)
stream_responder
end
def activity
stream_responder(Stream::Activity, "posts.interacted_at", "interacted_at")
end
def multi
stream_responder(Stream::Multi)
end
def commented
stream_responder(Stream::Comments)
end
def liked
stream_responder(Stream::Likes)
end
def mentions
stream_responder(Stream::Mention)
end
def followed_tags
stream_responder(Stream::FollowedTag)
end
private
def stream_responder(stream_klass=nil, query_time_field="posts.created_at", data_time_field="created_at")
@stream = stream_klass.present? ? stream_klass.new(current_user, max_time: stream_max_time) : @stream
query = @stream.stream_posts
query = query.where(public: true) unless private_read?
posts_page = pager(query, query_time_field, data_time_field).response
posts_page[:data] = posts_page[:data].map {|post| PostPresenter.new(post, current_user).as_api_response }
posts_page[:links].delete(:previous)
render_paged_api_response posts_page
end
def stream_max_time
if params.has_key?("before")
Time.iso8601(params["before"])
else
max_time
end
end
def pager(query, query_time_field, data_time_field)
Api::Paging::RestPaginatorBuilder.new(query, request, true, 15)
.time_pager(params, query_time_field, data_time_field)
end
end
end
end

View File

@@ -0,0 +1,41 @@
# frozen_string_literal: true
module Api
module V1
class TagFollowingsController < Api::V1::BaseController
before_action except: %i[create destroy] do
require_access_token %w[tags:read]
end
before_action only: %i[create destroy] do
require_access_token %w[tags:modify]
end
def index
render json: tag_followings_service.index.pluck(:name)
end
def create
tag_followings_service.create(params.require(:name))
head :no_content
rescue TagFollowingService::DuplicateTag
render_error 409, "Already following this tag"
rescue StandardError
render_error 422, "Failed to process the tag followings request"
end
def destroy
tag_followings_service.destroy_by_name(params.require(:id))
head :no_content
rescue ActiveRecord::RecordNotFound
render_error 410, "Not following this tag"
end
private
def tag_followings_service
@tag_followings_service ||= TagFollowingService.new(current_user)
end
end
end
end

View File

@@ -0,0 +1,145 @@
# frozen_string_literal: true
module Api
module V1
class UsersController < Api::V1::BaseController
include TagsHelper
before_action except: %i[contacts update show] do
require_access_token %w[public:read]
end
before_action only: %i[update] do
require_access_token %w[profile:modify]
end
before_action only: %i[contacts] do
require_access_token %w[contacts:read]
end
before_action only: %i[block] do
require_access_token %w[contacts:modify]
end
before_action only: %i[show] do
require_access_token %w[profile]
end
rescue_from ActiveRecord::RecordNotFound do
render_error 404, "User not found"
end
def show
person = if params.has_key?(:id)
found_person = Person.find_by!(guid: params[:id])
raise ActiveRecord::RecordNotFound unless found_person.searchable || access_token?("contacts:read")
found_person
else
current_user.person
end
render json: PersonPresenter.new(person, current_user).profile_hash_as_api_json
end
def update
params_to_update = profile_update_params
if params_to_update && current_user.update_profile(params_to_update)
render json: PersonPresenter.new(current_user.person, current_user).profile_hash_as_api_json
else
render_error 422, "Failed to update the user settings"
end
rescue RuntimeError
render_error 422, "Failed to update the user settings"
end
def contacts
if params.require(:user_id) != current_user.guid
render_error 404, "User not found"
return
end
contacts_query = aspects_service.all_contacts
contacts_page = index_pager(contacts_query).response
contacts_page[:data] = contacts_page[:data].map {|c| PersonPresenter.new(c.person).as_api_json }
render_paged_api_response contacts_page
end
def photos
person = Person.find_by!(guid: params[:user_id])
user_for_query = current_user if private_read?
photos_query = Photo.visible(user_for_query, person, :all, Time.current)
photos_page = time_pager(photos_query).response
photos_page[:data] = photos_page[:data].map {|photo| PhotoPresenter.new(photo).as_api_json(true) }
render_paged_api_response photos_page
end
def posts
person = Person.find_by!(guid: params[:user_id])
posts_query = if private_read?
current_user.posts_from(person, false)
else
Post.where(author_id: person.id, public: true)
end
posts_page = time_pager(posts_query).response
posts_page[:data] = posts_page[:data].map {|post| PostPresenter.new(post, current_user).as_api_response }
render_paged_api_response posts_page
end
def block
person = Person.find_by!(guid: params[:user_id])
service = BlockService.new(current_user)
if request.request_method_symbol == :post
begin
service.block(person)
head :created
rescue ActiveRecord::RecordNotUnique
render_error 409, "User is already blocked"
end
elsif request.request_method_symbol == :delete
begin
service.unblock(person)
head :no_content
rescue ActiveRecord::RecordNotFound
render_error 410, "User is not blocked"
end
else
raise AbstractController::ActionNotFound
end
end
private
def aspects_service
@aspects_service ||= AspectsMembershipService.new(current_user)
end
def profile_update_params
raise RuntimeError if params.has_key?(:id)
updates = params.permit(:bio, :birthday, :gender, :location, :name,
:searchable, :show_profile_info, :nsfw, :tags).to_h || {}
if updates.has_key?(:name)
updates[:first_name] = updates[:name]
updates[:last_name] = nil
updates.delete(:name)
end
if updates.has_key?(:show_profile_info)
updates[:public_details] = updates[:show_profile_info]
updates.delete(:show_profile_info)
end
process_tags_updates(updates)
updates
end
def process_tags_updates(updates)
return unless params.has_key?(:tags)
raise RuntimeError if params[:tags].length > Profile::MAX_TAGS
tags = params[:tags].map {|tag| "#" + normalize_tag_name(tag) }.join(" ")
updates[:tag_string] = tags
updates.delete(:tags)
end
end
end
end

View File

@@ -7,7 +7,6 @@
class ApplicationController < ActionController::Base
before_action :force_tablet_html
has_mobile_fu
protect_from_forgery except: :receive, with: :exception, prepend: true
rescue_from ActionController::InvalidAuthenticityToken do
if user_signed_in?
@@ -22,15 +21,12 @@ class ApplicationController < ActionController::Base
before_action :ensure_http_referer_is_set
before_action :set_locale
before_action :set_diaspora_header
before_action :set_grammatical_gender
before_action :mobile_switch
before_action :gon_set_current_user
before_action :gon_set_appconfig
before_action :gon_set_preloads
before_action :configure_permitted_parameters, if: :devise_controller?
inflection_method grammatical_gender: :gender
helper_method :all_aspects,
:all_contacts_count,
:my_contacts_count,
@@ -109,28 +105,6 @@ class ApplicationController < ActionController::Base
redirect_to stream_url, notice: "you need to be an admin or moderator to do that"
end
def set_grammatical_gender
if (user_signed_in? && I18n.inflector.inflected_locale?)
gender = current_user.gender.to_s.tr('!()[]"\'`*=|/\#.,-:', '').downcase
unless gender.empty?
i_langs = I18n.inflector.inflected_locales(:gender)
i_langs.delete I18n.locale
i_langs.unshift I18n.locale
i_langs.each do |lang|
token = I18n.inflector.true_token(gender, :gender, lang)
unless token.nil?
@grammatical_gender = token
break
end
end
end
end
end
def grammatical_gender
@grammatical_gender || nil
end
# use :mobile view for mobile and :html for everything else
# (except if explicitly specified, e.g. :json, :xml)
def mobile_switch
@@ -162,7 +136,6 @@ class ApplicationController < ActionController::Base
def gon_set_appconfig
gon.push(appConfig: {
chat: {enabled: AppConfig.chat.enabled?},
settings: {podname: AppConfig.settings.pod_name},
map: {mapbox: {
enabled: AppConfig.map.mapbox.enabled?,

View File

@@ -11,20 +11,9 @@ class AspectMembershipsController < ApplicationController
respond_to :json
def destroy
aspect = current_user.aspects.joins(:aspect_memberships).where(aspect_memberships: {id: params[:id]}).first
contact = current_user.contacts.joins(:aspect_memberships).where(aspect_memberships: {id: params[:id]}).first
raise ActiveRecord::RecordNotFound unless aspect.present? && contact.present?
raise Diaspora::NotMine unless current_user.mine?(aspect) &&
current_user.mine?(contact)
membership = contact.aspect_memberships.where(aspect_id: aspect.id).first
raise ActiveRecord::RecordNotFound unless membership.present?
# do it!
success = membership.destroy
delete_results = AspectsMembershipService.new(current_user).destroy_by_membership_id(params[:id])
success = delete_results[:success]
membership = delete_results[:membership]
# set the flash message
respond_to do |format|
@@ -39,17 +28,12 @@ class AspectMembershipsController < ApplicationController
end
def create
@person = Person.find(params[:person_id])
@aspect = current_user.aspects.where(id: params[:aspect_id]).first
aspect_membership = AspectsMembershipService.new(current_user).create(params[:aspect_id], params[:person_id])
@contact = current_user.share_with(@person, @aspect)
if @contact.present?
if aspect_membership
respond_to do |format|
format.json do
render json: AspectMembershipPresenter.new(
AspectMembership.where(contact_id: @contact.id, aspect_id: @aspect.id).first)
.base_hash
render json: AspectMembershipPresenter.new(aspect_membership).base_hash
end
end
else
@@ -59,6 +43,12 @@ class AspectMembershipsController < ApplicationController
end
end
end
rescue RuntimeError
respond_to do |format|
format.json do
render plain: I18n.t("aspects.add_to_aspect.failure"), status: :conflict
end
end
end
rescue_from ActiveRecord::StatementInvalid do

View File

@@ -72,16 +72,10 @@ class AspectsController < ApplicationController
head :no_content
end
def toggle_chat_privilege
aspect.chat_enabled = !aspect.chat_enabled
aspect.save
head :no_content
end
private
def aspect
@aspect ||= current_user.aspects.where(id: (params[:id] || params[:aspect_id])).first
@aspect ||= current_user.aspects.where(id: params[:id]).first
end
def connect_person_to_aspect(aspecting_person_id)
@@ -95,6 +89,6 @@ class AspectsController < ApplicationController
end
def aspect_params
params.require(:aspect).permit(:name, :chat_enabled, :order_id)
params.require(:aspect).permit(:name, :order_id)
end
end

View File

@@ -4,9 +4,10 @@ class BlocksController < ApplicationController
before_action :authenticate_user!
def create
block = current_user.blocks.new(block_params)
send_message(block) if block.save
begin
block_service.block(Person.find_by!(id: block_params[:person_id]))
rescue ActiveRecord::RecordNotUnique
end
respond_to do |format|
format.json { head :no_content }
@@ -15,13 +16,13 @@ class BlocksController < ApplicationController
end
def destroy
block = current_user.blocks.find_by(id: params[:id])
notice = if block&.delete
ContactRetraction.for(block).defer_dispatch(current_user)
{notice: t("blocks.destroy.success")}
else
{error: t("blocks.destroy.failure")}
end
notice = nil
begin
block_service.remove_block(current_user.blocks.find_by!(id: params[:id]))
notice = {notice: t("blocks.destroy.success")}
rescue ActiveRecord::RecordNotFound
notice = {error: t("blocks.destroy.failure")}
end
respond_to do |format|
format.json { head :no_content }
@@ -31,17 +32,11 @@ class BlocksController < ApplicationController
private
def send_message(block)
contact = current_user.contact_for(block.person)
if contact
current_user.disconnect(contact)
elsif block.person.remote?
Diaspora::Federation::Dispatcher.defer_dispatch(current_user, block)
end
end
def block_params
params.require(:block).permit(:person_id)
end
def block_service
BlockService.new(current_user)
end
end

View File

@@ -17,26 +17,11 @@ class CommentsController < ApplicationController
authenticate_user!
end
def create
begin
comment = comment_service.create(params[:post_id], params[:text])
rescue ActiveRecord::RecordNotFound
render plain: I18n.t("comments.create.error"), status: 404
return
end
if comment
respond_create_success(comment)
else
render plain: I18n.t("comments.create.error"), status: 422
end
end
def destroy
if comment_service.destroy(params[:id])
respond_destroy_success
else
respond_destroy_error
def index
comments = comment_service.find_for_post(params[:post_id])
respond_with do |format|
format.json { render json: CommentPresenter.as_collection(comments, :as_json, current_user), status: :ok }
format.mobile { render layout: false, locals: {comments: comments} }
end
end
@@ -46,11 +31,26 @@ class CommentsController < ApplicationController
end
end
def index
comments = comment_service.find_for_post(params[:post_id])
respond_with do |format|
format.json { render json: CommentPresenter.as_collection(comments), status: 200 }
format.mobile { render layout: false, locals: {comments: comments} }
def create
begin
comment = comment_service.create(params[:post_id], params[:text])
rescue ActiveRecord::RecordNotFound
render plain: I18n.t("comments.create.error"), status: :not_found
return
end
if comment
respond_create_success(comment)
else
render plain: I18n.t("comments.create.error"), status: :unprocessable_entity
end
end
def destroy
if comment_service.destroy(params[:id])
respond_destroy_success
else
respond_destroy_error
end
end

View File

@@ -30,7 +30,7 @@ class InvitationsController < ApplicationController
session[:invalid_email_invites] = invalid_emails
unless valid_emails.empty?
Workers::Mail::InviteEmail.perform_async(valid_emails.join(","), current_user.id, inviter_params)
Workers::Mail::InviteEmail.perform_async(valid_emails.join(","), current_user.id, inviter_params.to_h)
end
if emails.empty?

View File

@@ -16,8 +16,23 @@ class LikesController < ApplicationController
authenticate_user!
end
def index
like = if params[:post_id]
like_service.find_for_post(params[:post_id])
else
like_service.find_for_comment(params[:comment_id])
end
render json: like
.includes(author: :profile)
.as_api_response(:backbone)
end
def create
like = like_service.create(params[:post_id])
like = if params[:post_id]
like_service.create_for_post(params[:post_id])
else
like_service.create_for_comment(params[:comment_id])
end
rescue ActiveRecord::RecordNotFound, ActiveRecord::RecordInvalid
render plain: I18n.t("likes.create.error"), status: 422
else
@@ -36,12 +51,6 @@ class LikesController < ApplicationController
end
end
def index
render json: like_service.find_for_post(params[:post_id])
.includes(author: :profile)
.as_api_response(:backbone)
end
private
def like_service

View File

@@ -20,4 +20,14 @@ class NodeInfoController < ApplicationController
format.all { @statistics = NodeInfoPresenter.new("1.0") }
end
end
# TODO: this is only a dummy endpoint, because old versions of the ConnectionTester (<= 0.7.17.0)
# checked for this endpoint. Remove this endpoint again once most pods are updated to >= 0.7.18.0
def host_meta
render xml: <<~XML
<?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
</XRD>
XML
end
end

Some files were not shown because too many files have changed in this diff Show More