Commit e53abd2732
Unsigned
Layout: unified · split
src/connection.rs +9 −1
| @@ -98,10 +98,14 @@ impl Connection { | ||
| 98 | 98 | /// |
| 99 | 99 | /// * `content` - The content of the message that will be sent to the |
| 100 | 100 | /// server. |
| 101 | /// | |
| 102 | /// * `transaction_id` - Attach an unique id to this message, later on the | |
| 103 | /// event will contain the same id in the unsigned part of the event. | |
| 101 | 104 | pub async fn send_message( |
| 102 | 105 | &self, |
| 103 | 106 | room_id: &RoomId, |
| 104 | 107 | content: AnyMessageEventContent, |
| 108 | transaction_id: Option<Uuid>, | |
| 105 | 109 | ) -> MatrixResult<RoomSendResponse> { |
| 106 | 110 | let room_id = room_id.to_owned(); |
| 107 | 111 | let client = self.client.clone(); |
| @@ -110,7 +114,11 @@ impl Connection { | ||
| 110 | 114 | .runtime |
| 111 | 115 | .spawn(async move { |
| 112 | 116 | client |
| 113 | .room_send(&room_id, content, Some(Uuid::new_v4())) | |
| 117 | .room_send( | |
| 118 | &room_id, | |
| 119 | content, | |
| 120 | Some(transaction_id.unwrap_or_else(Uuid::new_v4)), | |
| 121 | ) | |
| 114 | 122 | .await |
| 115 | 123 | }) |
| 116 | 124 | .await; |
src/room_buffer.rs +1 −1
| @@ -119,7 +119,7 @@ impl BufferInputCallbackAsync for MatrixRoom { | ||
| 119 | 119 | |
| 120 | 120 | let content = AnyMessageEventContent::RoomMessage(content); |
| 121 | 121 | |
| 122 | match c.send_message(&self.room_id, content).await { | |
| 122 | match c.send_message(&self.room_id, content, None).await { | |
| 123 | 123 | Ok(_r) => (), |
| 124 | 124 | Err(_e) => (), |
| 125 | 125 | } |