Commit graph

72 commits

Author SHA1 Message Date
Eugen Rochko
1714ea5978
Add ActivityPub representation for identity proofs ()
* Add ActivityPub representation for identity proofs

* Add tests
2019-03-30 02:12:06 +01:00
Eugen Rochko
f1bc90ab50
Rename :poll to :preloadable_poll and :owned_poll to :poll on Status ()
Also, fix some n+1 queries

Resolve 
2019-03-28 04:44:59 +01:00
Eugen Rochko
11fe293e1b
Remove unused ActivityPub @context values depending on response ()
Fix 
2019-03-27 15:55:23 +01:00
ThibG
a20354a20b Set and store report URIs ()
Fixes 
2019-03-17 15:34:56 +01:00
ThibG
3a92885a86 Support pushing and receiving updates to poll tallies ()
* Process incoming poll tallies update

* Send Update on poll vote

* Do not send Updates for a poll more often than once every 3 minutes

* Include voters in people to notify of results update

* Schedule closing poll worker on poll creation

* Add new notification type for ending polls

* Add front-end support for ended poll notifications

* Fix UpdatePollSerializer

* Fix Updates not being triggered by local votes

* Fix tests failure

* Fix web push notifications for closing polls

* Minor cleanup

* Notify voters of both remote and local polls when those close

* Fix delivery of poll updates to mentioned accounts and voters
2019-03-11 00:49:31 +01:00
Eugen Rochko
054bbb3da2
Immediately display poll results to poll author ()
* Immediately display poll results to poll author

* Refactor Poll#loaded_options and add Poll#voted? to improve DRYness
2019-03-07 22:53:47 +01:00
Eugen Rochko
ac99b3465e
Fix NoMethodError in ActivityPub::NoteSerializer () 2019-03-05 05:09:01 +01:00
Eugen Rochko
a198add83b
Fix various issues in polls ()
* Fix ActivityPub poll results being serialized even with hide_totals

* Fix poll refresh button having a different font size

* Display poll in OpenGraph description

* Fix NoMethodError when serializing votes

Regression from 

* Fix polls on public pages being broken for non-logged-in users

* Do not show time remaining if poll has no expiration date
2019-03-05 03:51:18 +01:00
ThibG
833ffce2df Store remote votes URI ()
* Store remote votes URI

* Add spec for accepting remote votes

* Make poll vote id generation work the same way as follows
2019-03-04 22:51:23 +01:00
Eugen Rochko
1a7de769a3
Fix ActivityPub votes having nil IDs () 2019-03-04 01:53:58 +01:00
Eugen Rochko
3cf98aac66
Fix missing in_reply_to in ActivityPub::VoteSerializer () 2019-03-04 01:06:19 +01:00
Eugen Rochko
230a012f00
Add polls ()
* Add polls

Fix 

* Add tests

* Fixes

* Change API for creating polls

* Use name instead of content for votes

* Remove poll validation for remote polls

* Add polls to public pages

* When updating the poll, update options just in case they were changed

* Fix public pages showing both poll and other media
2019-03-03 22:18:23 +01:00
ThibG
ee7d79c0ce Fix serialization of boosts ()
The condition introduced by  was wrong, serializing boosts
that weren't self-boosts, and not serializing self-boosts.
2019-02-28 21:35:16 +01:00
ThibG
d8498b3983 Give the replies collection an identifier and enable pagination () 2019-02-28 18:16:34 +01:00
ThibG
9d3c6f1849 Improved remote thread fetching ()
* Fetch up to 5 replies when discovering a new remote status

This is used for resolving threads downwards. The originating
server must add a “replies” attributes with such replies for it to
be useful.

* Add some tests for ActivityPub::FetchRepliesWorker

* Add specs for ActivityPub::FetchRepliesService

* Serialize up to 5 public self-replies for ActivityPub notes

* Add specs for ActivityPub::NoteSerializer

* Move exponential backoff logic to a worker concern

* Fetch first page of paginated collections when fetching thread replies

* Add specs for paginated collections in replies

* Move Note replies serialization to a first CollectionPage

The collection isn't actually paginable yet as it has no id nor
a `next` field. This may come in another PR.

* Use pluck(:uri) instead of map(&:uri) to improve performances

* Fix fetching replies when they are in a CollectionPage
2019-02-28 15:22:21 +01:00
ThibG
6a5307a573 Alternative handling of private self-boosts ()
* When self-boosting, embed original toot into Announce serialization

* Process unknown self-boosts from Announce object if it is more than an URI

* Add some self-boost specs

* Only serialize private toots in self-Announces
2019-02-13 18:36:23 +01:00
Eugen Rochko
0f938ff29c
Add handler for Move activity () 2018-12-29 02:24:36 +01:00
Eugen Rochko
6d2080a74b
Add account hashtags to ActivityPub actor JSON () 2018-12-13 05:22:01 +01:00
Eugen Rochko
ddd30f331c
Improve support for aspects/circles ()
* Add silent column to mentions

* Save silent mentions in ActivityPub Create handler and optimize it

Move networking calls out of the database transaction

* Add "limited" visibility level masked as "private" in the API

Unlike DMs, limited statuses are pushed into home feeds. The access
control rules between direct and limited statuses is almost the same,
except for counter and conversation logic

* Ensure silent column is non-null, add spec

* Ensure filters don't check silent mentions for blocks/mutes

As those are "this person is also allowed to see" rather than "this
person is involved", therefore does not warrant filtering

* Clean up code

* Use Status#active_mentions to limit returned mentions

* Fix code style issues

* Use Status#active_mentions in Notification

And remove stream_entry eager-loading from Notification
2018-10-17 17:13:04 +02:00
ThibG
63484ee17a Do not check for file existence when serializing ActivityPub actor ()
When serializing an ActivityPub actor, Mastodon checks for the existence
of the avatar/header files. This is not necessary, only check if avatar/header
is set.

fd8bf49d38/README.md (checking-a-file-exists)
2018-08-23 16:39:22 +02:00
Eugen Rochko
e55dce3176
Add federation relay support ()
* Add federation relay support

* Add admin UI for managing relays

* Include actor on relay-related activities

* Fix i18n
2018-07-13 02:16:06 +02:00
Eugen Rochko
fc09b3722a
Always send content for backwards-compatibility () 2018-06-18 23:58:13 +02:00
Eugen Rochko
908a9671d0
Serialize language into ActivityPub JSON ()
* Serialize language into ActivityPub JSON

* Only use contentMap if language is present
2018-06-18 22:43:01 +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
2f63d52b92
Fallback to old on-the-fly URI for follows/blocks if no stored URI ()
Fix 
2018-05-05 23:07:51 +02:00
Eugen Rochko
6793bec4c6
Store URIs of follows, follow requests and blocks for ActivityPub ()
Same URI passed between follow request and follow, since they are
the same thing in ActivityPub. Local URIs are generated during
creation using UUIDs and are passed to serializers.
2018-05-04 21:14:34 +02:00
Eugen Rochko
2c1f7b2ece
Better pagination for ActivityPub outbox () 2018-05-04 19:19:11 +02:00
Eugen Rochko
78ed4ab75f
Add bio fields ()
* Add bio fields

- Fix 
- Fix 
- Fix 

* Display bio fields in web UI

* Fix output of links and missing fields

* Federate bio fields over ActivityPub as PropertyValue

* Improve how the fields are stored, add to Edit profile form

* Add rel=me to links in fields

Fix 
2018-04-14 12:41:08 +02:00
David Underwood
123a343d11 [WIP] Enable custom emoji on account pages and in the sidebar ()
Federate custom emojis with accounts
2018-04-01 23:55:42 +02:00
Eugen Rochko
9fe1619db9
Do not re-query mentions from serializers ()
Fix performance regression from 
2018-03-22 11:31:17 +01:00
ThibG
ff6b8a6443 Serialize mentions in the order they are added ()
Up until now, the order seemed to be in the *opposite* order,
which caused the WebUI to populate mentions in reversed order
when replying to toots local to one's instance.
2018-03-19 20:19:35 +01:00
Eugen Rochko
89a52d6280
Fix wrong target URIs in ActivityPub Add/Remove () 2018-03-07 05:58:24 +01:00
Eugen Rochko
e6520c0270
Fix - Use target instead of origin in Remove activity () 2018-03-07 03:54:46 +01:00
Eugen Rochko
9110db41c5
Federate pinned statuses over ActivityPub ()
* Federate pinned statuses over ActivityPub

* Display pinned toots in web UI

Fix 

* Fix migration

* Fix tests

* Update outbox_serializer.rb

* Update remove_serializer.rb

* Update add_serializer.rb

* Update fetch_featured_collection_service.rb
2018-03-04 09:19:11 +01:00
Eugen Rochko
44829d8216
Fix missing focalPoint in ActivityPub JSON () 2018-03-04 07:21:41 +01:00
Eugen Rochko
41a01bec23
Federated reports ()
* Fix : Federated reports

* UI for federated reports

* Add spec for ActivityPub Flag handler

* Add spec for ReportService
2018-02-28 06:54:55 +01:00
Eugen Rochko
b8535ad4df
Fix nil error in focal_point? () 2018-02-22 17:42:33 +01:00
beatrix
755aad534a fix typo in image serializer ()
respond to!
2018-02-22 02:47:17 +01:00
Eugen Rochko
90f12f2e5a
Focal points ()
* Add focus param to media API, center thumbnails on focus point

* Add UI for setting a focal point

* Improve focal point icon on upload item

* Use focal point in upload preview

* Add focalPoint property to ActivityPub

* Don't show focal point button for non-image attachments
2018-02-22 00:35:46 +01:00
Eugen Rochko
61ed133fea
Account archive download ()
* Fix : Account archive download

* Export actor and private key in the archive

* Optimize BackupService

- Add conversation to cached associations of status, because
  somehow it was forgotten and is source of N+1 queries
- Explicitly call GC between batches of records being fetched
  (Model class allocations are the worst offender)
- Stream media files into the tar in 1MB chunks
  (Do not allocate media file (up to 8MB) as string into memory)
- Use #bytesize instead of #size to calculate file size for JSON
  (Fix FileOverflow error)
- Segment media into subfolders by status ID because apparently
  GIF-to-MP4 media are all named "media.mp4" for some reason

* Keep uniquely generated filename in Paperclip::GifTranscoder

* Ensure dumped files do not overwrite each other by maintaing directory partitions

* Give tar archives a good name

* Add scheduler to remove week-old backups

* Fix code style issue
2018-02-21 23:21:32 +01:00
Eugen Rochko
dbda87c31f
Revert () 2018-01-08 10:57:52 +01:00
Eugen Rochko
02ba03d6db
Send one Delete of Actor in ActivityPub when account is suspended () 2018-01-04 14:40:49 +01:00
Akihiko Odaki
161c72d66d Allow to dereference Follow object for ActivityPub ()
* Allow to dereference Follow object for ActivityPub

* Accept IRI as object representation for Accept activity
2018-01-03 18:08:57 +01:00
Eugen Rochko
58cede4808
Profile redirect notes ()
* Serialize moved accounts into REST and ActivityPub APIs

* Parse federated moved accounts from ActivityPub

* Add note about moved accounts to public profiles

* Add moved account message to web UI

* Fix code style issues
2017-11-18 19:39:02 +01:00
unarist
8125fdc19f Use atomUri in Undo activity of Announce ()
This allows deletion of reblogs which delivered before with OStatus URI.
2017-10-14 14:42:09 +02:00
Eugen Rochko
6e4046fc3f Fix - Use object URI only in Announce, instead of embedding () 2017-10-08 14:41:59 +02:00
Eugen Rochko
3a3475450e Encode custom emojis as resolveable objects in ActivityPub ()
* Encode custom emojis as resolveable objects in ActivityPub

* Improve code style
2017-10-07 17:43:42 +02:00
Eugen Rochko
4ec1771165 Add ability to specify alternative text for media attachments ()
* Fix  - Add ability to specify alternative text for media attachments

- POST /api/v1/media accepts `description` straight away
- PUT /api/v1/media/:id to update `description` (only for unattached ones)
- Serialized as `name` of Document object in ActivityPub
- Uploads form adjusted for better performance and description input

* Add tests

* Change undo button blend mode to difference
2017-09-28 15:31:31 +02:00
Akihiko Odaki
bb4d005a83 Introduce OStatus::TagManager () 2017-09-19 18:08:08 +02:00
nullkal
7d16bb379d Use OrderedCollectionPage to return followers/following list () 2017-09-19 16:37:06 +02:00