Commit Graph

43 Commits (0e513ff862faf7fa9e5b89d2ab7d22fd0ab540ff)

Author SHA1 Message Date
ThibG 290932602b Reduce usage of LD signatures (#9659)
* Do not LDS-sign Follow, Accept, Reject, Undo, Block

* Do not use LDS for Create activities of private toots

* Minor cleanup

* Ignore unsigned activities instead of misattributing them

* Use status.distributable? instead of querying visibility directly
6 years ago
Eugen Rochko 6d59dfa15d
Optimize the process of following someone (#9220)
* Eliminate extra accounts select query from FollowService

* Optimistically update follow state in web UI and hide loading bar

Fix #6205

* Asynchronize NotifyService in FollowService

And fix failing test

* Skip Webfinger resolve routine when called from FollowService if possible

If an account is ActivityPub, then webfinger re-resolving is not necessary
when called from FollowService. Improve options of ResolveAccountService
6 years ago
ThibG abc5548cca Do not process outgoing mentions to suspended accounts (#8272) 6 years ago
Eugen Rochko 658cbc9425
Improve PostStatusService performance (#7317)
Offload creation of local notifications to a worker. Remove two
redundant SQL queries from ProcessMentionsService, remove n+1
XML/JSON serialization via memoization
7 years ago
Eugen Rochko ff87d1bc3e
Rescue SSL errors when processing mentions, remove useless line (#7184) 7 years ago
Akihiko Odaki 613e7c7521 Rename ResolveRemoteAccountService to ResolveAccountService (#6327)
The service used to be named ResolveRemoteAccountService resolves local
accounts as well.
7 years ago
ThibG cea98e0c12 Reduce the number of synchronous resolves when posting toots (#6075) 7 years ago
ThibG b8efb5daed Fix handling of temporary failures in ProcessMentionsService (#5842)
* Add test for temporary account resolving failures in ProcessMentionsService

* Fix processing of mentions to already-known remote accounts on temporary failures
7 years ago
ThibG 1c25853842 Use already-known remote user data if resolving temporarily fails in mentions (#5702) 7 years ago
ThibG 889ada5ee2 Fix process mentions for local users, as local users are considered to use OStatus (#5618) 7 years ago
ThibG 5d5c0f4f43 Twidere mention workaround (#5552)
* Work around Twidere and Tootdon bug

Tootdon and Twidere construct @user@domain handles from mentions in toots based
solely on the mention text and account URI's domain without performing any
webfinger call or retrieving account info from the Mastodon server.

As a result, when a remote user has WEB_DOMAIN ≠ LOCAL_DOMAIN, Twidere and
Tootdon will construct the mention as @user@WEB_DOMAIN. Now, this will usually
resolve to the correct account (since the recommended configuration is to have
WEB_DOMAIN perform webfinger redirections to LOCAL_DOMAIN) when processing
mentions, but won't do so when displaying them (as it does not go through the
whole account resolution at that time).

This change rewrites mentions to the resolved account, so that displaying the
mentions will work.

* Use lookbehind instead of non-capturing group in MENTION_RE

Indeed, substitutions with the previous regexp would erroneously eat any
preceding whitespace, which would lead to concatenated mentions in the
previous commit.

Note that users will “lose” up to one character space per mention for their
toots, as that regexp is also used to remove the domain-part of mentioned
users for character counting purposes, and it also erroneously removed the
preceding character if it was a space.
7 years ago
ThibG 84cfee2488 Do not process undeliverable mentions (#5598)
* Resolve remote accounts when mentioned even if they are already known

This commit reduces the risk of not having up-to-date public key or protocol
information for a remote account, which is required to deliver toots
(especially direct messages).

* Do not add mentions in private messages for remote users we cannot deliver to

Mastodon does not deliver private and direct toots to OStatus users, as there
is no guarantee the remote software understands the toot's privacy. However,
users currently do not get any feedback on it (Mastodon won't attempt delivery,
but the toot will be displayed exactly the same way to the user).

This change introduces *some* feedback by not processing mentions that are
not going to be delivered. A long-term solution is still needed to have
delivery receipts or at least some better indication of what is going on, but
at least an user can see *something* is up.
7 years ago
ThibG 7bea1530f4 Resolve remote accounts when mentioned even if they are already known (#5539)
This commit reduces the risk of not having up-to-date public key or protocol
information for a remote account, which is required to deliver toots
(especially direct messages).
7 years ago
ThibG 89c77fe225 Instantiate service classes for each call (fixes #5540) (#5543) 7 years ago
Eugen Rochko e528114c53 Follow-up to #4582 and #5027, removing dead code (#5101) 7 years ago
Eugen Rochko e821c00e74 Fix mentions in direct statuses not being delivered via AP (#4806) 7 years ago
Eugen Rochko 390bfec6da Avoid sending some ActivityPub payloads if the receiver will get them through distribution (#4739) 7 years ago
Eugen Rochko 00840f4f2e Add handling of Linked Data Signatures in payloads (#4687)
* Add handling of Linked Data Signatures in payloads

* Add a way to sign JSON, fix canonicalization of signature options

* Fix signatureValue encoding, send out signed JSON when distributing

* Add missing security context
7 years ago
Eugen Rochko cf615abbf9 Add configuration to disable private status federation over PuSH (#4582) 7 years ago
Eugen Rochko b7370ac8ba ActivityPub delivery (#4566)
* Deliver ActivityPub Like

* Deliver ActivityPub Undo-Like

* Deliver ActivityPub Create/Announce activities

* Deliver ActivityPub creates from mentions

* Deliver ActivityPub Block/Undo-Block

* Deliver ActivityPub Accept/Reject-Follow

* Deliver ActivityPub Undo-Follow

* Deliver ActivityPub Follow

* Deliver ActivityPub Delete activities

Incidentally fix #889

* Adjust BatchedRemoveStatusService for ActivityPub

* Add tests for ActivityPub workers

* Add tests for FollowService

* Add tests for FavouriteService, UnfollowService and PostStatusService

* Add tests for ReblogService, BlockService, UnblockService, ProcessMentionsService

* Add tests for AuthorizeFollowService, RejectFollowService, RemoveStatusService

* Add tests for BatchedRemoveStatusService

* Deliver updates to a local account to ActivityPub followers

* Minor adjustments
7 years ago
Eugen Rochko f3be605286 Rename FollowRemoteAccountService to ResolveRemoteAccountService (#3847)
Rename Activitypub to ActivityPub
7 years ago
beatrix 3dcb5fa28f Revert HTML CW changes (#3020)
* selectively Revert "Fix regressions from #2683 (#2970)"

This reverts commit 72698bc3b4.

* Revert "Handle hashtags in spoiler_texts (partial fix for #699) (#2683)"

This reverts commit e2491680e6.
8 years ago
Eugen Rochko 72698bc3b4 Fix regressions from #2683 (#2970)
* Fix regressions from #2683

Properly format spoiler text HTML, while keeping old logic for blankness intact
Process hashtags and mentions in spoiler text
Format spoiler text for Atom
Change "show more" toggle into a button instead of anchor
Fix style regression on dropdowns for detailed statuses

* Fix lint issue

* Convert spoiler text to plaintext in desktop notifications
8 years ago
Eugen Rochko a5daa806f2 Fix casuality of processing remote mentions such that notifications
about them would be processed only after the entire status is processed
8 years ago
Eugen Rochko dc851c922e Mentions in private statuses allow mentioned people to see them 8 years ago
Eugen Rochko 149887a0ff Make follow requests federate 8 years ago
Eugen Rochko 251b04298e Fix undesired delivering of private toot to remote accounts that follow author 8 years ago
Eugen Rochko f729cfc881 Private posts mentioning non-followers should not notify them, neither locally nor via Salmon 8 years ago
Eugen Rochko da2ef4d676 Adding unified streamable notifications 8 years ago
Eugen Rochko fdc17bea58 Fix rubocop issues, introduce usage of frozen literal to improve performance 8 years ago
Eugen Rochko 70e9dd0b5b Blocking will prevent e-mail notifications from blocked user, blocks in UI 8 years ago
Eugen Rochko 927333f4f8 Improve code style 8 years ago
Eugen Rochko 9863196f7b Small rubocop offences removed 8 years ago
Eugen Rochko 183a23943b Fix how other services used old FollowRemoteAccountService 8 years ago
Eugen Rochko 29996a7e8b Fix wrongful mentions breaking status update 8 years ago
Eugen Rochko 54ea7f5dfe Case-insensitive search by usernames 8 years ago
Eugen Rochko 85b00d19b8 Moving Salmon notifications to background processing, fixing mini-profiler
behaviour with Turbolinks enabled, optimizing Rabl for production
9 years ago
Eugen Rochko a08e724476 Fix subscriptions:clear task, refactor feeds, refactor streamable activites
and atom feed generation to some extent, as well as the way mentions are
stored
9 years ago
Eugen Rochko 2b116131d7 Adding e-mail notifications about mentions, follows, favourites and reblogs. Fixing another mention recording bug 9 years ago
Eugen Rochko 580b91c387 Fix more subtle bugs with first_or_create 9 years ago
Eugen Rochko d022975444 Fixing small bug with FollowRemoteAccountService usage 9 years ago
Eugen Rochko 11ff92c9d7 Adding a test for ReblogService, fixing mentions for remote statuses 9 years ago
Eugen Rochko 71fe24096c Adding a Mention model, test stubs 9 years ago