Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance(backend): 絵文字の連合でライセンス欄を相互にやり取りするように #14109

Closed
wants to merge 5 commits into from
3 changes: 3 additions & 0 deletions packages/backend/src/core/activitypub/ApRendererService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ export class ApRendererService {
// || emoji.originalUrl してるのは後方互換性のため(publicUrlはstringなので??はだめ)
url: emoji.publicUrl || emoji.originalUrl,
},
_misskey_license: {
freeText: emoji.license
},
};
}

Expand Down
4 changes: 4 additions & 0 deletions packages/backend/src/core/activitypub/models/ApNoteService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,8 @@ export class ApNoteService {
originalUrl: tag.icon.url,
publicUrl: tag.icon.url,
updatedAt: new Date(),
// _misskey_license が存在しなければ `null`
license: (tag._misskey_license?.freeText ?? null)
});

const emoji = await this.emojisRepository.findOneBy({ host, name });
Expand All @@ -415,6 +417,8 @@ export class ApNoteService {
publicUrl: tag.icon.url,
updatedAt: new Date(),
aliases: [],
// _misskey_license が存在しなければ `null`
license: (tag._misskey_license?.freeText ?? null)
});
}));
}
Expand Down
5 changes: 5 additions & 0 deletions packages/backend/src/core/activitypub/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ export interface IApEmoji extends IObject {
type: 'Emoji';
name: string;
updated: string;
// Misskey拡張。後方互換性のためにoptional。
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Misskey拡張。後方互換性のためにoptional
// Misskey拡張。後方互換性及び他ソフトウェアとの互換性のためにoptional

// 将来の拡張性を考慮してobjectにしている
_misskey_license?: {
freeText: string | null;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
freeText: string | null;
// nullの場合、リモートサーバーにおいて明文のライセンスが設定されていないことを示す。
// 非nullの場合、リモートサーバーに置いてライセンスがその内容で明文化されていることを示す。
freeText: string | null;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あああspace

};
}

export const isEmoji = (object: IObject): object is IApEmoji =>
Expand Down
Loading