Skip to content

feat(rooms): a room page can send a chat message (rooms.putMessage) - #453

Merged
stormer78 merged 1 commit into
mainfrom
feat/page-put-message
Nov 25, 2026
Merged

stormer78 merged 1 commit into
mainfrom
feat/page-put-message

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

Why

A community member portal can write to a room only with rooms.putNote, which requires a title. Keyring shows a record that has text and no title as an ordinary chat message. So a member using the portal could not reply in a room's chat: everything they wrote showed up as a note with a title.

What

  • @openvtc/pnm-core/rooms writeMessageAsMember(room, { body }) writes the text with no title, as the member.
    • Where the room's profile lists them, the record also carries kind: "message" and writtenAt, so every reader shows it as a message.
    • A room whose profile lists neither still takes the message as an untitled record, which the reading rules show as a message (Untitled records, shownKind).
    • The record is sealed on attributed / private rooms and stored in the clear on open ones. Writes are create-only, and an empty message is refused before anything is sent.
  • window.vtaWallet.rooms.putMessage({ hostDid, roomId, body }) has the same gates as putNote:
    • the call's shape is checked;
    • the page must be the community's portal (the SignInPortal origin);
    • the room must be shared with that page;
    • the share's member is used, never the member the page names;
    • the member confirms the write in the wallet's window, which says "Send this message to the room as you?" and shows the text.
  • putNote still requires a title. A note and a message are different records, and a page that offers both says which one it is writing.

The VTI member portal's compose panel will use this behind a Note / Message switch (VTI PR to follow), and will offer only notes to a wallet that has no putMessage.

Tests

  • core: the sealed body (kind, body, writtenAt, no title, signed as the member), the untitled fallback, the open-room cleartext, and refusal of an empty message.
  • extension: the call-shape check, the confirmation prompt, a declined prompt writing nothing, a room not shared being refused, the share's member being used, and the open-room write going through the offscreen document.
  • npm run lint, npm test (core 1336, extension 1578), npm run build and check-task-versions all pass locally.

The member portal could add only notes, because putNote is the one write a
page has and it requires a title. Keyring shows a record with text and no
title as an ordinary chat message, so a portal member could not answer in
a room's chat.

rooms.putMessage({ hostDid, roomId, body }) writes the text with no title,
as the member, through writeMessageAsMember in @openvtc/pnm-core/rooms:
kind "message" and writtenAt where the room's profile lists them, else an
untitled record, which the reading rules show as a message. Sealed on
attributed and private rooms, in the clear on open ones.

Same gates as putNote: the page is the community's portal, the room is
shared with it, the share's member is used, never the page's, and the
write is confirmed in the wallet's window, worded as a message.

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78
stormer78 merged commit bb65625 into main Nov 25, 2026
4 checks passed
@stormer78
stormer78 deleted the feat/page-put-message branch November 25, 2026 18:35
stormer78 added a commit to OpenVTC/verifiable-trust-infrastructure that referenced this pull request Nov 25, 2026
…onversation scrolls

A member could add only notes to a room from the portal: the compose panel
took a title and a note, and refused an empty title. Keyring shows a room
record with text and no title as an ordinary chat message, so a portal
member could not answer a conversation going on in Keyring.

The compose panel now has a Note / Message switch. It starts on Note, as
asked, and remembers the member's last choice in this browser. Message is
one box: Enter sends, Shift+Enter starts a new line. It writes through the
wallet's new rooms.putMessage (OpenVTC/vta-browser-plugin#453), which
writes the text with no title and kind "message" where the room takes it,
confirmed in the wallet's window like any write. A wallet without
putMessage is offered notes only.

The conversation scrolls in its own window, sized to the screen and
opened at the newest message. It follows new messages while the member is
at the bottom, or when the newest one is their own, and never pulls them
down from something older they scrolled up to read. Only the layout
changes: the order is still the wallet's, so the portal, the wallet and
Keyring show the room alike.

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
stormer78 added a commit to OpenVTC/verifiable-trust-infrastructure that referenced this pull request Nov 25, 2026
…onversation scrolls (#2820)

A member could add only notes to a room from the portal: the compose panel
took a title and a note, and refused an empty title. Keyring shows a room
record with text and no title as an ordinary chat message, so a portal
member could not answer a conversation going on in Keyring.

The compose panel now has a Note / Message switch. It starts on Note, as
asked, and remembers the member's last choice in this browser. Message is
one box: Enter sends, Shift+Enter starts a new line. It writes through the
wallet's new rooms.putMessage (OpenVTC/vta-browser-plugin#453), which
writes the text with no title and kind "message" where the room takes it,
confirmed in the wallet's window like any write. A wallet without
putMessage is offered notes only.

The conversation scrolls in its own window, sized to the screen and
opened at the newest message. It follows new messages while the member is
at the bottom, or when the newest one is their own, and never pulls them
down from something older they scrolled up to read. Only the layout
changes: the order is still the wallet's, so the portal, the wallet and
Keyring show the room alike.

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant