mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 13:16:56 +00:00
fix: Don't allow set_unsigned to panic
While an error in this function is probably bad, detonating a metric tonne of TNT on the call tree is probably worse
This commit is contained in:
12 files changed
+73
-67
No files matched your search
@@ -3,6 +3,7 @@ use std::{mem::size_of, sync::Arc};
|
||||
use conduwuit::{
|
||||
arrayvec::ArrayVec,
|
||||
matrix::PduCount,
|
||||
result::LogErr,
|
||||
utils::{
|
||||
ReadyExt,
|
||||
stream::{TryIgnore, WidebandExt},
|
||||
@@ -99,7 +100,9 @@ impl Data {
|
||||
.timeline
|
||||
.get_unsigned_context(&pdu, Some(user_id))
|
||||
.await;
|
||||
pdu.set_unsigned(ctx.user_id, ctx.membership, ctx.prev_content, ctx.redacted_because);
|
||||
pdu.set_unsigned(ctx.user_id, ctx.membership, ctx.prev_content, ctx.redacted_because)
|
||||
.log_err()
|
||||
.ok();
|
||||
|
||||
Some((shorteventid, pdu))
|
||||
})
|
||||
|
||||
@@ -5,6 +5,7 @@ use conduwuit::{
|
||||
arrayvec::ArrayVec,
|
||||
debug_warn,
|
||||
matrix::event::{Event, Matches},
|
||||
result::LogErr,
|
||||
utils::{
|
||||
ArrayVecExt, IterStream, ReadyExt, set,
|
||||
stream::{TryIgnore, WidebandExt},
|
||||
@@ -147,7 +148,9 @@ impl Service {
|
||||
ctx.membership,
|
||||
ctx.prev_content,
|
||||
ctx.redacted_because,
|
||||
);
|
||||
)
|
||||
.log_err()
|
||||
.ok();
|
||||
|
||||
Some(pdu)
|
||||
})
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use std::{collections::BTreeMap, sync::Arc};
|
||||
|
||||
use conduwuit::result::LogErr;
|
||||
use conduwuit_core::{
|
||||
Event, Result, err,
|
||||
matrix::pdu::{PduCount, PduEvent, PduId, RawPduId},
|
||||
@@ -174,7 +175,9 @@ impl Service {
|
||||
ctx.membership,
|
||||
ctx.prev_content,
|
||||
ctx.redacted_because,
|
||||
);
|
||||
)
|
||||
.log_err()
|
||||
.ok();
|
||||
|
||||
Some((pdu_id.shorteventid, pdu))
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user