Tlon: format reply IDs as @ud (#1837)

This commit is contained in:
Shadow
2026-01-25 22:30:18 -06:00
parent 5d6a9da370
commit 5172098073
2 changed files with 20 additions and 6 deletions

View File

@@ -63,16 +63,28 @@ export async function sendGroupMessage({
const story = [{ inline: [text] }];
const sentAt = Date.now();
// Format reply ID as @ud (with dots) - required for Tlon to recognize thread replies
let formattedReplyId = replyToId;
if (replyToId && /^\d+$/.test(replyToId)) {
try {
formattedReplyId = formatUd(BigInt(replyToId));
} catch {
// Fall back to raw ID if formatting fails
}
}
const action = {
channel: {
nest: `chat/${hostShip}/${channelName}`,
action: replyToId
action: formattedReplyId
? {
reply: {
id: replyToId,
delta: {
add: {
memo: {
// Thread reply - needs post wrapper around reply action
// ReplyActionAdd takes Memo: {content, author, sent} - no kind/blob/meta
post: {
reply: {
id: formattedReplyId,
action: {
add: {
content: story,
author: fromShip,
sent: sentAt,
@@ -82,6 +94,7 @@ export async function sendGroupMessage({
},
}
: {
// Regular post
post: {
add: {
content: story,