@@ -67,6 +67,7 @@ use crate::client_builder::ClientBuilder;
6767use crate :: {
6868 client:: ProgressWatcher ,
6969 error:: { ClientError , RoomError } ,
70+ event:: EventOrTransactionId ,
7071 helpers:: unwrap_or_clone_arc,
7172 ruma:: {
7273 AssetType , AudioInfo , FileInfo , FormattedBody , ImageInfo , PollKind , ThumbnailInfo ,
@@ -490,11 +491,11 @@ impl Timeline {
490491 /// local events that are being processed.
491492 pub async fn edit (
492493 & self ,
493- event_or_transaction_id : String ,
494+ event_or_transaction_id : EventOrTransactionId ,
494495 new_content : EditedContent ,
495496 ) -> Result < bool , ClientError > {
496497 self . inner
497- . edit_by_id ( & ( event_or_transaction_id. into ( ) ) , new_content. try_into ( ) ?)
498+ . edit_by_id ( & ( event_or_transaction_id. try_into ( ) ? ) , new_content. try_into ( ) ?)
498499 . await
499500 . map_err ( Into :: into)
500501 }
@@ -603,11 +604,11 @@ impl Timeline {
603604 /// Will return an error if the event couldn't be redacted.
604605 pub async fn redact_event (
605606 & self ,
606- event_or_transaction_id : String ,
607+ event_or_transaction_id : EventOrTransactionId ,
607608 reason : Option < String > ,
608609 ) -> Result < ( ) , ClientError > {
609610 self . inner
610- . redact_by_id ( & ( event_or_transaction_id. into ( ) ) , reason. as_deref ( ) )
611+ . redact_by_id ( & ( event_or_transaction_id. try_into ( ) ? ) , reason. as_deref ( ) )
611612 . await
612613 . map_err ( Into :: into)
613614 }
@@ -1033,8 +1034,7 @@ impl From<SdkShieldState> for ShieldState {
10331034pub struct EventTimelineItem {
10341035 is_local : bool ,
10351036 is_remote : bool ,
1036- transaction_id : Option < String > ,
1037- event_id : Option < String > ,
1037+ event_or_transaction_id : EventOrTransactionId ,
10381038 sender : String ,
10391039 sender_profile : ProfileDetails ,
10401040 is_own : bool ,
@@ -1072,8 +1072,7 @@ impl From<matrix_sdk_ui::timeline::EventTimelineItem> for EventTimelineItem {
10721072 Self {
10731073 is_local : value. is_local_echo ( ) ,
10741074 is_remote : !value. is_local_echo ( ) ,
1075- transaction_id : value. transaction_id ( ) . map ( |t| t. to_string ( ) ) ,
1076- event_id : value. event_id ( ) . map ( |e| e. to_string ( ) ) ,
1075+ event_or_transaction_id : value. identifier ( ) . into ( ) ,
10771076 sender : value. sender ( ) . to_string ( ) ,
10781077 sender_profile : value. sender_profile ( ) . into ( ) ,
10791078 is_own : value. is_own ( ) ,
0 commit comments