Skip to content

Commit

Permalink
fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Mar 5, 2019
1 parent 0b566af commit 83ff421
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/remote/activitypub/renderer/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default async function renderNote(note: INote, dive = true): Promise<any>
} : {};

const asPoll = note.poll ? {
type: 'Note',
type: 'Question',
[expiresAt && expiresAt < new Date() ? 'closed' : 'endTime']: expiresAt,
[multiple ? 'anyOf' : 'oneOf']: choices.map(({ text, votes }) => ({
type: 'Note',
Expand Down
11 changes: 11 additions & 0 deletions src/services/note/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import notesChart from '../../services/chart/notes';
import perUserNotesChart from '../../services/chart/per-user-notes';
import activeUsersChart from '../../services/chart/active-users';
import instanceChart from '../../services/chart/instance';
import * as deepcopy from 'deepcopy';

import { erase, concat } from '../../prelude/array';
import insertNoteUnread from './unread';
Expand Down Expand Up @@ -598,6 +599,16 @@ async function publishToFollowers(note: INote, user: IUser, noteActivity: any) {
for (const inbox of queue) {
deliver(user as any, noteActivity, inbox);
}

setTimeout(() => {
if (noteActivity.object.type === 'Question') {
const asNote = deepcopy(noteActivity);
asNote.object.type = 'Note';
for (const inbox of queue) {
deliver(user as any, asNote, inbox);
}
}
}, 3 * 1000);
}

function deliverNoteToMentionedRemoteUsers(mentionedUsers: IUser[], user: ILocalUser, noteActivity: any) {
Expand Down

0 comments on commit 83ff421

Please sign in to comment.