- |
- {PRIVACY_PUBLIC} |
-
-
- if let Some(r) = reply.reply_to.get() {
- if let Some(au) = post_author(&r) {
- if let Ok(uid) = au.id() {
- to_vec.push(uid.to_string());
- if let Ok(name) = au.name() {
- let domain = Uri::domain(&uid);
- mention_tags.push({
- use apb::LinkMut;
- LinkMut::set_name(apb::new(), Some(format!("@{}@{}", name, domain))) // TODO ewww but name clashes
- .set_link_type(Some(apb::LinkType::Mention))
- .set_href(Some(uid))
- });
- }
- }
- }
- }
- for mention in mentions.get().as_deref().unwrap_or(&[]) {
- to_vec.push(mention.href.clone());
- }
- let payload = apb::new()
- .set_object_type(Some(apb::ObjectType::Note))
- .set_summary(summary)
- .set_content(Some(content))
- .set_context(apb::Node::maybe_link(reply.context.get()))
- .set_in_reply_to(apb::Node::maybe_link(reply.reply_to.get()))
- .set_to(apb::Node::links(to_vec))
- .set_cc(apb::Node::links(cc_vec))
- .set_tag(apb::Node::array(mention_tags));
- match Http::post(&auth.outbox(), &payload, auth).await {
- Err(e) => set_error.set(Some(e.to_string())),
- Ok(()) => {
- set_error.set(None);
- if let Some(x) = summary_ref.get() { x.set_value("") }
- set_content.set("".to_string());
- },
- }
- set_posting.set(false);
- })
- } >post
- |
-
-