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
|
|
@ -19,7 +19,7 @@ use matrix_sdk::{
|
|||
reaction::ReactionEventContent,
|
||||
receipt::ReceiptThread,
|
||||
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;
|
||||
};
|
||||
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()),
|
||||
_ => None,
|
||||
}
|
||||
|
|
@ -208,7 +208,7 @@ pub async fn send_message(client: &Client, room_ref: &str, body: &str) -> Daemon
|
|||
let content = RoomMessageEventContent::text_markdown(body);
|
||||
match room.send(content).await {
|
||||
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(),
|
||||
})),
|
||||
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);
|
||||
match room.send(content).await {
|
||||
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(),
|
||||
"user_id": user_id,
|
||||
})),
|
||||
|
|
@ -367,7 +367,7 @@ pub async fn send_reaction(
|
|||
let content = ReactionEventContent::new(Annotation::new(eid.clone(), key.to_owned()));
|
||||
match room.send(content).await {
|
||||
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(),
|
||||
})),
|
||||
Err(e) => DaemonResponse::error(format!("send reaction to {eid}: {e}")),
|
||||
|
|
@ -395,6 +395,9 @@ pub async fn send_reply(
|
|||
let reply = Reply {
|
||||
event_id: eid.clone(),
|
||||
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 {
|
||||
Ok(c) => c,
|
||||
|
|
@ -402,7 +405,7 @@ pub async fn send_reply(
|
|||
};
|
||||
match room.send(reply_content).await {
|
||||
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(),
|
||||
})),
|
||||
Err(e) => DaemonResponse::error(format!("send reply: {e}")),
|
||||
|
|
|
|||
Loading…
Reference in a new issue