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

Add Event activity-type support #5785

Merged
merged 1 commit into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/remote/activitypub/models/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { deliverQuestionUpdate } from '../../../services/note/polls/update';
import { extractDbHost, toPuny } from '../../../misc/convert-host';
import { Notes, Emojis, Polls } from '../../../models';
import { Note } from '../../../models/entities/note';
import { IObject, INote, getApIds, getOneApId, getApId, validPost } from '../type';
import { IObject, IPost, getApIds, getOneApId, getApId, validPost } from '../type';
import { Emoji } from '../../../models/entities/emoji';
import { genId } from '../../../misc/gen-id';
import { fetchMeta } from '../../../misc/fetch-meta';
Expand Down Expand Up @@ -95,7 +95,7 @@ export async function createNote(value: string | IObject, resolver?: Resolver, s
throw new Error('invalid note');
}

const note: INote = object;
const note: IPost = object;

logger.debug(`Note fetched: ${JSON.stringify(note, null, 2)}`);

Expand Down
6 changes: 3 additions & 3 deletions src/remote/activitypub/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ export interface IOrderedCollection extends IObject {
orderedItems: ApObject;
}

export const validPost = ['Note', 'Question', 'Article', 'Audio', 'Document', 'Image', 'Page', 'Video'];
export const validPost = ['Note', 'Question', 'Article', 'Audio', 'Document', 'Image', 'Page', 'Video', 'Event'];

export interface INote extends IObject {
type: 'Note' | 'Question' | 'Article' | 'Audio' | 'Document' | 'Image' | 'Page' | 'Video';
export interface IPost extends IObject {
type: 'Note' | 'Question' | 'Article' | 'Audio' | 'Document' | 'Image' | 'Page' | 'Video' | 'Event';
_misskey_content?: string;
_misskey_quote?: string;
quoteUrl?: string;
Expand Down