1 const AnonymousUser = 'anonymous'
3 export function GetAssociatedEncryptionDataForRealtimeMessage(metadata: {
5 authorAddress: string | undefined
8 if (metadata.authorAddress) {
9 return `${metadata.version}.${metadata.authorAddress}.${metadata.timestamp}`
12 return `${metadata.version}.${AnonymousUser}.${metadata.timestamp}`
15 export function GetAssociatedEncryptionDataForComment(metadata: {
16 authorAddress: string | undefined
19 if (metadata.authorAddress) {
20 return `${metadata.authorAddress}.${metadata.markId}`
23 return `${AnonymousUser}.${metadata.markId}`
26 export function isAnonymousComment(aad: string): boolean {
27 const components = aad.split('.')
28 return components[0] === AnonymousUser