nickname
This commit is contained in:
@@ -27,6 +27,7 @@ async function enrichMessage(ctx: any, msg: any, userId?: any) {
|
||||
}
|
||||
|
||||
let replyToUsername: string | null = null;
|
||||
let replyToDisplayName: string | null = null;
|
||||
let replyToContent: string | null = null;
|
||||
let replyToNonce: string | null = null;
|
||||
let replyToAvatarUrl: string | null = null;
|
||||
@@ -35,6 +36,7 @@ async function enrichMessage(ctx: any, msg: any, userId?: any) {
|
||||
if (repliedMsg) {
|
||||
const repliedSender = await ctx.db.get(repliedMsg.senderId);
|
||||
replyToUsername = repliedSender?.username || "Unknown";
|
||||
replyToDisplayName = repliedSender?.displayName || null;
|
||||
replyToContent = repliedMsg.ciphertext;
|
||||
replyToNonce = repliedMsg.nonce;
|
||||
if (repliedSender?.avatarStorageId) {
|
||||
@@ -53,11 +55,13 @@ async function enrichMessage(ctx: any, msg: any, userId?: any) {
|
||||
key_version: msg.keyVersion,
|
||||
created_at: new Date(msg._creationTime).toISOString(),
|
||||
username: sender?.username || "Unknown",
|
||||
displayName: sender?.displayName || null,
|
||||
public_signing_key: sender?.publicSigningKey || "",
|
||||
avatarUrl,
|
||||
reactions: Object.keys(reactions).length > 0 ? reactions : null,
|
||||
replyToId: msg.replyTo || null,
|
||||
replyToUsername,
|
||||
replyToDisplayName,
|
||||
replyToContent,
|
||||
replyToNonce,
|
||||
replyToAvatarUrl,
|
||||
|
||||
Reference in New Issue
Block a user