Jonas Platte
1bf4157a89
Add favicon and logo URLs for rustdoc
2021-04-05 11:42:07 +02:00
Kévin Commaille
71b358ccd6
common: Replace String with MxcUri for avatar_url
2021-04-05 08:10:21 +02:00
Kévin Commaille
cd157885dd
common: Fix push::PushCondition::applies for empty value and pattern
2021-04-03 17:00:04 +02:00
Jonas Platte
4a926e0e64
Consistently use int!
macro to create js_int::Int
s from literals
2021-03-31 13:25:56 +02:00
Jonas Platte
d6bb977dba
common: Make NotificationPowerLevels non-exhaustive
2021-03-31 13:12:34 +02:00
Jonas Platte
171fcfa965
common: Remove redundant clones
2021-03-31 13:11:19 +02:00
Jonas Platte
cd34fba6ad
common: Fix import ordering
2021-03-31 13:11:02 +02:00
Jonas Platte
f91467d0b2
Use maplit::btreemap in tests
2021-03-31 12:32:29 +02:00
Kévin Commaille
357100883d
common: Add a function to test an event against a Ruleset
2021-03-31 12:12:23 +02:00
Kévin Commaille
038f0eec6d
common: Add a function to test an event against PushCondition
2021-03-31 12:12:23 +02:00
Kévin Commaille
cdb998c83f
Move ruma_events::room::power_levels::NotificationPowerLevels to ruma-common
2021-03-31 12:12:23 +02:00
Jonas Platte
12686fe6e3
Clean up std::fmt imports
...
We were pretty inconsistent about them before.
2021-03-25 16:32:08 +01:00
Jonas Platte
922059c3e5
common: Borrow the rule ID in AnyPushRule::rule_id
2021-03-22 20:53:17 +01:00
Kévin Commaille
945e085c7a
common: Add tests for push rules
2021-03-22 20:42:25 +01:00
Kévin Commaille
c8c45d10fa
common: Replace push rule kinds types with AnyPushRule variants
2021-03-22 20:42:25 +01:00
Kévin Commaille
b79ef0303a
Move common::push::AnyPushRule to client_api::r0::push::PushRule
2021-03-22 20:42:25 +01:00
Kévin Commaille
22f7f28e1b
common: Replace BTreeSet by IndexSet in push::Ruleset.
...
Keeps the JSON ordering for priority.
IndexSet are hashed by `rule_id` so its uniqueness is enforced.
A rule can be fetched by its `rule_id`.
2021-03-22 20:42:25 +01:00
Takayuki Maeda
9cfa3b075c
deserialize empty string to none for avatar_url
2021-03-15 16:46:15 +01:00
Jonas Platte
a20c75d536
Fix import grouping issues
2021-02-25 20:55:19 +01:00
Jonas Platte
42f1ddb222
common: Rename Medium::{MSISDN => Msisdn}
2021-02-11 19:08:09 +01:00
Jonas Platte
891db9083b
Clean up cargo features
2021-02-02 19:21:45 +01:00
Devin Ragotzy
8fad462d8c
Fix push rule precedence when converting to RulesIter
2021-01-30 18:00:57 +01:00
Akshay
adeb545062
Add push rule for .m.rule.reaction
2021-01-21 19:51:32 +01:00
Isaiah Inuwa
4831585223
Move TokenType to ruma-common
2020-12-26 21:46:29 +01:00
Jonas Platte
5562a23aaa
Move Raw, Outgoing and all macro code from ruma-common to ruma-serde
2020-11-28 03:45:39 +01:00
Ana Gelez
aab6ed9c94
Hide RulesetMember::add_to in the docs
2020-11-27 20:53:51 +01:00
Ana Gelez
483fe8f940
Run cargo fmt
2020-11-27 20:53:51 +01:00
Ana Gelez
57efd8cd5b
Custom iterator for Ruleset
2020-11-27 20:53:34 +01:00
Ana Gelez
0e6d3f17c6
Seal the RulesetMember trait
...
+ use maplit instead of custom macro
+ fix two little issues in the documentation
2020-11-27 20:52:06 +01:00
Ana Gelez
65ef5f21e5
Use Self constructors when possible
2020-11-27 20:52:06 +01:00
Ana Gelez
1a29875fb4
Rename PushRule to SimplePushRule
2020-11-27 20:52:06 +01:00
Ana Gelez
5d988db5e7
impl Extend for Ruleset
2020-11-27 20:52:01 +01:00
Ana Gelez
0e0491c02b
Add a "add" method on Ruleset
...
- Add wrapper types for each kind of push rule
- Add a trait to add a push rule to a rule set
2020-11-27 20:50:10 +01:00
Ana Gelez
98082e0081
Implement IntoIterator for Ruleset
2020-11-27 20:46:58 +01:00
Ana Gelez
e8622ee809
Use a BTreeSet instead of a Vec to make push rule IDs unique
...
- Introduce a new macro to easily derive Ord, PartialOrd, Eq and PartialEq
for a PushRule-like type (these traits are required by BTreeSet)
- Introduce a new macro to easily build a BTreeSet
2020-11-27 20:46:58 +01:00
Jonas Platte
e7f55ea2c6
Rewrap comments
2020-11-27 18:22:18 +01:00
Gelez
4c41bfd1f3
Add constructors for default push rules
2020-11-24 22:37:09 +01:00
Jonas Platte
abc18fae39
Fix some links in documentation
2020-11-24 03:25:02 +01:00
Jonas Platte
f2c2f2df2f
common: Don't change fields in thirdparty::Protocol with unstable-synapse-quirks
2020-11-23 19:12:19 +01:00
Jonas Platte
dd6446822b
Derive PartialEq and Eq for all string-wrapping enums
2020-11-02 00:29:47 +01:00
Jonas Platte
d34a270919
Allow custom values for more enums
2020-11-02 00:29:47 +01:00
Jonas Platte
1f8e8c2e93
common-macros: Add derive macros for string-wrapping enums
2020-11-02 00:29:41 +01:00
Jonas Platte
f2a78babbd
Avoid creating owned strings in deserialization where not necessary
2020-10-26 01:52:51 +01:00
Jonas Platte
3b3ef1cb75
Remove test_
prefix from lots of test functions
2020-10-25 23:11:08 +01:00
Jonas Platte
e1975c2035
Be more consistent about whitespace
2020-10-24 00:44:01 +02:00
Timo Kösters
90bd4874e3
Remove Option wrapper around directory filters
2020-10-17 23:06:52 +02:00
Alejandro Domínguez
3869d75837
Support synapse quirk for thirdparty module
2020-09-29 16:42:11 +02:00
Jonas Platte
fdd326edf7
Move Outgoing from ruma-api to ruma-common
...
The derive macro moves from ruma-api-macros to a new ruma-common-macros
crate likewise.
2020-09-22 21:35:10 +02:00
Jonas Platte
7aec43c323
Fix missing serde(default) attributes
2020-09-21 23:06:20 +02:00
Jonas Platte
4a9b1aeb3c
Remove borrowing from types in ruma_common::encryption
...
Until a better solution can be found for types that appear both in
request & response types and would otherwise require incoming types to
appear as fields of outgoing types.
2020-09-12 02:50:57 +02:00