Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Emoji Reactions #304

Open
kromonos opened this issue Dec 28, 2022 · 12 comments · May be fixed by #650
Open

Implement Emoji Reactions #304

kromonos opened this issue Dec 28, 2022 · 12 comments · May be fixed by #650
Labels
area/activitypub Sending or receiving ActivityPub area/posts Making or reading posts feature A specific, concrete feature to implement pri/verylow Very low priority. We'll get to it eventually.

Comments

@kromonos
Copy link
Contributor

Could also be from MissKey:

users-runner     | Tasks processed this loop:
users-runner     |   users.inboxmessage: 2
users-runner     | Running cleaning and scheduling
users-runner     | Attempting transition on users.inboxmessage#69809 from state received
users-runner     | Traceback (most recent call last):
users-runner     |   File "/usr/local/lib/python3.11/site-packages/asgiref/sync.py", line 486, in thread_handler
users-runner     |     raise exc_info[1]
users-runner     |   File "/takahe/stator/models.py", line 172, in atransition_attempt
users-runner     |     next_state = await current_state.handler(self)  # type: ignore
users-runner     |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
users-runner     |   File "/takahe/users/models/inbox_message.py", line 120, in handle_received
users-runner     |     raise ValueError(f"Cannot handle activity of type {unknown}")
users-runner     | ValueError: Cannot handle activity of type http://litepub.social/ns#emojireact

Personally, I'm feeling a bit mixed about the function. Surely it is sometimes quite nice, but necessary? Not really. After all, there is the little star under the message. Admittedly, the emoji reaction could express other “feelings” as well, than just like.

@andrewgodwin
Copy link
Member

Oh right, emoji reactions. I'll just put in a thing to drop and ignore these for now and we'll revisit if we want to support them in future.

@whatSocks
Copy link

Another option is to treat them like favorites, which is how I believe mastodon handles emojireacts from fedibird

@andrewgodwin
Copy link
Member

I hesitated to do that given that the emoji in the react might be negative, but if it's an established pattern...

@kromonos
Copy link
Contributor Author

I think, a reaction is a reaction, never mind, if it's a star, or an emoji. If it's meant negative, that's ok. That's on their side, but it hasn't meant to be negative on Takahe side?

@andrewgodwin andrewgodwin changed the title Maybe Pleroma only emojireact Implement Emoji Reactions Jan 8, 2023
@andrewgodwin andrewgodwin added feature A specific, concrete feature to implement area/activitypub Sending or receiving ActivityPub area/posts Making or reading posts pri/low Low Priority pri/verylow Very low priority. We'll get to it eventually. and removed pri/low Low Priority labels Jan 8, 2023
@shuuji3
Copy link
Contributor

shuuji3 commented Aug 18, 2023

It looks like both Misskey and Firefish are sending the type=Like object at this time. So Takahē already accepts any emoji reaction on the other server as a like reaction now.

Here's an example object sent from Firefish when I send 😇 reaction:

{
    'id': 'https://firefish.social/likes/9ik9ujpnd11k67xc',
    'type': 'Like',
    'actor': 'https://firefish.social/users/9i761tefz4uyltlz',
    'object': 'https://takahe.shuuji3.xyz/@shuuji3@takahe.shuuji3.xyz/posts/215037658374555952/',
    'content': '😇',
    '@context': [
        'https://www.w3.org/ns/activitystreams',
        'https://w3id.org/security/v1',
        {
            'toot': 'http://joinmastodon.org/ns#',
            'Emoji': 'toot:Emoji',
            'isCat': 'misskey:isCat',
            'value': 'schema:value',
            'vcard': 'http://www.w3.org/2006/vcard/ns#',
            'schema': 'http://schema.org#',
            'Hashtag': 'as:Hashtag',
            'misskey': 'https://misskey-hub.net/ns#',
            'featured': 'toot:featured',
            'fedibird': 'http://fedibird.com/ns#',
            'quoteUri': 'fedibird:quoteUri',
            'quoteUrl': 'as:quoteUrl',
            'sensitive': 'as:sensitive',
            'movedToUri': 'as:movedTo',
            'discoverable': 'toot:discoverable',
            'PropertyValue': 'schema:PropertyValue',
            '_misskey_talk': 'misskey:_misskey_talk',
            '_misskey_quote': 'misskey:_misskey_quote',
            '_misskey_votes': 'misskey:_misskey_votes',
            '_misskey_content':'misskey:_misskey_content',
            '_misskey_reaction': 'misskey:_misskey_reaction',
            'manuallyApprovesFollowers': 'as:manuallyApprovesFollowers'
        },
        'https://w3id.org/security/v1'
    ],
    '_misskey_reaction': '😇'
}

On Firefish
Screenshot 2023-08-19 at 0 34 47

Takahē on Elk
Screenshot 2023-08-18 at 23 26 57

So this issue had already been resolved without any action...?

I agree it's a bit weird to be liked even if it's 👎🏻 reaction. But both UI shows the server icon on a user account if they use a different application with an icon, so at least users can be aware when sending a reaction to Takahē account.

@andrewgodwin
Copy link
Member

This ticket was more "actually support emoji reactions" in my mind rather than merely translating them all to Likes (which is what Mastodon does anyway, so 👎 being a star is kind of expected behaviour for most servers!)

@AstraLuma
Copy link
Contributor

Ok, I'm guessing three bits here:

  • Make sure reactions are correctly accepted and stored
  • Make sure reactions are correctly aggregated and forwarded
  • Update the UI to display reactions

@andrewgodwin
Copy link
Member

Yeah - PostInteraction is prepped to accept arbitrary reaction types, so the problem is mostly inbound and outbound comms.

The mastadon API has no way of seeing these reactions or sending them though, so I don't know how important it is (they'll only be visible on the web UI from external sources)

@AstraLuma AstraLuma linked a pull request Nov 9, 2023 that will close this issue
6 tasks
@AstraLuma
Copy link
Contributor

AstraLuma commented Nov 9, 2023

Do we have any example activities of unreacting? Or custom emoji?

@AstraLuma
Copy link
Contributor

AstraLuma commented Nov 9, 2023

The Iceshrimp UI suggests it only supports one reaction per user.

@AstraLuma
Copy link
Contributor

AstraLuma commented Nov 9, 2023

Ok, some example messages (Unicode emoji reactions from iceshrimp):

{
  "id": "https://fediverse.gay/likes/9lv0n6wjz85mpu6p",
  "type": "Like",
  "actor": "https://fediverse.gay/users/9ltneg7gvuorfb2i",
  "object": "https://derez.zone/@astraluma@derez.zone/posts/244939510870121776/",
  "content": "❤️",
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1",
    {
      "toot": "http://joinmastodon.org/ns#",
      "Emoji": "toot:Emoji",
      "isCat": "misskey:isCat",
      "value": "schema:value",
      "vcard": "http://www.w3.org/2006/vcard/ns#",
      "schema": "http://schema.org#",
      "Hashtag": "as:Hashtag",
      "misskey": "https://misskey-hub.net/ns#",
      "featured": "toot:featured",
      "fedibird": "http://fedibird.com/ns#",
      "quoteUri": "fedibird:quoteUri",
      "quoteUrl": "as:quoteUrl",
      "sensitive": "as:sensitive",
      "movedToUri": "as:movedTo",
      "discoverable": "toot:discoverable",
      "PropertyValue": "schema:PropertyValue",
      "_misskey_talk": "misskey:_misskey_talk",
      "_misskey_quote": "misskey:_misskey_quote",
      "_misskey_votes": "misskey:_misskey_votes",
      "_misskey_content": "misskey:_misskey_content",
      "_misskey_reaction": "misskey:_misskey_reaction",
      "manuallyApprovesFollowers": "as:manuallyApprovesFollowers"
    },
    "https://w3id.org/security/v1"
  ],
  "_misskey_reaction": "❤️"
}
{
  "id": "https://fediverse.gay/likes/9lv0n6wjz85mpu6p/undo",
  "type": "Undo",
  "actor": "https://fediverse.gay/users/9ltneg7gvuorfb2i",
  "object": {
    "id": "https://fediverse.gay/likes/9lv0n6wjz85mpu6p",
    "type": "Like",
    "actor": "https://fediverse.gay/users/9ltneg7gvuorfb2i",
    "object": "https://derez.zone/@astraluma@derez.zone/posts/244939510870121776/",
    "content": "❤️",
    "_misskey_reaction": "❤️"
  },
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1",
    {
      "toot": "http://joinmastodon.org/ns#",
      "Emoji": "toot:Emoji",
      "isCat": "misskey:isCat",
      "value": "schema:value",
      "vcard": "http://www.w3.org/2006/vcard/ns#",
      "schema": "http://schema.org#",
      "Hashtag": "as:Hashtag",
      "misskey": "https://misskey-hub.net/ns#",
      "featured": "toot:featured",
      "fedibird": "http://fedibird.com/ns#",
      "quoteUri": "fedibird:quoteUri",
      "quoteUrl": "as:quoteUrl",
      "sensitive": "as:sensitive",
      "movedToUri": "as:movedTo",
      "discoverable": "toot:discoverable",
      "PropertyValue": "schema:PropertyValue",
      "_misskey_talk": "misskey:_misskey_talk",
      "_misskey_quote": "misskey:_misskey_quote",
      "_misskey_votes": "misskey:_misskey_votes",
      "_misskey_content": "misskey:_misskey_content",
      "_misskey_reaction": "misskey:_misskey_reaction",
      "manuallyApprovesFollowers": "as:manuallyApprovesFollowers"
    },
    "https://w3id.org/security/v1"
  ],
  "published": "2023-11-09T17:17:56.420Z"
}

I can't actually get the Iceshrimp UI to change a reaction without removing the old one, and I'm unfamiliar with the Misskey client ecosystem. (Using fediverse.gay because firefish.social is being kinda laggy in a not-confidence-inspiring way.)

@iacore
Copy link

iacore commented Dec 13, 2023

Calling this "Emoji" Reaction might be a misnomer. The reaction content can be any text, with (misskey extension) emoji replacement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/activitypub Sending or receiving ActivityPub area/posts Making or reading posts feature A specific, concrete feature to implement pri/verylow Very low priority. We'll get to it eventually.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants