apply PR feedback

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2018-07-29 19:25:14 +01:00
parent 73582c6bc7
commit c0e468b543
No known key found for this signature in database
GPG Key ID: 3F879DA5AD802A5E

View File

@ -12,11 +12,13 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from synapse.api.errors import SynapseError
from synapse.storage.presence import UserPresenceState
from synapse.types import UserID, RoomID
from twisted.internet import defer
import six
import ujson as json
import jsonschema
from jsonschema import FormatChecker
@ -353,10 +355,8 @@ class Filter(object):
ev_type = event.get("type", None)
content = event.get("content", {})
is_url = (
"url" in content
and isinstance(content["url"], basestring)
)
# check if there is a string url field in the content for filtering purposes
is_url = isinstance(content.get("url"), six.text_type)
return self.check_fields(
room_id,