about summary refs log tree commit diff
path: root/app/models/account.rb
AgeCommit message (Collapse)Author
2019-11-04Add abilityto add oneself to lists (#12271)ThibG
* Add ability to add oneself to lists * Change search results to include oneself when searching through followers * Mark follow relation as optional in ListAccount
2019-10-09Remove auto-silence behaviour from spam check (#12117)Eugen Rochko
Fix #12113
2019-10-09Fix attachment not being re-downloaded even if file is not stored (#12125)Eugen Rochko
Change the behaviour of remotable concern. Previously, it would skip downloading an attachment if the stored remote URL is identical to the new one. Now it would not be skipped if the attachment is not actually currently stored by Paperclip.
2019-10-01Fix records not being indexed sometimes (#12024)Eugen Rochko
It's possible that after commit callbacks were not firing when exceptions occurred in the process. Also, the default Sidekiq strategy does not push indexing jobs immediately, which is not necessary and could be part of the issue too.
2019-09-11Change deletes to preserve soft-deleted statuses in unresolved reports (#11805)Eugen Rochko
Change all account actions except "none" to resolve all unresolved reports Refactor `SuspendAccountService` to be more readable
2019-08-30Add profile directory to web UI (#11688)Eugen Rochko
* Add profile directory to web UI * Add a line of bio to the directory
2019-08-16Add more accurate account search (#11537)Eugen Rochko
* Add more accurate account search When ElasticSearch is available, a more accurate search is implemented: - Using edge n-gram index for acct and display name - Using asciifolding and cjk width normalization on display names - Using Gaussian decay on account activity for additional scoring (recency) - Using followers/friends ratio for additional scoring (spamminess) - Using followers number for additional scoring (size) The exact match precedence only takes effect when the input conforms to the username format and the username part of it is complete, i.e. when the user started typing the domain part. * Support single-letter usernames * Fix tests * Fix not picking up account updates * Add weights and normalization for scores, skip zero terms queries * Use local counts for accounts index, adjust search parameters * Fix mistakes * Using updated_at of accounts is inadequate for remote accounts
2019-08-11Fix some emojis in profile metadata labels are not emojified. (#11534)kedama
2019-08-07Fix account tags not being saved correctly (#11507)Eugen Rochko
* Fix account tags not being saved correctly Regression from f371b32 Fix Tag#discoverable not returning tags where listable is nil instead of true Add notice when saving hashtags in admin UI Change public hashtag and directory pages to return 404 for forbidden tags * Remove unused locale string
2019-07-19Add ActivityPub actor representing the entire server (#11321)ThibG
* Add support for an instance actor * Skip username validation for local Application accounts * Add migration script to create instance actor * Make Codeclimate happy * Switch to id -99 for instance actor * Remove unused `icon` and `image` attributes from instance actor * Use if/elsif/else instead of return + ternary operator * Add instance actor to fresh installs * Use instance actor as instance representative Use instance actor for forwarding reports, relay operations, and spam auto-reporting. * Seed database in test environment * Fix single-user mode * Fix tests * Fix specs to accomodate for an extra `Account` * Auto-reject follows on instance actor Following an instance actor might make sense, but we are not handling that right now, so auto-reject. * Fix webfinger lookup and serialization for instance actor * Rename instance actor * Make it clear in the HTML view that the instance actor should not be blocked * Raise cache time for instance actor as there's no dynamic content * Re-use /about/more with a flash message for instance actor profile
2019-07-16Remove unused Account#magic_key (#11327)ThibG
2019-07-13Add a spam check (#11217)Eugen Rochko
* Add a spam check * Use Nilsimsa to generate locality-sensitive hashes and compare using Levenshtein distance * Add more tests * Add exemption when the message is a reply to something that mentions the sender * Use Nilsimsa Compare Value instead of Levenshtein distance * Use MD5 for messages shorter than 10 characters * Add message to automated report, do not add non-public statuses to automated report, add trust level to accounts and make unsilencing raise the trust level to prevent repeated spam checks on that account * Expire spam check data after 3 months * Add support for local statuses, reduce expiration to 1 week, always create a report * Add content warnings to the spam check and exempt empty statuses * Change Nilsimsa threshold to 95 and make sure removed statuses are removed from the spam check * Add all matched statuses into automatic report
2019-07-06Remove Salmon and PubSubHubbub (#11205)Eugen Rochko
* Remove Salmon and PubSubHubbub endpoints * Add error when trying to follow OStatus accounts * Fix new accounts not being created in ResolveAccountService
2019-06-22Change domain blocks to automatically support subdomains (#11138)Eugen Rochko
* Change domain blocks to automatically support subdomains If a more authoritative domain is blocked (example.com), then the same block will be applied to a subdomain (foo.example.com) * Match subdomains of existing accounts when blocking/unblocking domains * Improve code style
2019-06-20Add moderation API (#9387)Eugen Rochko
Fix #8580 Fix #7143
2019-06-04Refactor all ActivityPub deliveries to be serialized and signed through one ↵Eugen Rochko
concern (#10966)
2019-05-19Change bio limit from 160 to 500 (#10790)trwnh
* Change note_length validator from 160 to 500 * Change input maxlength from 160 to 500 * update bio test from 160 to 500 * Multiply a string 30 times instead of 10
2019-05-14Record account suspend/silence time and keep track of domain blocks (#10660)ThibG
* Record account suspend/silence time and keep track of domain blocks * Also unblock users who were suspended/silenced before dates were recorded * Add tests * Keep track of suspending date for users suspended through the CLI * Show accurate number of accounts that would be affected by unsuspending an instance * Change migration to set silenced_at and suspended_at * Revert "Also unblock users who were suspended/silenced before dates were recorded" This reverts commit a015c65d2d1e28c7b7cfab8b3f8cd5fb48b8b71c. * Switch from using suspended and silenced to suspended_at and silenced_at * Add post-deployment migration script to remove `suspended` and `silenced` columns * Use Account#silence! and Account#suspend! instead of updating the underlying property * Add silenced_at and suspended_at migration to post-migration * Change account fabricator to translate suspended and silenced attributes * Minor fixes * Make unblocking domains always retroactive
2019-04-07Improve blocked view of profiles (#10491)Eugen Rochko
* Revert "Fix filtering of favourited_by, reblogged_by, followers and following (#10447)" This reverts commit 120544067fcca4bf6e71ba1ffb276c451c17c656. * Revert "Hide blocking accounts from blocked users (#10442)" This reverts commit 62bafa20a112ccdddaedb25723fc819dbbcd8e9a. * 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-01Fix filtering of favourited_by, reblogged_by, followers and following (#10447)ThibG
2019-04-01Hide blocking accounts from blocked users (#10442)ThibG
* Revert "Add indication that you have been blocked in web UI (#10420)" This reverts commit bd02ec6daa974dcd3231e73826a56e08dbeedadc. * Revert "Add `blocked_by` relationship to the REST API (#10373)" This reverts commit 9745de883b198375ba23f7fde879f6d75ce2df0f. * 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 bd02ec6daa974dcd3231e73826a56e08dbeedadc * Refactor by adding `without_blocking` scope
2019-03-26Change icons of features on admin dashboard to remove bias (#10366)Eugen Rochko
Red crosses implied that it was bad/unexpected that certain features were not enabled. In reality, they are options, so showing a green or grey power-off icon is more appropriate. Add status of timeline preview as well Fix sample accounts changing too frequently due to wrong query Sample accounts are intended to be sorted by popularity
2019-03-14Admission-based registrations mode (#10250)Eugen Rochko
Fix #6856 Fix #6951
2019-03-11Squish username before validation (#10239)Aurélien Reeves
* Squish username before validation (#10101) Fix #10101 * Move before_validation hook to a private method Also add Unicode wite-spaces to the spec to support the use of squish over strip.
2019-03-08Fix setting up fields of a previously suspended account (#10222)ThibG
Fix #10177 for real
2019-03-05Fix suspended account's fields being set as empty dict instead of list (#10178)ThibG
Fixes #10177
2019-02-26Add type, limit, offset, min_id, max_id, account_id to search API (#10091)Eugen Rochko
* Add type, limit, offset, min_id, max_id, account_id to search API Fix #8939 * 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-02Make displaying application used to toot opt-in (#9897)ThibG
* Make storing and displaying application used to toot opt-in * Revert to storing application info, and display it to the author via API
2019-01-05Change note length validation to ignore mention domains and URLs (#9717)Eugen Rochko
Fix #4419
2019-01-02Improve e-mail digest (#9689)Eugen Rochko
- Reduce time-to-digest from 20 to 7 days - Fetch mentions starting from +1 day since last login - Fix case when last login is more recent than last e-mail - Do not render all mentions, only 40, but show number in subject - Do not send digest to moved accounts - Do send digest to silenced accounts
2018-12-29Add handler for Move activity (#9629)Eugen Rochko
2018-12-27Add local followers page to admin account UI (#9610)chr v1.x
* Add local followers page to admin account UI For moderation, I often find myself wondering who, locally, is following a remote user. Currently, to see this, I have to go back to the web UI, paste in their full handle, click their profile, and go to the "Followers" tab (plus, this information is incidental, and if mastodon ever decides to resolve all of the follower information, there will be no place local followers are shown). This PR adds a new page which is accessible via the "following" count on the admin's account view page, which shows the local followers. (It has filter parameters for account location to indicate that only local followers are shown, and leave room for expansion if mastodon ever decides to store the entire remote follow list). * Normalize en.yml
2018-12-26Create DomainNormalizable#normalize_domain (#9631)ysksn
2018-12-22Add moderation warnings (#9519)Eugen Rochko
* Add moderation warnings Replace individual routes for disabling, silencing, and suspending a user, as well as the report update route, with a unified account action controller that allows you to select an action (none, disable, silence, suspend) as well as whether it should generate an e-mail notification with optional custom text. That notification, with the optional custom text, is saved as a warning. Additionally, there are warning presets you can configure to save time when performing the above. * Use Account#local_username_and_domain
2018-12-17Fix regression in #9539 (#9541)Eugen Rochko
2018-12-17Remove "most popular" tab from profile directory, add responsive design (#9539)Eugen Rochko
* Remove "most popular" tab from profile directory, add responsive design * Remove unused translations
2018-12-08Cache hashtag sample accounts, and exclude ineligible ones (#9465)Eugen Rochko
2018-12-07Fix tag mb_chars comparison of profile directory (#9448)Takeshi Umeda
2018-12-06Add profile directory (#9427)Eugen Rochko
Fix #5578
2018-12-03Improve account suspension speed and completeness (#9290)Eugen Rochko
- Some associations were missing from the clean-up - Some attributes were not reset on suspension - Skip federation and streaming deletes when purging a dead domain - Move account association definitions to concern
2018-11-27Allow hyphens in the middle of remote user names (#9345)ThibG
Fixes #9309 This only allows hyphens in the middle of a username, much like dots, although I don't have a compelling reason to do so other than keeping the changes minimal.
2018-11-26Redesign admin accounts index (#9340)Eugen Rochko
* Improve overview of accounts in admin UI - Display suspended status, role, last activity and IP prominently - Default to showing local accounts - Default to not showing suspended accounts * Remove unused strings * Fix tests * Allow filtering accounts by IP mask
2018-11-19Extract counters from accounts table to account_stats table (#9295)Eugen Rochko
2018-10-04Fix link verification for remote accounts (#8868)Eugen Rochko
2018-09-18Fix performance regression in Account::Field#verifiable? (#8719)Eugen Rochko
* Fix performance regression in Account::Field#verifiable? Regression from #8703 * Fix code style issue
2018-09-18Redesign forms, verify link ownership with rel="me" (#8703)Eugen Rochko
* Verify link ownership with rel="me" * Add explanation about verification to UI * Perform link verifications * Add click-to-copy widget for verification HTML * Redesign edit profile page * Redesign forms * Improve responsive design of settings pages * Restore landing page sign-up form * Fix typo * Support <link> tags, add spec * Fix links not being verified on first discovery and passive updates
2018-08-22Add confirmation step to account suspensions (#8353)Eugen Rochko
* Add confirmation page for suspensions * Suspension confirmation closes reports, linked from report UI * Fix tests
2018-08-09Public profile endorsements (accounts picked by profile owner) (#8146)Eugen Rochko
2018-07-30Enforce username format for remote users, too (#8102)Eugen Rochko
Initially I thought there might be valid reasons for remote users to have a different, unpredicted username format. However, I now realize such a difference would be unusable and unexpected within Mastodon. Fix #8058
2018-07-03Re-add follow recommendations API (#7918)Eugen Rochko
* Re-add follow recommendations API GET /api/v1/suggestions Removed in 8efa081f210d72ed450c39ac4cde0fd84fb3d3fb due to Neo4J dependency. The algorithm uses triadic closures, takes into account suspensions, blocks, mutes, domain blocks, excludes locked and moved accounts, and prefers more recently updated accounts. * Track interactions with people you don't follow Replying to, favouriting and reblogging someone you're not following will make them show up in follow recommendations. The interactions have different weights: - Replying is 1 - Favouriting is 10 (decidedly positive interaction, but private) - Reblogging is 20 Following them, muting or blocking will remove them from the list, obviously. * Remove triadic closures, ensure potential friendships are trimmed