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

Can't edit emoji pack in room that I should be able to #1069

Closed
tinywombat765 opened this issue Jan 10, 2023 · 8 comments · Fixed by #1125
Closed

Can't edit emoji pack in room that I should be able to #1069

tinywombat765 opened this issue Jan 10, 2023 · 8 comments · Fixed by #1125

Comments

@tinywombat765
Copy link

Describe the bug

Cinny won't let me edit the emoji packs in a certain room even though I have permission to. I suspect this is due to some custom permissions in said room. Here is the PL event for that room, I am @sasha:the-apothecary.club

{
  "content": {
    "ban": 50,
    "events": {
      "im.ponies.room_emotes": 10,
      "m.room.avatar": 50,
      "m.room.canonical_alias": 50,
      "m.room.encryption": 100,
      "m.room.history_visibility": 100,
      "m.room.name": 50,
      "m.room.power_levels": 100,
      "m.room.server_acl": 100,
      "m.room.tombstone": 100
    },
    "events_default": 0,
    "invite": 50,
    "kick": 50,
    "redact": 50,
    "state_default": 50,
    "users": {
      "@emi:the-apothecary.club": 100,
      "@sasha:the-apothecary.club": 10,
      "@theotheroracle:the-apothecary.club": 99
    },
    "users_default": 0
  },
  "origin_server_ts": 1673366692481,
  "sender": "@emi:the-apothecary.club",
  "state_key": "",
  "type": "m.room.power_levels",
  "unsigned": {
    "replaces_state": "$6ZLlsYDqHqV-n9tXQDKhvpxOtOzuVehanMAVyLib6dY",
    "prev_content": {
      "ban": 50,
      "events": {
        "m.room.avatar": 50,
        "m.room.canonical_alias": 50,
        "m.room.encryption": 100,
        "m.room.history_visibility": 100,
        "m.room.name": 50,
        "m.room.power_levels": 100,
        "m.room.server_acl": 100,
        "m.room.tombstone": 100
      },
      "events_default": 0,
      "invite": 50,
      "kick": 50,
      "redact": 50,
      "state_default": 50,
      "users": {
        "@emi:the-apothecary.club": 100,
        "@theotheroracle:the-apothecary.club": 99
      },
      "users_default": 0
    },
    "prev_sender": "@emi:the-apothecary.club"
  },
  "event_id": "$yO0uPX_-vg6Xxjml9wikpTwyO4y6tq551HytsxuE4yY",
  "room_id": "!VLbffNoUsjFQntvzoi:the-apothecary.club"
}

Reproduction

No response

Expected behavior

No response

Platform and versions

1. Linux
2. Chromium 108.0.5359.124
3. Cinny v2.2.2
4. the-apothecary.club

Additional context

No response

@kfiven
Copy link
Collaborator

kfiven commented Jan 11, 2023

You have 10 power level but you need 50 to edit the state events. There's no such things as

"events": {
      "im.ponies.room_emotes": 10,

in MSC 2525

@tinywombat765
Copy link
Author

I can't find the documentation for it, but im.ponies.room_emotes was the emote pack state event that Fluffychat used to use, and it appear to still in some respect. As fluffychat let me edit the room's emote pack with those PLs.

@tinywombat765
Copy link
Author

And doing a quick grep of the code base, im.ponies.room_emotes is mentioned several times in Cinny. Which makes sense seeing as Cinny recognizes an emote pack defined using that event.

@tinywombat765
Copy link
Author

Okay, after some further research, it seems that packs created by Cinny also use the im.ponies.room_emotes event. Having "im.ponies.room_emotes": 10 in events in the PL event means that my user, with PL 10, can post a new im.ponies.room_emotes events to the room. And this is confirmed by the fact that from Fluffychat I can successfully update the emote pack in that room. This is, in fact, a bug in Cinny.

@tinywombat765
Copy link
Author

tinywombat765 commented Jan 11, 2023

You have 10 power level but you need 50 to edit the state events. There's no such things as

"events": {
      "im.ponies.room_emotes": 10,

in MSC 2525

PL 50 is the default PL required to edit state events, but as you can see, that can be changed by adding that event's name to the "event" object in the PL event [reference]. So with the PL event present in the room, a user of PL 10 can post an im.ponies.room_emotes state event.

@kfiven
Copy link
Collaborator

kfiven commented Jan 11, 2023

But the MSC doesn't talk about settings up im.ponies.room_emotes in PL state event.

@tinywombat765
Copy link
Author

Doesn't matter, that's just how power levels and state events work.

@q234rty
Copy link

q234rty commented Jan 11, 2023

Quoted from the spec:

The level required to send a certain event is governed by events, state_default and events_default. If an event type is specified in events, then the user must have at least the level specified in order to send that event. If the event type is not supplied, it defaults to events_default for Message Events and state_default for State Events.

So one should be able to override the power level required to send im.ponies.room_emotes by adding it to events.

@kfiven kfiven changed the title Can't edit emoji in room that I should be able to Can't edit emoji pack in room that I should be able to Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants