Rename pubkeys to profiles (NIP-10)

This commit is contained in:
futpib 2023-04-02 16:50:42 +04:00 committed by fiatjaf_
parent 7413072e9f
commit ce081bb4cb
2 changed files with 8 additions and 8 deletions

View File

@ -72,7 +72,7 @@ describe('parse NIP10-referenced events', () => {
relays: []
}
],
pubkeys: [
profiles: [
{
pubkey:
'77ce56f89d1228f7ff3743ce1ad1b254857b9008564727ebd5a1f317362f6ca7',
@ -137,7 +137,7 @@ describe('parse NIP10-referenced events', () => {
relays: []
}
],
pubkeys: [
profiles: [
{
pubkey:
'77ce56f89d1228f7ff3743ce1ad1b254857b9008564727ebd5a1f317362f6ca7',
@ -193,7 +193,7 @@ describe('parse NIP10-referenced events', () => {
expect(nip10.parse(event)).toEqual({
mentions: [],
pubkeys: [
profiles: [
{
pubkey:
'77ce56f89d1228f7ff3743ce1ad1b254857b9008564727ebd5a1f317362f6ca7',
@ -237,7 +237,7 @@ describe('parse NIP10-referenced events', () => {
expect(nip10.parse(event)).toEqual({
mentions: [],
pubkeys: [
profiles: [
{
pubkey:
'534780e44da7b494485e85cd4cca6af4f6caa1627472432b6f2a4ece0e9e54ec',
@ -306,7 +306,7 @@ describe('parse NIP10-referenced events', () => {
expect(nip10.parse(event)).toEqual({
mentions: [],
pubkeys: [
profiles: [
{
pubkey:
'a8c21fcd8aa1f4befba14d72fc7a012397732d30d8b3131af912642f3c726f52',

View File

@ -20,7 +20,7 @@ export type NIP10Result = {
/**
* List of pubkeys that are involved in the thread in no particular order.
*/
pubkeys: ProfilePointer[]
profiles: ProfilePointer[]
}
export function parse(event: Pick<Event, 'tags'>): NIP10Result {
@ -28,7 +28,7 @@ export function parse(event: Pick<Event, 'tags'>): NIP10Result {
reply: undefined,
root: undefined,
mentions: [],
pubkeys: []
profiles: []
}
const eTags: string[][] = []
@ -39,7 +39,7 @@ export function parse(event: Pick<Event, 'tags'>): NIP10Result {
}
if (tag[0] === 'p' && tag[1]) {
result.pubkeys.push({
result.profiles.push({
pubkey: tag[1],
relays: tag[2] ? [tag[2]] : []
})