Skip to content

Shared chat middleware broken when chat is not shared #357

Description

@Latent-Logic

When the code was updated 4f6bc49
to provide a cleaner interface to the source_room_id it removed a critical check to see if source_room_id is even provided in the first place.

Specifically the loss of

        if "source-room-id" in command._parsed["tags"]:

means that when shared chat is not active and twitch does not set any source-room-id tag the check of

        if command.source_room_id != command.room.room_id:

is now a comparison of None != '12345' which is True, and thus returning False to the caller of SharedChatOnlyCurrent.can_execute.

Of note this middleware is not required when the Chat parameter of no_shared_chat_messages is True (the default) because that check is happening before command processing.
https://github.com/Teekeks/pyTwitchAPI/blob/master/twitchAPI/chat/__init__.py#L1108-L1110

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions