]> cat aescling's git repositories - mastodon.git/commit
Custom emoji (#4988)
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 19 Sep 2017 00:42:40 +0000 (02:42 +0200)
committerGitHub <noreply@github.com>
Tue, 19 Sep 2017 00:42:40 +0000 (02:42 +0200)
commit81cec35dbf1b348d23363559e3f4e6b1ec3415c5
treed449c3c19a8147bd1bc44fc703a1fccb9b9b894d
parentc155d843f4d523d52ce4ce67491578385c06fd1b
Custom emoji (#4988)

* 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
20 files changed:
app/javascript/mastodon/emoji.js
app/javascript/mastodon/reducers/statuses.js
app/lib/activitypub/activity/create.rb
app/lib/formatter.rb
app/lib/ostatus/activity/creation.rb
app/lib/ostatus/atom_serializer.rb
app/models/custom_emoji.rb [new file with mode: 0644]
app/models/status.rb
app/serializers/activitypub/note_serializer.rb
app/serializers/rest/status_serializer.rb
app/views/stream_entries/_detailed_status.html.haml
app/views/stream_entries/_simple_status.html.haml
db/migrate/20170917153509_create_custom_emojis.rb [new file with mode: 0644]
db/schema.rb
spec/fabricators/custom_emoji_fabricator.rb [new file with mode: 0644]
spec/fixtures/files/emojo.png [new file with mode: 0644]
spec/lib/activitypub/activity/create_spec.rb
spec/lib/formatter_spec.rb
spec/lib/ostatus/atom_serializer_spec.rb
spec/models/custom_emoji_spec.rb [new file with mode: 0644]