Commit ecd22dd5b9
Unsigned
Layout: unified · split
src/room/mod.rs +12 −5
| @@ -1187,14 +1187,14 @@ impl MatrixRoom { | |||
| 1187 | .reply_full_quote_threshold(); | 1187 | .reply_full_quote_threshold(); |
| 1188 | let context = reply_context_for_distance( | 1188 | let context = reply_context_for_distance( |
| 1189 | threshold, | 1189 | threshold, |
| 1190 | self.buffer.reply_line_distance(event_id), | 1190 | self.buffer.reply_line_distance(&event_id), |
| 1191 | ); | 1191 | ); |
| 1192 | 1192 | ||
| 1193 | let needs_remote_context = reply_sender.is_none() | 1193 | let needs_remote_context = reply_sender.is_none() |
| 1194 | || (context == ReplyContext::Full | 1194 | || (context == ReplyContext::Full |
| 1195 | && !rendered.has_reply_fallback()); | 1195 | && !rendered.has_reply_fallback()); |
| 1196 | let remote_context = if needs_remote_context { | 1196 | let remote_context = if needs_remote_context { |
| 1197 | self.load_reply_context(event_id).await | 1197 | self.load_reply_context(&event_id).await |
| 1198 | } else { | 1198 | } else { |
| 1199 | None | 1199 | None |
| 1200 | }; | 1200 | }; |
| @@ -1216,7 +1216,7 @@ impl MatrixRoom { | |||
| 1216 | }; | 1216 | }; |
| 1217 | 1217 | ||
| 1218 | rendered.add_reply_context( | 1218 | rendered.add_reply_context( |
| 1219 | event_id, | 1219 | &event_id, |
| 1220 | reply_sender.as_deref(), | 1220 | reply_sender.as_deref(), |
| 1221 | context, | 1221 | context, |
| 1222 | fetched_body, | 1222 | fetched_body, |
| @@ -1235,8 +1235,15 @@ impl MatrixRoom { | |||
| 1235 | &self, | 1235 | &self, |
| 1236 | event_id: &EventId, | 1236 | event_id: &EventId, |
| 1237 | ) -> Option<ResolvedReplyContext> { | 1237 | ) -> Option<ResolvedReplyContext> { |
| 1238 | let timeline_event = | 1238 | let connection = self.connection.borrow().as_ref().cloned()?; |
| 1239 | self.room().load_or_fetch_event(event_id, None).await.ok()?; | 1239 | let room = self.room(); |
| 1240 | let event_id = event_id.to_owned(); | ||
| 1241 | let timeline_event = connection | ||
| 1242 | .spawn( | ||
| 1243 | async move { room.load_or_fetch_event(&event_id, None).await }, | ||
| 1244 | ) | ||
| 1245 | .await | ||
| 1246 | .ok()?; | ||
| 1240 | let event = timeline_event.raw().deserialize().ok()?; | 1247 | let event = timeline_event.raw().deserialize().ok()?; |
| 1241 | let (sender_id, body) = reply_event_details(event)?; | 1248 | let (sender_id, body) = reply_event_details(event)?; |
| 1242 | let sender = self | 1249 | let sender = self |