Interpret unknown visibilities the same as shared

pull/587/head
Richard van der Hoff 2016-02-19 17:11:11 +00:00
parent 05aee12652
commit 6c5b147a39
1 changed files with 13 additions and 11 deletions

View File

@ -111,22 +111,24 @@ class BaseHandler(object):
# return True # return True
pass pass
if visibility == "shared": if visibility == "joined":
# user can also see the event if he has become a member since # we weren't a member at the time of the event, so we can't
# the event # see this event.
# return False
# XXX: if the user has subsequently joined and then left again,
# ideally we would share history up to the point they left. But
# we don't know when they left.
return not is_peeking
elif visibility == "invited": elif visibility == "invited":
# user can also see the event if he was *invited* at the time # user can also see the event if he was *invited* at the time
# of the event. # of the event.
return membership == Membership.INVITE return membership == Membership.INVITE
# presumably visibility is "joined"; we weren't a member at the else:
# time of the event, so we're done. # visibility is shared: user can also see the event if he has
return False # become a member since the event
#
# XXX: if the user has subsequently joined and then left again,
# ideally we would share history up to the point they left. But
# we don't know when they left.
return not is_peeking
defer.returnValue({ defer.returnValue({
user_id: [ user_id: [