events: Fix issues from not testing previous commits
This commit is contained in:
parent
55df2aa26a
commit
ecf875358c
@ -47,7 +47,7 @@ impl ThirdPartyInviteEventContent {
|
|||||||
/// Creates a new `ThirdPartyInviteEventContent` with the given display name, key validity url
|
/// Creates a new `ThirdPartyInviteEventContent` with the given display name, key validity url
|
||||||
/// and public key.
|
/// and public key.
|
||||||
pub fn new(display_name: String, key_validity_url: String, public_key: String) -> Self {
|
pub fn new(display_name: String, key_validity_url: String, public_key: String) -> Self {
|
||||||
Self { display_name, key_validity_url, public_key, public_keys }
|
Self { display_name, key_validity_url, public_key, public_keys: None }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ use serde_json::{
|
|||||||
fn unsigned() -> RedactedUnsigned {
|
fn unsigned() -> RedactedUnsigned {
|
||||||
let mut unsigned = RedactedUnsigned::default();
|
let mut unsigned = RedactedUnsigned::default();
|
||||||
unsigned.redacted_because = Some(Box::new(SyncRedactionEvent {
|
unsigned.redacted_because = Some(Box::new(SyncRedactionEvent {
|
||||||
content: RedactionEventContent { reason: Some("redacted because".into()) },
|
content: RedactionEventContent::with_reason("redacted because".into()),
|
||||||
redacts: event_id!("$h29iv0s8:example.com"),
|
redacts: event_id!("$h29iv0s8:example.com"),
|
||||||
event_id: event_id!("$h29iv0s8:example.com"),
|
event_id: event_id!("$h29iv0s8:example.com"),
|
||||||
origin_server_ts: MilliSecondsSinceUnixEpoch(uint!(1)),
|
origin_server_ts: MilliSecondsSinceUnixEpoch(uint!(1)),
|
||||||
@ -167,7 +167,7 @@ fn redacted_deserialize_any_room_sync() {
|
|||||||
// to return early with `RedactedContent` instead of failing to deserialize according
|
// to return early with `RedactedContent` instead of failing to deserialize according
|
||||||
// to the event type string.
|
// to the event type string.
|
||||||
unsigned.redacted_because = Some(Box::new(SyncRedactionEvent {
|
unsigned.redacted_because = Some(Box::new(SyncRedactionEvent {
|
||||||
content: RedactionEventContent { reason: Some("redacted because".into()) },
|
content: RedactionEventContent::with_reason("redacted because".into()),
|
||||||
redacts: event_id!("$h29iv0s8:example.com"),
|
redacts: event_id!("$h29iv0s8:example.com"),
|
||||||
event_id: event_id!("$h29iv0s8:example.com"),
|
event_id: event_id!("$h29iv0s8:example.com"),
|
||||||
origin_server_ts: MilliSecondsSinceUnixEpoch(uint!(1)),
|
origin_server_ts: MilliSecondsSinceUnixEpoch(uint!(1)),
|
||||||
@ -310,7 +310,7 @@ fn redact_method_properly_redacts() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let redaction = SyncRedactionEvent {
|
let redaction = SyncRedactionEvent {
|
||||||
content: RedactionEventContent { reason: Some("redacted because".into()) },
|
content: RedactionEventContent::with_reason("redacted because".into()),
|
||||||
redacts: event_id!("$143273582443PhrSn:example.com"),
|
redacts: event_id!("$143273582443PhrSn:example.com"),
|
||||||
event_id: event_id!("$h29iv0s8:example.com"),
|
event_id: event_id!("$h29iv0s8:example.com"),
|
||||||
origin_server_ts: MilliSecondsSinceUnixEpoch(uint!(1)),
|
origin_server_ts: MilliSecondsSinceUnixEpoch(uint!(1)),
|
||||||
|
@ -28,7 +28,7 @@ fn redaction() -> JsonValue {
|
|||||||
#[test]
|
#[test]
|
||||||
fn serialize_redaction() {
|
fn serialize_redaction() {
|
||||||
let aliases_event = RedactionEvent {
|
let aliases_event = RedactionEvent {
|
||||||
content: RedactionEventContent { reason: Some("being a turd".into()) },
|
content: RedactionEventContent::with_reason("being a turd".into()),
|
||||||
redacts: event_id!("$nomore:example.com"),
|
redacts: event_id!("$nomore:example.com"),
|
||||||
event_id: event_id!("$h29iv0s8:example.com"),
|
event_id: event_id!("$h29iv0s8:example.com"),
|
||||||
origin_server_ts: MilliSecondsSinceUnixEpoch(uint!(1)),
|
origin_server_ts: MilliSecondsSinceUnixEpoch(uint!(1)),
|
||||||
@ -53,7 +53,7 @@ fn deserialize_redaction() {
|
|||||||
.deserialize()
|
.deserialize()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
AnyMessageEvent::RoomRedaction(RedactionEvent {
|
AnyMessageEvent::RoomRedaction(RedactionEvent {
|
||||||
content: RedactionEventContent { reason: Some(reas) },
|
content: RedactionEventContent { reason: Some(reas), .. },
|
||||||
redacts,
|
redacts,
|
||||||
event_id,
|
event_id,
|
||||||
origin_server_ts,
|
origin_server_ts,
|
||||||
|
@ -160,7 +160,7 @@ fn relates_to_content_serialization() {
|
|||||||
let message_event_content =
|
let message_event_content =
|
||||||
assign!(MessageEventContent::text_plain("> <@test:example.com> test\n\ntest reply"), {
|
assign!(MessageEventContent::text_plain("> <@test:example.com> test\n\ntest reply"), {
|
||||||
relates_to: Some(Relation::Reply {
|
relates_to: Some(Relation::Reply {
|
||||||
in_reply_to: InReplyTo { event_id: event_id!("$15827405538098VGFWH:example.com") },
|
in_reply_to: InReplyTo::new(event_id!("$15827405538098VGFWH:example.com")),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -9,9 +9,7 @@ use serde_json::{from_value as from_json_value, json, to_value as to_json_value}
|
|||||||
#[test]
|
#[test]
|
||||||
fn serialize_stripped_state_event_any_content() {
|
fn serialize_stripped_state_event_any_content() {
|
||||||
let event = StrippedStateEvent {
|
let event = StrippedStateEvent {
|
||||||
content: AnyStateEventContent::RoomTopic(TopicEventContent {
|
content: AnyStateEventContent::RoomTopic(TopicEventContent::new("Testing room".into())),
|
||||||
topic: "Testing room".into(),
|
|
||||||
}),
|
|
||||||
state_key: "".into(),
|
state_key: "".into(),
|
||||||
sender: user_id!("@example:localhost"),
|
sender: user_id!("@example:localhost"),
|
||||||
};
|
};
|
||||||
@ -31,7 +29,7 @@ fn serialize_stripped_state_event_any_content() {
|
|||||||
#[test]
|
#[test]
|
||||||
fn serialize_stripped_state_event_any_event() {
|
fn serialize_stripped_state_event_any_event() {
|
||||||
let event = AnyStrippedStateEvent::RoomTopic(StrippedStateEvent {
|
let event = AnyStrippedStateEvent::RoomTopic(StrippedStateEvent {
|
||||||
content: TopicEventContent { topic: "Testing room".into() },
|
content: TopicEventContent::new("Testing room".into()),
|
||||||
state_key: "".into(),
|
state_key: "".into(),
|
||||||
sender: user_id!("@example:localhost"),
|
sender: user_id!("@example:localhost"),
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user