about summary refs log tree commit diff
path: root/spec/models
AgeCommit message (Collapse)Author
2017-09-22Do not filter statuses with unknown languages (#5045)Akihiko Odaki
2017-09-19Custom emoji (#4988)Eugen Rochko
* Custom emoji - In OStatus: `<link rel="emoji" name="coolcat" href="http://..." />` - In ActivityPub: `{ type: "Emoji", name: ":coolcat:", href: "http://..." }` - In REST API: Status object includes `emojis` array (`shortcode`, `url`) - Domain blocks with reject media stop emojis - Emoji file up to 50KB - Web UI handles custom emojis - Static pages render custom emojis as `<img />` tags Side effects: - Undo #4500 optimization, as I needed to modify it to restore shortcode handling in emojify() - Formatter#plaintext should now make sure stripped out line-breaks and paragraphs are replaced with newlines * Fix emoji at the start not being converted
2017-09-17Validate uri presence for remote status (#4985)unarist
2017-09-17Remove local_only scope in Status (#4977)Akihiko Odaki
2017-09-14Uploads for admin site settings (#4913)Eugen Rochko
* Improve OpenGraph tags for about pages * Add thumbnail admin setting * Fix error * Fix up
2017-09-07Feat add validation for report comment: characters under 1000 valid (#4833)voidSatisfaction
2017-09-06Switch to static URIs, new URI format in both protocols for new statuses (#4815)Eugen Rochko
* Decouple Status#local? from uri being nil * Replace on-the-fly URI generation with stored URIs - Generate URI in after_save hook for local statuses - Use static value in TagManager when available, fallback to tag format - Make TagManager use ActivityPub::TagManager to understand new format - Adjust tests * Use other heuristic for locality of old statuses, do not perform long query * Exclude tombstone stream entries from Atom feed * Prevent nil statuses from landing in Pubsubhubbub::DistributionWorker * Fix URI not being saved (#4818) * Add more specs for Status * Save generated uri immediately and also fix method order to minimize diff. * Fix alternate HTML URL in Atom * Fix tests * Remove not-null constraint from statuses migration to speed it up
2017-09-02Validate data of Imports (#4782)abcang
2017-08-25Pinned statuses (#4675)Eugen Rochko
* Pinned statuses * yarn manage:translations
2017-08-22Application prefs section (#2758)Colin Mitchell
* Add code for creating/managing apps to settings section * Add specs for app changes * Fix controller spec * Fix view file I pasted over by mistake * Add locale strings. Add 'my apps' to nav * Add Client ID/Secret to App page. Add some visual separation * Fix rubocop warnings * Fix embarrassing typo I lost an `end` statement while fixing a merge conflict. * Add code for creating/managing apps to settings section - Add specs for app changes - Add locale strings. Add 'my apps' to nav - Add Client ID/Secret to App page. Add some visual separation - Fix some bugs/warnings * Update to match code standards * Trigger notification * Add warning about not sharing API secrets * Tweak spec a bit * Cleanup fixture creation by using let! * Remove unused key * Add foreign key for application<->user
2017-08-21Do not try to re-subscribe to unsubscribed accounts (#4653)Eugen Rochko
2017-07-29Count all URLs in text as 23 characters flat, do not count domain part of ↵Eugen Rochko
usernames (#4427) * Count all URLs in text as 23 characters flat, do not count domain part of usernames * Add new status text counting logic to web UI
2017-07-18Add unfollow modal (optional) (#4246)Yamagishi Kazutoshi
* Add unfollow modal * unfollowing someone * remove unnecessary prop
2017-07-18Improve admin page (#4121)abcang
* Improve admin page * Fix test * Add spec * Improve select style
2017-07-14add validation to tag name (#4194)masarakki
2017-07-13Web Push Notifications (#3243)Sorin Davidoi
* feat: Register push subscription * feat: Notify when mentioned * feat: Boost, favourite, reply, follow, follow request * feat: Notification interaction * feat: Handle change of public key * feat: Unsubscribe if things go wrong * feat: Do not send normal notifications if push is enabled * feat: Focus client if open * refactor: Move push logic to WebPushSubscription * feat: Better title and body * feat: Localize messages * chore: Fix lint errors * feat: Settings * refactor: Lazy load * fix: Check if push settings exist * feat: Device-based preferences * refactor: Simplify logic * refactor: Pull request feedback * refactor: Pull request feedback * refactor: Create /api/web/push_subscriptions endpoint * feat: Spec PushSubscriptionController * refactor: WebPushSubscription => Web::PushSubscription * feat: Spec Web::PushSubscription * feat: Display first media attachment * feat: Support direction * fix: Stuff broken while rebasing * refactor: Integration with session activations * refactor: Cleanup * refactor: Simplify implementation * feat: Set VAPID keys via environment * chore: Comments * fix: Crash when no alerts * fix: Set VAPID keys in testing environment * fix: Follow link * feat: Notification actions * fix: Delete previous subscription * chore: Temporary logs * refactor: Move migration to a later date * fix: Fetch the correct session activation and misc bugs * refactor: Move migration to a later date * fix: Remove follow request (no notifications) * feat: Send administrator contact to push service * feat: Set time-to-live * fix: Do not show sensitive images * fix: Reducer crash in error handling * feat: Add badge * chore: Fix lint error * fix: Checkbox label overlap * fix: Check for payload support * fix: Rename action "type" (crash in latest Chrome) * feat: Action to expand notification * fix: Lint errors * fix: Unescape notification body * fix: Do not allow boosting if the status is hidden * feat: Add VAPID keys to the production sample environment * fix: Strip HTML tags from status * refactor: Better error messages * refactor: Handle browser not implementing the VAPID protocol (Samsung Internet) * fix: Error when target_status is nil * fix: Handle lack of image * fix: Delete reference to invalid subscriptions * feat: Better error handling * fix: Unescape HTML characters after tags are striped * refactor: Simpify code * fix: Modify to work with #4091 * Sort strings alphabetically * i18n: Updated Polish translation it annoys me that it's not fully localized :P * refactor: Use current_session in PushSubscriptionController * fix: Rebase mistake * fix: Set cacheName to mastodon * refactor: Pull request feedback * refactor: Remove logging statements * chore(yarn): Fix conflicts with master * chore(yarn): Copy latest from master * chore(yarn): Readd offline-plugin * refactor: Use save! and update! * refactor: Send notifications async * fix: Allow retry when push fails * fix: Save track for failed pushes * fix: Minify sw.js * fix: Remove account_id from fabricator
2017-07-13Make tag search case insensitive again (#4184)unarist
2017-07-06Add a setting allowing the use of system's default font in Web UI (#4033)Damien Erambert
* add a system_font_ui setting on the server * Plug the system_font_ui on the front-end * add EN/FR locales for the new setting * put Roboto after all other fonts * remove trailing whitespace so CodeClimate is happy * fix user_spec.rb * correctly write user_spect this time * slightly better way of adding the classes * add comments to the system-font stack for clarification * use .system-font for the class instead * don't use multiple lines for comments * remove trailing whitespace * use the classnames module for consistency * use `mastodon-font-sans-serif` instead of Roboto directly
2017-07-03Remove sort in Feed (#4050)Akihiko Odaki (@fn_aki@pawoo.net)
In from_redis method, statuses retrieved from the database was mapped to the IDs retrieved from Redis. It was equivalent to order from high to low because those IDs are sorted in the same order. Statuses are ordered with the ID by default, so we do not have to reorder. Sorting statuses in the database is even faster since the IDs are indexed with B-tree.
2017-06-28Overwrite old statuses with reblogs in PrecomputeFeedService (#3984)Akihiko Odaki (@fn_aki@pawoo.net)
2017-06-23Revocable sessions (#3616)Sorin Davidoi
* feat: Revocable sessions * fix: Tests using sign_in * feat: Configuration entry for the maximum number of session activations
2017-06-23Add important test for full-width hashtags (#3911)Eugen Rochko
2017-06-22Some minor change and spec for Account (#3813)Akihiko Odaki (@fn_aki@pawoo.net)
* Introduce domains method to Account relation Account had followers_domains method, which was excessively specific. Let relation of Account have domains method instead. * Move follow_mapping in Account to AccountInteractions * Introduce shared examples for AccountAvatar inclusion * Cover Account more
2017-06-22Fix regression from #3842 (#3892)Eugen Rochko
* Fix regression from #3842 Simplify the query by omitting all direct statuses. Private statuses are allowed because they are from accounts we are following (so by definition) Resolves #3887 (alternative) * Adjust test
2017-06-20Filter direct statuses in Status.as_home_timeline (#3842)Akihiko Odaki (@fn_aki@pawoo.net)
The classes using Status.as_home_timeline, namely Feed and PrecomputeFeedService are expected to filter direct statuses as FanOutWriteService does, but their filtering were incomplete or missing. This commit solves the problem by filtering direct statuses in as_home_timeline as the other similar methods such as as_public_timeline does.
2017-06-19Cover Block more (#3837)Akihiko Odaki (@fn_aki@pawoo.net)
2017-06-19Cover DomainBlock more (#3838)Akihiko Odaki (@fn_aki@pawoo.net)
2017-06-19Cover Export more (#3840)Akihiko Odaki (@fn_aki@pawoo.net)
2017-06-19Cover Favourite more (#3841)Akihiko Odaki (@fn_aki@pawoo.net)
2017-06-18Spec AccountDomainBlock (#3816)Akihiko Odaki (@fn_aki@pawoo.net)
2017-06-14Fix #2619 - When redis feed is empty, fall back to database (#3721)Eugen Rochko
* Fix #2619 - When redis feed is empty, fall back to database * Use redis value to return feed from database only while RegenerationWorker hasn't finished running * Fix specs * Replace usage of reject!
2017-06-08Fix db:seed - only run some validations when the field was changed (#3592)Eugen Rochko
* Fix db:seed - only run some validations when the field was changed * Add tests
2017-06-08Improve RuboCop rules (compatibility to Code Climate) (#3636)Yamagishi Kazutoshi
https://github.com/codeclimate/codeclimate-rubocop/blob/08f8de84ebfb39caa96391e23816877278f6441c/Gemfile.lock#L38 Code Climate is using RuboCop v0.46.0. Change several rules to maintain compatibility.
2017-06-07Use "match_array" only for order independent assertions (#3626)unarist
2017-06-06Fix tag search order and not to use tsvector (#3611)unarist
* Sort results by the name * Switch search method to simple `LIKE` matching instead of tsvector/tsquery Previously we used scores from ts_rank_cd() to sort results, but it didn't work because the function returns same score for all results. It's not for calculate similarity of single words. Sometimes this bug even push out exact matching tag from results. Additionally, PostgreSQL supports prefix searching with standard btree index. Using it offers simpler code, but also less index size and some speed.
2017-06-05Introduce StatusThreadingConcern (#3490)Matt Jankowski
* Add a StatusFilter class to identify visibility of statuses by accounts * Extract StatusThreadingConcern from Status * Clarify purpose of checking for nil account
2017-06-05Added support for configurable reserved usernames (fix of #1382) (#3566)Eugen Rochko
* Added support for configurable reserved usernames * Added reserved usernames from mastodon issue 1355 * Fix reserved usernames
2017-06-04Spec ScopedSettings (#3559)Akihiko Odaki (@fn_aki@pawoo.net)
2017-06-01Handle nil and blank cases in Account finders (#3500)Matt Jankowski
2017-05-31Expand spec coverage and refactor the `Account.find_` methods (#3485)Matt Jankowski
* Move specs for account finder methods to concern spec * Move account finder methods to concern * Improve spec wording * Use more explicit comparison to ensure correct return value * Add coverage for .find_local! and .find_remote! * Add some methods to the finder * Use arel on matching_username method * Avoid ternary in matching domain method * Simplify finder methods * Use an AccountFinder class to simplify lookup
2017-05-30Refactor User and spec (#3431)Akihiko Odaki
* Protect send_devise_notification of User * Improve spec for User
2017-05-29Extract authorization policy for viewing statuses (#3150)Jack Jennings
2017-05-23Introduce recent to Follow (#3247)Akihiko Odaki
Introduce recent to Follow, as Account and other models have. This change also adds specs for the scope and the dependents.
2017-05-22Add coverage for ReportFilter and AccountFilter (#3236)Matt Jankowski
2017-05-20Filter languages with opt out (#3175)Matt Jankowski
* Remove allowed_languages and add filtered_languages * Use filtered_languages instead of allowed_languages
2017-05-20More tests for public timeline method (#3171)Eugen Rochko
2017-05-19Account domain blocks (#2381)Eugen Rochko
* Add <ostatus:conversation /> tag to Atom input/output Only uses ref attribute (not href) because href would be the alternate link that's always included also. Creates new conversation for every non-reply status. Carries over conversation for every reply. Keeps remote URIs verbatim, generates local URIs on the fly like the rest of them. * Conversation muting - prevents notifications that reference a conversation (including replies, favourites, reblogs) from being created. API endpoints /api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute Currently no way to tell when a status/conversation is muted, so the web UI only has a "disable notifications" button, doesn't work as a toggle * Display "Dismiss notifications" on all statuses in notifications column, not just own * Add "muted" as a boolean attribute on statuses JSON For now always false on contained reblogs, since it's only relevant for statuses returned from the notifications endpoint, which are not nested Remove "Disable notifications" from detailed status view, since it's only relevant in the notifications column * Up max class length * Remove pending test for conversation mute * Add tests, clean up * Rename to "mute conversation" and "unmute conversation" * Raise validation error when trying to mute/unmute status without conversation * Adding account domain blocks that filter notifications and public timelines * Add tests for domain blocks in notifications, public timelines Filter reblogs of blocked domains from home * Add API for listing and creating account domain blocks * API for creating/deleting domain blocks, tests for Status#ancestors and Status#descendants, filter domain blocks from them * Filter domains in streaming API * Update account_domain_block_spec.rb
2017-05-16Improve Account#triadic_closures (#3079)alpaca-tc
2017-05-16Optimize Status#permitted_for 24x (#3069)alpaca-tc
* Build query with arel node * Add spec for current Status#permitted_for implementation * Refactor status.rb * Order by visibility to optimize query
2017-05-15Feature conversations muting (#3017)Eugen Rochko
* Add <ostatus:conversation /> tag to Atom input/output Only uses ref attribute (not href) because href would be the alternate link that's always included also. Creates new conversation for every non-reply status. Carries over conversation for every reply. Keeps remote URIs verbatim, generates local URIs on the fly like the rest of them. * Conversation muting - prevents notifications that reference a conversation (including replies, favourites, reblogs) from being created. API endpoints /api/v1/statuses/:id/mute and /api/v1/statuses/:id/unmute Currently no way to tell when a status/conversation is muted, so the web UI only has a "disable notifications" button, doesn't work as a toggle * Display "Dismiss notifications" on all statuses in notifications column, not just own * Add "muted" as a boolean attribute on statuses JSON For now always false on contained reblogs, since it's only relevant for statuses returned from the notifications endpoint, which are not nested Remove "Disable notifications" from detailed status view, since it's only relevant in the notifications column * Up max class length * Remove pending test for conversation mute * Add tests, clean up * Rename to "mute conversation" and "unmute conversation" * Raise validation error when trying to mute/unmute status without conversation