sdk-test: Add room member ban sync event

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille
2023-04-19 12:25:24 +02:00
committed by Jonas Platte
parent e5f4bbdc47
commit 493db9dd3f
3 changed files with 23 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ pub enum TimelineTestEvent {
HistoryVisibility,
JoinRules,
Member,
MemberBan,
MemberInvite,
MemberNameChange,
MessageEdit,
@@ -47,6 +48,7 @@ impl TimelineTestEvent {
Self::HistoryVisibility => test_json::sync_events::HISTORY_VISIBILITY.to_owned(),
Self::JoinRules => test_json::sync_events::JOIN_RULES.to_owned(),
Self::Member => test_json::sync_events::MEMBER.to_owned(),
Self::MemberBan => test_json::sync_events::MEMBER_BAN.to_owned(),
Self::MemberInvite => test_json::sync_events::MEMBER_INVITE.to_owned(),
Self::MemberNameChange => test_json::sync_events::MEMBER_NAME_CHANGE.to_owned(),
Self::MessageEdit => test_json::sync_events::MESSAGE_EDIT.to_owned(),
@@ -81,6 +83,7 @@ pub enum StateTestEvent {
HistoryVisibility,
JoinRules,
Member,
MemberBan,
MemberInvite,
MemberNameChange,
PowerLevels,
@@ -103,6 +106,7 @@ impl StateTestEvent {
Self::HistoryVisibility => test_json::sync_events::HISTORY_VISIBILITY.to_owned(),
Self::JoinRules => test_json::sync_events::JOIN_RULES.to_owned(),
Self::Member => test_json::sync_events::MEMBER.to_owned(),
Self::MemberBan => test_json::sync_events::MEMBER_BAN.to_owned(),
Self::MemberInvite => test_json::sync_events::MEMBER_INVITE.to_owned(),
Self::MemberNameChange => test_json::sync_events::MEMBER_NAME_CHANGE.to_owned(),
Self::PowerLevels => test_json::sync_events::POWER_LEVELS.to_owned(),

View File

@@ -27,10 +27,10 @@ pub use sync::{
MORE_SYNC, MORE_SYNC_2, SYNC, VOIP_SYNC,
};
pub use sync_events::{
ALIAS, ALIASES, ENCRYPTION, MEMBER, MEMBER_INVITE, MEMBER_NAME_CHANGE, MEMBER_STRIPPED,
MESSAGE_EDIT, MESSAGE_TEXT, NAME, NAME_STRIPPED, POWER_LEVELS, PRESENCE, PUSH_RULES, REACTION,
READ_RECEIPT, READ_RECEIPT_OTHER, REDACTED, REDACTED_INVALID, REDACTED_STATE, REDACTION, TAG,
TOPIC, TOPIC_REDACTION, TYPING,
ALIAS, ALIASES, ENCRYPTION, MEMBER, MEMBER_BAN, MEMBER_INVITE, MEMBER_NAME_CHANGE,
MEMBER_STRIPPED, MESSAGE_EDIT, MESSAGE_TEXT, NAME, NAME_STRIPPED, POWER_LEVELS, PRESENCE,
PUSH_RULES, REACTION, READ_RECEIPT, READ_RECEIPT_OTHER, REDACTED, REDACTED_INVALID,
REDACTED_STATE, REDACTION, TAG, TOPIC, TOPIC_REDACTION, TYPING,
};
/// An empty response.

View File

@@ -146,6 +146,21 @@ pub static MEMBER: Lazy<JsonValue> = Lazy::new(|| {
})
});
pub static MEMBER_BAN: Lazy<JsonValue> = Lazy::new(|| {
json!({
"content": {
"avatar_url": null,
"displayname": "example",
"membership": "ban"
},
"event_id": "$151800140517rfvjc:localhost",
"origin_server_ts": 151800140,
"sender": "@example:localhost",
"state_key": "@banned:localhost",
"type": "m.room.member",
})
});
pub static MEMBER_INVITE: Lazy<JsonValue> = Lazy::new(|| {
json!({
"content": {