refactor: 🔥 remove _misskey_reaction and _misskey_votes

BREAKING: breaks poll federation with very old Misskey versions
This commit is contained in:
ThatOneCalculator 2023-09-20 21:16:03 -07:00
parent 9a6818701f
commit b0be07fb0a
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
4 changed files with 2 additions and 5 deletions

View File

@ -15,7 +15,7 @@ export default async (actor: CacheableRemoteUser, activity: ILike) => {
return await create( return await create(
actor, actor,
note, note,
activity._misskey_reaction || activity.content || activity.name, activity.content || activity.name,
) )
.catch((e) => { .catch((e) => {
if (e.id === "51c42bb4-931a-456b-bff7-e5a8a70dd298") { if (e.id === "51c42bb4-931a-456b-bff7-e5a8a70dd298") {

View File

@ -34,7 +34,7 @@ export async function extractPollFromQuestion(
); );
const votes = question[multiple ? "anyOf" : "oneOf"]!.map( const votes = question[multiple ? "anyOf" : "oneOf"]!.map(
(x, i) => x.replies?.totalItems || x._misskey_votes || 0, (x, i) => x.replies?.totalItems || 0,
); );
return { return {

View File

@ -18,7 +18,6 @@ export const renderLike = async (noteReaction: NoteReaction, note: Note) => {
...(!meta.defaultReaction.includes(reaction) ...(!meta.defaultReaction.includes(reaction)
? { ? {
content: reaction, content: reaction,
_misskey_reaction: reaction,
} }
: {}), : {}),
} as any; } as any;

View File

@ -158,7 +158,6 @@ export const isQuestion = (object: IObject): object is IQuestion =>
interface IQuestionChoice { interface IQuestionChoice {
name?: string; name?: string;
replies?: ICollection; replies?: ICollection;
_misskey_votes?: number;
} }
export interface ITombstone extends IObject { export interface ITombstone extends IObject {
type: "Tombstone"; type: "Tombstone";
@ -299,7 +298,6 @@ export interface IRemove extends IActivity {
export interface ILike extends IActivity { export interface ILike extends IActivity {
type: "Like" | "EmojiReaction" | "EmojiReact"; type: "Like" | "EmojiReaction" | "EmojiReact";
_misskey_reaction?: string;
} }
export interface IAnnounce extends IActivity { export interface IAnnounce extends IActivity {