@@ -104,7 +104,7 @@ use crate::{
104104 room:: power_levels:: { RoomPowerLevelChanges , RoomPowerLevelsExt } ,
105105 sync:: RoomUpdate ,
106106 utils:: { IntoRawMessageLikeEventContent , IntoRawStateEventContent } ,
107- BaseRoom , Client , Error , HttpError , HttpResult , Result , RoomState , TransmissionProgress ,
107+ BaseRoom , Client , Error , HttpResult , Result , RoomState , TransmissionProgress ,
108108} ;
109109
110110pub mod futures;
@@ -983,15 +983,15 @@ impl Room {
983983 & self ,
984984 tag : TagName ,
985985 tag_info : TagInfo ,
986- ) -> HttpResult < create_tag:: v3:: Response > {
987- let user_id = self . client . user_id ( ) . ok_or ( HttpError :: AuthenticationRequired ) ?;
986+ ) -> Result < create_tag:: v3:: Response > {
987+ let user_id = self . client . user_id ( ) . ok_or ( Error :: AuthenticationRequired ) ?;
988988 let request = create_tag:: v3:: Request :: new (
989989 user_id. to_owned ( ) ,
990990 self . inner . room_id ( ) . to_owned ( ) ,
991991 tag. to_string ( ) ,
992992 tag_info,
993993 ) ;
994- self . client . send ( request, None ) . await
994+ Ok ( self . client . send ( request, None ) . await ? )
995995 }
996996
997997 /// Removes a tag from the room.
@@ -1000,14 +1000,14 @@ impl Room {
10001000 ///
10011001 /// # Arguments
10021002 /// * `tag` - The tag to remove.
1003- pub async fn remove_tag ( & self , tag : TagName ) -> HttpResult < delete_tag:: v3:: Response > {
1004- let user_id = self . client . user_id ( ) . ok_or ( HttpError :: AuthenticationRequired ) ?;
1003+ pub async fn remove_tag ( & self , tag : TagName ) -> Result < delete_tag:: v3:: Response > {
1004+ let user_id = self . client . user_id ( ) . ok_or ( Error :: AuthenticationRequired ) ?;
10051005 let request = delete_tag:: v3:: Request :: new (
10061006 user_id. to_owned ( ) ,
10071007 self . inner . room_id ( ) . to_owned ( ) ,
10081008 tag. to_string ( ) ,
10091009 ) ;
1010- self . client . send ( request, None ) . await
1010+ Ok ( self . client . send ( request, None ) . await ? )
10111011 }
10121012
10131013 /// Add or remove the `m.favourite` flag for this room.
@@ -1071,8 +1071,7 @@ impl Room {
10711071 /// # Arguments
10721072 /// * `is_direct` - Whether to mark this room as direct.
10731073 pub async fn set_is_direct ( & self , is_direct : bool ) -> Result < ( ) > {
1074- let user_id =
1075- self . client . user_id ( ) . ok_or_else ( || Error :: from ( HttpError :: AuthenticationRequired ) ) ?;
1074+ let user_id = self . client . user_id ( ) . ok_or ( Error :: AuthenticationRequired ) ?;
10761075
10771076 let mut content = self
10781077 . client
@@ -2602,8 +2601,7 @@ impl Room {
26022601 /// Set a flag on the room to indicate that the user has explicitly marked
26032602 /// it as (un)read.
26042603 pub async fn set_unread_flag ( & self , unread : bool ) -> Result < ( ) > {
2605- let user_id =
2606- self . client . user_id ( ) . ok_or_else ( || Error :: from ( HttpError :: AuthenticationRequired ) ) ?;
2604+ let user_id = self . client . user_id ( ) . ok_or ( Error :: AuthenticationRequired ) ?;
26072605
26082606 let content = MarkedUnreadEventContent :: new ( unread) ;
26092607
0 commit comments