bump matrix-sdk 0.14 → 0.18 (#2529)
This commit is contained in:
parent
90831761e9
commit
5b7904eeb6
3 changed files with 364 additions and 388 deletions
734
Cargo.lock
generated
734
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -89,8 +89,7 @@ time = { version = "0.3", default-features = false, features = [
|
||||||
"parsing",
|
"parsing",
|
||||||
] }
|
] }
|
||||||
petgraph = { version = "0.8", default-features = false, features = ["std"] }
|
petgraph = { version = "0.8", default-features = false, features = ["std"] }
|
||||||
matrix-sdk = { version = "0.14", default-features = false, features = [
|
matrix-sdk = { version = "0.18", default-features = false, features = [
|
||||||
"rustls-tls",
|
|
||||||
"sqlite",
|
"sqlite",
|
||||||
"markdown",
|
"markdown",
|
||||||
"e2e-encryption",
|
"e2e-encryption",
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ use matrix_sdk::{
|
||||||
reaction::ReactionEventContent,
|
reaction::ReactionEventContent,
|
||||||
receipt::ReceiptThread,
|
receipt::ReceiptThread,
|
||||||
relation::Annotation,
|
relation::Annotation,
|
||||||
room::message::{MessageType, RoomMessageEventContent},
|
room::message::{AddMentions, MessageType, RoomMessageEventContent},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
@ -159,7 +159,7 @@ fn extract_in_reply_to(event: &matrix_sdk::ruma::events::AnySyncTimelineEvent) -
|
||||||
return None;
|
return None;
|
||||||
};
|
};
|
||||||
match ev.as_original()?.content.relates_to.as_ref()? {
|
match ev.as_original()?.content.relates_to.as_ref()? {
|
||||||
Relation::Reply { in_reply_to } => Some(in_reply_to.event_id.to_string()),
|
Relation::Reply(reply) => Some(reply.in_reply_to.event_id.to_string()),
|
||||||
Relation::Thread(thread) => thread.in_reply_to.as_ref().map(|r| r.event_id.to_string()),
|
Relation::Thread(thread) => thread.in_reply_to.as_ref().map(|r| r.event_id.to_string()),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
|
|
@ -208,7 +208,7 @@ pub async fn send_message(client: &Client, room_ref: &str, body: &str) -> Daemon
|
||||||
let content = RoomMessageEventContent::text_markdown(body);
|
let content = RoomMessageEventContent::text_markdown(body);
|
||||||
match room.send(content).await {
|
match room.send(content).await {
|
||||||
Ok(resp) => DaemonResponse::ok(&serde_json::json!({
|
Ok(resp) => DaemonResponse::ok(&serde_json::json!({
|
||||||
"event_id": resp.event_id.to_string(),
|
"event_id": resp.response.event_id.to_string(),
|
||||||
"room_id": room.room_id().to_string(),
|
"room_id": room.room_id().to_string(),
|
||||||
})),
|
})),
|
||||||
Err(e) => DaemonResponse::error(format!("send to {}: {e}", room.room_id())),
|
Err(e) => DaemonResponse::error(format!("send to {}: {e}", room.room_id())),
|
||||||
|
|
@ -249,7 +249,7 @@ pub async fn send_dm(client: &Client, user_id: &str, body: &str) -> DaemonRespon
|
||||||
let content = RoomMessageEventContent::text_markdown(body);
|
let content = RoomMessageEventContent::text_markdown(body);
|
||||||
match room.send(content).await {
|
match room.send(content).await {
|
||||||
Ok(resp) => DaemonResponse::ok(&serde_json::json!({
|
Ok(resp) => DaemonResponse::ok(&serde_json::json!({
|
||||||
"event_id": resp.event_id.to_string(),
|
"event_id": resp.response.event_id.to_string(),
|
||||||
"room_id": room.room_id().to_string(),
|
"room_id": room.room_id().to_string(),
|
||||||
"user_id": user_id,
|
"user_id": user_id,
|
||||||
})),
|
})),
|
||||||
|
|
@ -367,7 +367,7 @@ pub async fn send_reaction(
|
||||||
let content = ReactionEventContent::new(Annotation::new(eid.clone(), key.to_owned()));
|
let content = ReactionEventContent::new(Annotation::new(eid.clone(), key.to_owned()));
|
||||||
match room.send(content).await {
|
match room.send(content).await {
|
||||||
Ok(resp) => DaemonResponse::ok(&serde_json::json!({
|
Ok(resp) => DaemonResponse::ok(&serde_json::json!({
|
||||||
"event_id": resp.event_id.to_string(),
|
"event_id": resp.response.event_id.to_string(),
|
||||||
"target": eid.to_string(),
|
"target": eid.to_string(),
|
||||||
})),
|
})),
|
||||||
Err(e) => DaemonResponse::error(format!("send reaction to {eid}: {e}")),
|
Err(e) => DaemonResponse::error(format!("send reaction to {eid}: {e}")),
|
||||||
|
|
@ -395,6 +395,9 @@ pub async fn send_reply(
|
||||||
let reply = Reply {
|
let reply = Reply {
|
||||||
event_id: eid.clone(),
|
event_id: eid.clone(),
|
||||||
enforce_thread: EnforceThread::MaybeThreaded,
|
enforce_thread: EnforceThread::MaybeThreaded,
|
||||||
|
// Add the replied-to sender to m.mentions (standard reply UX — the
|
||||||
|
// SDK downgrades this to No when replying to your own event).
|
||||||
|
add_mentions: AddMentions::Yes,
|
||||||
};
|
};
|
||||||
let reply_content = match room.make_reply_event(content, reply).await {
|
let reply_content = match room.make_reply_event(content, reply).await {
|
||||||
Ok(c) => c,
|
Ok(c) => c,
|
||||||
|
|
@ -402,7 +405,7 @@ pub async fn send_reply(
|
||||||
};
|
};
|
||||||
match room.send(reply_content).await {
|
match room.send(reply_content).await {
|
||||||
Ok(resp) => DaemonResponse::ok(&serde_json::json!({
|
Ok(resp) => DaemonResponse::ok(&serde_json::json!({
|
||||||
"event_id": resp.event_id.to_string(),
|
"event_id": resp.response.event_id.to_string(),
|
||||||
"target": eid.to_string(),
|
"target": eid.to_string(),
|
||||||
})),
|
})),
|
||||||
Err(e) => DaemonResponse::error(format!("send reply: {e}")),
|
Err(e) => DaemonResponse::error(format!("send reply: {e}")),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue