Commit Graph

61 Commits (861b35dd54d266bc0a40b3cacb28e5b82ff6faaa)

Author SHA1 Message Date
Claire 9a3be0ad68
Fix error when looking handle with surrounding spaces () 2022-05-02 01:00:08 +02:00
Eugen Rochko 8f6c67bfde
Fix performance of account timelines ()
* Fix performance of account timelines

* Various fixes and improvements

* Fix duplicate results being returned

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

* Fix grouping for pinned statuses scope

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2022-03-08 09:14:39 +01:00
Eugen Rochko edf09ec747
Add `/api/v1/accounts/familiar_followers` to REST API ()
* Add `/api/v1/accounts/familiar_followers` to REST API

* Change hide network preference to be stored consistently for local and remote accounts

* Add dummy classes to migration

* Apply suggestions from code review

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2022-03-07 09:36:47 +01:00
Claire d5c9feb7b7
Add support for private pinned posts ()
* Add support for private pinned toots

* Allow local user to pin private toots

* Change wording to avoid "direct message"
2022-01-17 00:49:55 +01:00
Eugen Rochko 7de0ee7aba
Remove Keybase integration () 2021-11-26 05:58:18 +01:00
abcang d0fc69d721
Further improve the media attached status query for accounts () 2021-04-26 18:57:46 +02:00
abcang 1f47511023
Improve media attached status query () 2021-04-25 06:34:48 +02:00
Eugen Rochko e31ed27485
Add `GET /api/v1/accounts/lookup` REST API () 2021-02-16 15:28:32 +01:00
trwnh 4950e59cdc
Use existing FeaturedTag serializer and delete AccountFeaturedTag serializer ()
* Update featured_tags_controller.rb

* Update featured_tag_serializer.rb

* Update featured_tag_serializer.rb

* Delete account_featured_tag_serializer.rb

* please codeclimate

* please codeclimate
2020-12-23 16:43:38 +01:00
Takeshi Umeda 44d5c6bc8f
Fix incorrect conditions for suspended accounts in Get API for account featured tags () 2020-12-04 04:22:35 +01:00
Eugen Rochko e6b272e5c9
Change REST API to return empty data for suspended accounts () 2020-09-11 15:16:29 +02:00
Takeshi Umeda 33ad850c98
Added account featured tags API () 2020-09-02 02:13:10 +02:00
Akihiko Odaki 64ef37b89d
Introduce ApplicationController#cache_collection_paginated_by_id ()
* Replace incorrect use of distinct with group

Some uses of ActiveRecord::QueryMethods#distinct pass field names but they
are incorrect for the current version of Rails.

ActiveRecord::QueryMethods#group provides the expected behavior and
benefits performance. See commit 6da24aad4cafdef8d8a2c92bac2002a5fc2fe9c8.

* Introduce ApplicationController#cache_collection_paginated_by_id

ApplicationController#cache_collection_paginated_by_id fuses
ApplicationController#cache_collection and Paginable.paginate_by_id.

An advantage of this method is that it prevents from modifying scope which
Paginable.paginate_by_id may provide.
ApplicationController#cache_collection always return an array and there
is no possibility of the scope modification. It is also clear for a
programmer, considering the implication of "cache".

This method can also emit more efficient queries by using
Cacheable.cache_ids before calling Paginable.paginate_by_id.
2020-08-28 12:31:56 +02:00
Akihiko Odaki e26e7a1cb5
Replace incorrect use of distinct with group ()
Some uses of ActiveRecord::QueryMethods#distinct pass field names but they
are incorrect for the current version of Rails.

ActiveRecord::QueryMethods#group provides the expected behavior and
benefits performance. See commit 6da24aad4cafdef8d8a2c92bac2002a5fc2fe9c8.
2020-08-28 12:29:59 +02:00
ThibG 65506bac3f
Add user notes on accounts ()
* Add UserNote model

* Add UI for user notes

* Put comment in relationships entity

* Add API to create user notes

* Copy user notes to new account when receiving a Move activity

* Address some of the review remarks

* Replace modal by inline edition

* Please CodeClimate

* Button design changes

* Change design again

* Cancel note edition when pressing Escape

* Fixes

* Tweak design again

* Move “Add note” item, and allow users to add notes to themselves

* Rename UserNote into AccountNote, rename “comment” Relationship attribute to “note”
2020-06-30 19:19:50 +02:00
ThibG f1e0fa80f6
Fix own following/followers not showing muted users ()
Fixes 
2020-05-08 20:36:34 +02:00
ThibG b154428e14
Add federation support for the "hide network" preference ()
* Change ActivityPub follower/following collections to not link first page

* Add support for hiding followers and following of remote users

* Switch to using a single `hide_collections` column

* Address code style remarks
2020-03-09 00:10:29 +01:00
Eugen Rochko 0ae5c6312f
Remove useless `respond_to` calls () 2020-03-06 01:29:38 +01:00
ThibG 3b3bdc7293 Hide blocked users from more places ()
* Hide blocked, muted, and blocked-by users from toot favourite lists

* Hide blocked, muted, and blocked-by users from toot reblog lists

* Hide blocked, muted, and blocked-by users from followers/following (API)

* Fix tests

* Hide blocked, muted, and blocked-by users from followers/following on public pages
2019-12-31 00:55:32 +01:00
Eugen Rochko 2999c95596
Fix error when fetching followers/following from REST API when user has network hidden ()
Fix 
2019-12-31 00:54:38 +01:00
Jennifer Glauche fd93a9c871 make it not return http 400 when passing and empty source argument ()
* make it not return http 400 when passing and empty source argument

* create a spec for the empty source hash bug

* compact checks for nil, empty? parameters

* use nil.blank? instead checking for nil
2019-11-16 19:02:09 +01:00
abcang 059945c97c Improve status pin query () 2019-09-27 15:23:30 +02:00
Eugen Rochko 70ae77895f
Fix error in REST API for an account's statuses () 2019-08-30 02:49:44 +02:00
Eugen Rochko 699db454c3
Fix pinned statuses API returning pagination headers ()
Fix 
2019-08-08 23:04:04 +02:00
Eugen Rochko 67b3b62b98
Improve blocked view of profiles ()
* Revert "Fix filtering of favourited_by, reblogged_by, followers and following ()"

This reverts commit 120544067f.

* Revert "Hide blocking accounts from blocked users ()"

This reverts commit 62bafa20a1.

* Improve blocked view of profiles

- Change "You are blocked" to "Profile unavailable"
- Hide following/followers in API when blocked
- Disable follow button and show "Profile unavailable" on public profile as well
2019-04-07 04:59:13 +02:00
ThibG 62bafa20a1 Hide blocking accounts from blocked users ()
* Revert "Add indication that you have been blocked in web UI ()"

This reverts commit bd02ec6daa.

* Revert "Add `blocked_by` relationship to the REST API ()"

This reverts commit 9745de883b.

* Hide blocking accounts from search results

* Filter blocking accouts from account followers

* Filter blocking accouts from account's following accounts

* Filter blocking accounts from “reblogged by” and “favourited by” lists

* Remove blocking account from URL search

* Return 410 on trying to fetch user data from a user who blocked us

* Return 410 in /api/v1/account/statuses for suspended or blocking accounts

* Fix status filtering when performing URL search

* Restore some React improvements

Restore some cleanup from bd02ec6daa

* Refactor by adding `without_blocking` scope
2019-04-01 20:06:13 +02:00
Alex Gessner 69141dca26 squashed identity proof updates () 2019-03-28 18:01:09 +01:00
Eugen Rochko 06663fcf87
Fix `tagged` param not being normalized before querying tags () 2019-03-13 13:02:13 +01:00
abcang a5e7ada62f Improve account media query () 2019-02-26 15:23:24 +01:00
Eugen Rochko e7f20cc43f
Add type, limit, offset, min_id, max_id, account_id to search API ()
* Add type, limit, offset, min_id, max_id, account_id to search API

Fix 

* Make the offset work on accounts and hashtags search as well

* Assure brakeman we are not doing mass assignment here

* Do not allow paginating unless a type is chosen

* Fix search query and index id field on statuses instead of created_at
2019-02-26 15:21:36 +01:00
Eugen Rochko 364f2ff9aa
Add featured hashtags to profiles ()
* Add hashtag filter to profiles

GET /@:username/tagged/:hashtag
GET /api/v1/accounts/:id/statuses?tagged=:hashtag

* Display featured hashtags on public profile

* Use separate model for featured tags

* Update featured hashtag counters on-write

* Limit featured tags to 10
2019-02-04 04:25:59 +01:00
Eugen Rochko ee1ba59692
Add exclude_reblogs option to account statuses API ()
Fix 
2018-12-27 03:42:35 +01:00
Eugen Rochko 108b2139cd
Allow unauthenticated REST API access to GET /api/v1/accounts/:id/statuses ()
Fix 

The same data is available over the ActivityPub outbox, RSS, and Atom, so
there is little benefit to keeping it limited in this method.
2018-12-20 01:30:43 +01:00
Eugen Rochko 73be8f38c1
Add profile directory ()
Fix 
2018-12-06 17:36:11 +01:00
Eugen Rochko d6b9a62e0a
Extract counters from accounts table to account_stats table () 2018-11-19 00:43:52 +01:00
Eugen Rochko f0fff3eb10
Support min_id-based pagination in REST API ()
* Allow min_id pagination in Feed#get

* Add min_id pagination to home and list timeline APIs

* Add min_id pagination to account statuses, public and tag APIs

* Remove unused stub in reports API

* Use min_id pagination in notifications, favourites, and fix order

* Fix HomeFeed#from_database not using paginate_by_id
2018-09-28 02:23:45 +02:00
Eugen Rochko f2404de871
Public profile endorsements (accounts picked by profile owner) () 2018-08-09 09:56:53 +02:00
Eugen Rochko 1f6ed4f86a
Add more granular OAuth scopes ()
* Add more granular OAuth scopes

* Add human-readable descriptions of the new scopes

* Ensure new scopes look good on the app UI

* Add tests

* Group scopes in screen and color-code dangerous ones

* Fix wrong extra scope
2018-07-05 18:31:35 +02:00
Eugen Rochko a58ec29631
Allow selecting default posting language instead of auto-detect ()
* Allow selecting default posting language instead of auto-detect

* Enable default language setting in credentials API

* Fix form saving
2018-06-17 18:57:31 +02:00
Eugen Rochko 1e02dc8715
Add preference to hide following/followers lists ()
* Add preference to hide following/followers lists

- Public pages
- ActivityPub collections (does not return pages but does give total)
- REST API (unless it's your own) (does not federate)

Fix 

* Add preference

* Add delegation

* Fix issue

* Fix issue
2018-05-18 02:26:51 +02:00
Akihiko Odaki 77cd6b5096 Do not use permitted_for scope when querying pinned statuses ()
permitted_for scope is slow when combined with pinned status scope.
Fortunately permitted_for scope can safely be removed because a pinned
status is always public.
2018-05-16 12:30:14 +02:00
Eugen Rochko 42cd363542
Bot nameplates ()
* Store actor type in database

* Add bot nameplate to web UI, add setting to preferences, API, AP
Fix 

* Fix code style issues
2018-05-07 09:31:07 +02:00
Eugen Rochko cae933510c
Allow updating bio fields via PUT /api/v1/accounts/update_credentials ()
Add raw bio fields to the source attribute on GET /api/v1/accounts/verify_credentials
2018-05-02 15:57:37 +02:00
Levi Bard cd0eaa349c Enable updating additional account information from user preferences via rest api ()
* Enable updating additional account information from user preferences via rest api
Resolves 

* Pacify rubocop

* Decoerce incoming settings in UserSettingsDecorator

* Create user preferences hash directly from incoming credentials instead of going through ActionController::Parameters

* Clean up user preferences update

* Use ActiveModel::Type::Boolean instead of manually checking stringified number equivalence
2018-04-08 13:43:10 +02:00
Eugen Rochko 33513753b9
Fix unpermitted parameters warning when generating pagination URLs () 2018-04-02 02:09:50 +02:00
abcang 37b043d447 Improve performance of account_media_status_ids () 2018-03-10 17:44:26 +01:00
Eugen Rochko fce8464077
Ensure that boolean params in the API are parsed for truthiness ()
Use Rails smart boolean cast to account for values such as "f",
"0", "false", etc. Previously, if a param was present in the request,
it would count as true.
2018-03-01 02:47:59 +01:00
Eugen Rochko 4bc625166e
Fix bug in relationships API introduced by ()
It was merge when it needed to be deep_merge. And added some tests
2018-02-21 23:22:12 +01:00
Konrad Pozniak bb26cdda24 add parameter locked to /api/v1/update_credentials () 2018-02-18 22:57:53 +01:00
abcang 3f35d43222 Exclude nil from relationships array () 2018-02-04 12:32:10 +01:00