From 6e665efd1c263b2410c5ca6d41fcab8a72561fc7 Mon Sep 17 00:00:00 2001 From: Aaron DeVore Date: Sun, 24 Nov 2019 14:52:25 -0800 Subject: [PATCH] Add contains_url to RoomEventFilter (r0.3.0 compatibility) --- CHANGELOG.md | 1 + src/r0/filter.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e952a93..25140c88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,3 +12,4 @@ Improvements: * Add `r0::directory::get_public_rooms_filtered` (introduced upstream in r0.3.0) * Add `filter` optional parameter to `r0::sync::get_message_events` (introduced upstream in r0.3.0) * Add `r0::appservice::set_room_visibility` (part of application service extensions for the client-server API) +* Add `contains_url` to `r0::filter::RoomEventFilter` (introduced upstream in r0.3.0) diff --git a/src/r0/filter.rs b/src/r0/filter.rs index 5dd3a579..50ffbae0 100644 --- a/src/r0/filter.rs +++ b/src/r0/filter.rs @@ -58,6 +58,12 @@ pub struct RoomEventFilter { /// match any sequence of characters. #[serde(default, skip_serializing_if = "Option::is_none")] pub types: Option>, + /// If `true` include only events with a URL key in their content. + /// If `false`, exclude such events. + /// + /// If this item is absent then all event types are included. + #[serde(skip_serializing_if = "Option::is_none")] + pub contains_url: Option, } /// Filters to be applied to room data