-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(base): Remove
impl From
for SyncTimelineEvent
I feel like the ability to convert straight from a `Raw<AnySyncTimelineEvent>>` into a `SyncTimelineEvent` is somewhat over-simplified: the two are only occasionally equivalent, and it's better to be explicit. Changelog: `SyncTimelineEvent` no longer implements `From<Raw<AnySyncTimelineEvent>>`.
- Loading branch information
Showing
12 changed files
with
52 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -320,7 +320,10 @@ mod tests { | |
use ruma::room_id; | ||
use tokio::{spawn, time::sleep}; | ||
|
||
use crate::{event_cache::store::Gap, test_utils::logged_in_client}; | ||
use crate::{ | ||
deserialized_responses::SyncTimelineEvent, event_cache::store::Gap, | ||
test_utils::logged_in_client, | ||
}; | ||
|
||
#[async_test] | ||
async fn test_wait_no_pagination_token() { | ||
|
@@ -335,14 +338,15 @@ mod tests { | |
let (room_event_cache, _drop_handlers) = event_cache.for_room(room_id).await.unwrap(); | ||
|
||
// When I only have events in a room, | ||
room_event_cache.inner.state.write().await.events.push_events([sync_timeline_event!({ | ||
"sender": "[email protected]", | ||
"type": "m.room.message", | ||
"event_id": "$ida", | ||
"origin_server_ts": 12344446, | ||
"content": { "body":"yolo", "msgtype": "m.text" }, | ||
}) | ||
.into()]); | ||
room_event_cache.inner.state.write().await.events.push_events([ | ||
SyncTimelineEvent::new(sync_timeline_event!({ | ||
"sender": "[email protected]", | ||
"type": "m.room.message", | ||
"event_id": "$ida", | ||
"origin_server_ts": 12344446, | ||
"content": { "body":"yolo", "msgtype": "m.text" }, | ||
})), | ||
]); | ||
|
||
let pagination = room_event_cache.pagination(); | ||
|
||
|
@@ -395,14 +399,13 @@ mod tests { | |
{ | ||
let room_events = &mut room_event_cache.inner.state.write().await.events; | ||
room_events.push_gap(Gap { prev_token: expected_token.clone() }); | ||
room_events.push_events([sync_timeline_event!({ | ||
room_events.push_events([SyncTimelineEvent::new(sync_timeline_event!({ | ||
"sender": "[email protected]", | ||
"type": "m.room.message", | ||
"event_id": "$ida", | ||
"origin_server_ts": 12344446, | ||
"content": { "body":"yolo", "msgtype": "m.text" }, | ||
}) | ||
.into()]); | ||
}))]); | ||
} | ||
|
||
let pagination = room_event_cache.pagination(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters