Skip, rather than erroring, invalid guest requests

Erroring causes problems when people make illegal requests, because they
don't know what limit parameter they should pass.

This is definitely buggy. It leaks message counts for rooms people don't
have permission to see, via tokens. But apparently we already
consciously decided to allow that as a team, so this preserves that
behaviour.
This commit is contained in:
Daniel Wagner-Hall 2016-01-05 18:12:37 +00:00 committed by review.rocks
parent 29e131df43
commit 2ef6de928d
5 changed files with 5 additions and 21 deletions

View file

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
# Copyright 2014 - 2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -685,7 +685,7 @@ class MessageHandler(BaseHandler):
).addErrback(unwrapFirstError)
messages = yield self._filter_events_for_client(
user_id, messages, is_guest=is_guest, require_all_visible_for_guests=False
user_id, messages, is_guest=is_guest,
)
start_token = now_token.copy_and_replace("room_key", token[0])