Commit Graph

116 Commits (38e9662d78784d8286917f0d0e47d76d0df916df)

Author SHA1 Message Date
Eugen Rochko e709107463
Display Mastodon version in footer of web UI (#8013)
Fix #7846
6 years ago
Eugen Rochko e55dce3176
Add federation relay support (#7998)
* Add federation relay support

* Add admin UI for managing relays

* Include actor on relay-related activities

* Fix i18n
6 years ago
ThibG 1ca4e51eb3 Add option to not consider word boundaries when processing keyword filtering (#7975)
* Add option to not consider word boundaries when filtering phrases

* Add a few tests for keyword/phrase filtering
6 years ago
Eugen Rochko 9804ec3a6d
Fix missing irreversible in filters API, expires_in param (#7976) 6 years ago
Eugen Rochko cdb101340a
Keyword/phrase filtering (#7905)
* Add keyword filtering

    GET|POST       /api/v1/filters
    GET|PUT|DELETE /api/v1/filters/:id

- Irreversible filters can drop toots from home or notifications
- Other filters can hide toots through the client app
- Filters use a phrase valid in particular contexts, expiration

* Make sure expired filters don't get applied client-side

* Add missing API methods

* Remove "regex filter" from column settings

* Add tests

* Add test for FeedManager

* Add CustomFilter test

* Add UI for managing filters

* Add streaming API event to allow syncing filters

* Fix tests
6 years ago
Eugen Rochko fc09b3722a
Always send content for backwards-compatibility (#7844) 6 years ago
Eugen Rochko 908a9671d0
Serialize language into ActivityPub JSON (#7840)
* Serialize language into ActivityPub JSON

* Only use contentMap if language is present
6 years ago
Eugen Rochko a58ec29631
Allow selecting default posting language instead of auto-detect (#7828)
* Allow selecting default posting language instead of auto-detect

* Enable default language setting in credentials API

* Fix form saving
6 years ago
Eugen Rochko 5e9d51c24b
Do not pre-emojify note HTML in accounts REST API (#7821)
Fix #7820
6 years ago
Eugen Rochko 1cc775200e
Add "find friends", "invite people", and more to getting started footer (#7803)
- Find friends from Twitter (bridge)
- Invite people (when invites enabled)
- Security (change e-mail/password)
- Developers (create OAuth apps/tokens)
6 years ago
Eugen Rochko 8bb74e50be
Add GET /api/v2/search which returns rich tag objects, adjust web UI (#7661) 6 years ago
Eugen Rochko 9bd23dc4e5
Track trending tags (#7638)
* Track trending tags

- Half-life of 1 day
- Historical usage in daily buckets (last 7 days stored)
- GET /api/v1/trends

Fix #271

* Add trends to web UI

* Don't render compose form on search route, adjust search results header

* Disqualify tag from trends if it's in disallowed hashtags setting

* Count distinct accounts using tag, ignore silenced accounts
6 years ago
Eugen Rochko 1a564df586
Do not encode HTML entities in initial Web Push payload body (#7592) 7 years ago
Eugen Rochko 4b94e9c65e
Improve payload format of Web Push API now that it's open (#7521)
> Good lord what is happening in there

Previously the contents of the Web Push API payloads closely resembled the structure of JavaScript's [Notification](https://developer.mozilla.org/en-US/docs/Web/API/Notification). But now that the API is open to non-browser apps, and given that there is no required coupling between contents of the payload and a Notification object, here is how I changed the payload:

```json
{ 
  "access_token": "...",
  "preferred_locale": "en",
  "notification_id": "12345",
  "notification_type": "follow",
  "title": "So and so followed you",
  "body": "This is my bio",
  "icon": "https://example.com/avatar.png"
}
```

The title, body and icon attributes are included as a fallback so you can construct a minimal notification if you cannot perform a network request to the API to get more data.
7 years ago
Eugen Rochko b4fb766b23
Add REST API for Web Push Notifications subscriptions (#7445)
- POST /api/v1/push/subscription
- PUT /api/v1/push/subscription
- DELETE /api/v1/push/subscription
- New OAuth scope: "push" (required for the above methods)
7 years ago
Eugen Rochko 42cd363542
Bot nameplates (#7391)
* Store actor type in database

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

* Fix code style issues
7 years ago
Eugen Rochko 61a9018607
Enable custom emojis in profiles (notes, field values, display names) (#7374)
Follow-up to #6124
7 years ago
Eugen Rochko 2f63d52b92
Fallback to old on-the-fly URI for follows/blocks if no stored URI (#7371)
Fix #7367
7 years ago
Eugen Rochko 6793bec4c6
Store URIs of follows, follow requests and blocks for ActivityPub (#7160)
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.
7 years ago
Eugen Rochko 2c1f7b2ece
Better pagination for ActivityPub outbox (#7356) 7 years ago
Eugen Rochko cae933510c
Allow updating bio fields via PUT /api/v1/accounts/update_credentials (#7288)
Add raw bio fields to the source attribute on GET /api/v1/accounts/verify_credentials
7 years ago
Eugen Rochko 9d4710ed00
Add RSS feeds for end-users (#7259)
* Add RSS feed for accounts

* Add RSS feeds for hashtags

* Fix code style issues

* Fix code style issues
7 years ago
Eugen Rochko 78ed4ab75f
Add bio fields (#6645)
* Add bio fields

- Fix #3211
- Fix #232
- Fix #121

* 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 #121
7 years ago
Isatis b08ab329f4 retrieve custom emoji list via API instead of before page load (#7047) 7 years ago
David Underwood 123a343d11 [WIP] Enable custom emoji on account pages and in the sidebar (#6124)
Federate custom emojis with accounts
7 years ago
Eugen Rochko 9fe1619db9
Do not re-query mentions from serializers (#6858)
Fix performance regression from #6836
7 years ago
ThibG ff6b8a6443 Serialize mentions in the order they are added (#6836)
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.
7 years ago
Eugen Rochko 89a52d6280
Fix wrong target URIs in ActivityPub Add/Remove (#6668) 7 years ago
Eugen Rochko e6520c0270
Fix #6657 - Use target instead of origin in Remove activity (#6664) 7 years ago
Akihiko Odaki 778b37790b Do not fetch environment variables to determine default locale (#6618)
The default locale is now set by config.
7 years ago
Eugen Rochko 9110db41c5
Federate pinned statuses over ActivityPub (#6610)
* Federate pinned statuses over ActivityPub

* Display pinned toots in web UI

Fix #6117

* Fix migration

* Fix tests

* Update outbox_serializer.rb

* Update remove_serializer.rb

* Update add_serializer.rb

* Update fetch_featured_collection_service.rb
7 years ago
Eugen Rochko 44829d8216
Fix missing focalPoint in ActivityPub JSON (#6609) 7 years ago
Eugen Rochko 7901f9f63e
When search enabled, display hint in search popout (#6593)
* When advanced search is enabled, show different hint in search popout

* Change "getting started" icon in tabs bar from asterisk to hamburger
7 years ago
Eugen Rochko a3c4138197
Add contact_account and languages to instance API (#6574) 7 years ago
Eugen Rochko 41a01bec23
Federated reports (#6570)
* Fix #2176: Federated reports

* UI for federated reports

* Add spec for ActivityPub Flag handler

* Add spec for ReportService
7 years ago
Eugen Rochko b8535ad4df
Fix nil error in focal_point? (#6537) 7 years ago
beatrix 755aad534a fix typo in image serializer (#6530)
respond to!
7 years ago
Eugen Rochko 90f12f2e5a
Focal points (#6520)
* 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
7 years ago
Eugen Rochko 61ed133fea
Account archive download (#6460)
* Fix #201: 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
7 years ago
Eugen Rochko 76f3d5d16b
Add preference to always display sensitive media (#6448) 7 years ago
りんすき fbe7756da6 implement web share target (#6278)
* web share target

* fix

* fix
7 years ago
Eugen Rochko dbda87c31f
Revert #5772 (#6221) 7 years ago
Yamagishi Kazutoshi 3c18964256 Fallback default thumbnail in instance status API (#6177) 7 years ago
Eugen Rochko 02ba03d6db
Send one Delete of Actor in ActivityPub when account is suspended (#6172) 7 years ago
Akihiko Odaki 161c72d66d Allow to dereference Follow object for ActivityPub (#5772)
* Allow to dereference Follow object for ActivityPub

* Accept IRI as object representation for Accept activity
7 years ago
Eugen Rochko a3b2ea599d
Fix #6022 - Prevent nested migrated accounts, or migrations to self (#6026) 7 years ago
Akihiko Odaki c083816c24 Add embed_url to preview cards (#5775) 7 years ago
aschmitz 4de211b80a Break out nested relationship API keys (#5887)
* Break out nested relationship API keys

This closes #5856 by restoring the existing behavior of the `muting`
and `following` keys (returning booleans rather than truthy or false).
It adds `showing_reblogs` and `muting_notifications` keys:

* `showing_reblogs` returns true if:
  1. You've requested to follow the user, with reblogs shown, or
  2. You are following the user, with reblogs shown.
* `muting_notifications` returns true if you have muted the user and
  their notifications as well.

* Rubocop fix

* Fix pulling reblog/mute status from relationships

I could swear this had passed tests before, but apparently not.
Works now.

* More test fixes

Really, you'd expect this to be more straightforward.
7 years ago
Eugen Rochko 42bcbd36b7 Remove rabl dependency (#5894)
* Remove rabl dependency

* Replicate old Oj configuration
7 years ago
Eugen Rochko 31ac5f0e00
Display list column (#5750) 7 years ago