Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Allow guest users access to messages in rooms they have joined #587

Merged
merged 4 commits into from Feb 22, 2016

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Feb 19, 2016

There should be no difference between guest users and non-guest users in terms
of access to messages. Define the semantics of the is_peeking argument to
filter_events_for_clients (slightly) better; interpret it appropriately, and
set it correctly from /sync.

(fixes element-hq/element-web#949)

There should be no difference between guest users and non-guest users in terms
of access to messages. Define the semantics of the is_peeking argument to
filter_events_for_clients (slightly) better; interpret it appropriately, and
set it correctly from /sync.
return membership == Membership.INVITE

return True
# presumably visibility is "joined"; we weren't a member at the
# time of the event, so we're done.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the server is supposed to assume that the room is "shared" if it doesn't understand the value of history_visibility.

https://matrix.org/speculator/spec/HEAD/client_server.html#id31

@richvdh
Copy link
Member Author

richvdh commented Feb 19, 2016

my bad. PTAL?

@richvdh
Copy link
Member Author

richvdh commented Feb 22, 2016

@illicitonion: please take a look

@richvdh
Copy link
Member Author

richvdh commented Feb 22, 2016

@illicitonion: please take a look.

Any idea what the special-case for RoomHistoryVisibility which i've currently commented-out is for? it appears to have been introduced by @erikjohnston in 41938af

@erikjohnston
Copy link
Member

Any idea what the special-case for RoomHistoryVisibility which i've currently commented-out is for? it appears to have been introduced by @erikjohnston in 41938af

I'm guessing that it was so that users can see when the visibility changes from joined to shared, etc, so that the UI can say something like "You don't have permission to view any messages from before this time" instead of the history suddenly stopping.

""" Returns dict of user_id -> list of events that user is allowed to
see.

:param (str, bool) user_tuples: (user id, is_peeking) for each
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Param style is wrong here; should be:

Args:
argname (type): Description

(and below)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. At least, that is not the convention we agreed last time it was discussed, which was https://www.jetbrains.com/pycharm/help/type-hinting-in-pycharm.html#legacy.

drop commented-out special casing for historyvisibility event
s/he/they/ for users
@illicitonion
Copy link
Contributor

LGTM

richvdh added a commit that referenced this pull request Feb 22, 2016
Allow guest users access to messages in rooms they have joined
@richvdh richvdh merged commit f7e3de0 into develop Feb 22, 2016
@richvdh richvdh deleted the rav/guest_access_after_room_join branch February 22, 2016 16:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants