prose-im / prose-app-web

Prose Web application. XMPP client for team messaging.
https://prose.org/downloads
Mozilla Public License 2.0
25 stars 2 forks source link

Render replies (XEP-0461) #141

Open nesium opened 2 months ago

nesium commented 2 months ago

Message has a new field replyTo

export class Message {
  // …  
  /**
  * A reference to a message that this message is in reply to.
  */
  readonly replyTo: ReplyTo | undefined;
  // …
}

export class ReplyTo {
  /**
  * The formatted HTML of the replied-to message, if available. Should be used for display.
  */
  readonly body: string | undefined;
  /**
  * The ID of the replied-to message, if available.
  */
  readonly id: string | undefined;
  /**
  * The sender of the replied-to message.
  */
  readonly sender: MessageSender;
  /**
  * The timestamp of the replied-to message, if available.
  */
  readonly timestamp: Date | undefined;
}

Here's an example how Gajim renders replies…

Screenshot 2024-09-05 at 17 23 21

The content in the gray box would be the content of the ReplyTo struct in that example.

Currently replies are read-only since XEP-0461: Message Replies is not immediately compatible with XEP-0481: Content Types in Messages.

But we'll probably want to display replies in threads, like Slack does, anyways.

Refs prose-im/prose-core-client#99