zulip/zulip

Link for sent message in API

Closed

#15,327 opened on Jun 12, 2020

 (6 comments) (0 reactions) (0 assignees)Python (7,339 forks)batch import
area: apihelp wantedpriority: highrust community request

Repository metrics

Stars
 (19,672 stars)
PR merge metrics
 (Avg merge 36d 6h) (110 merged PRs in 30d)

Description

Specification thread: #api design > Link to sent messages @ 💬

Plan is to add two fields to the POST /messages response:

  • message_link : Zulip markdown syntax for inserting into a message that will link directly to the message, a la what our copy handler does when you copy a message link in the web app UI.
  • message_url: Just the URL for the message. This should be a /near/ conversation link targeting the message directly.

The Rust project currently automatically opens Zulip topics when certain issues are filed/labeled on GitHub -- we would like to post a comment on github linking to the Zulip topic.

However, I've not found a nice way to go from the API for sending messages (which in our case automatically opens a topic for discussion) to actually getting a link to the topic in question.

Right now I'm thinking about trying to manually come up with the URL syntax by escaping and mangling the names of topics and streams (e.g., https://rust-lang.zulipchat.com/#narrow/stream/243200-t-lang.2Fmajor-changes/topic/A.20.60FunctionPointer.60.20trait.20to.20represent.20all.20.60fn.60.20lang-team.2323 could in theory be created with the information the bot has). But that's rather unfortunate and we'd need to precisely replicate the undocumented(?) strategy for mangling Zulip uses.

Opening this from here: https://github.com/zulip/zulip/issues/15290#issuecomment-642939455

Contributor guide