V10 (#2826)
* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update CHANGELOG.md * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update CHANGELOG.md * Update CHANGELOG.md * wip * Update CHANGELOG.md * wip * wip * wip * wip
This commit is contained in:
parent
0b98a2364b
commit
d0570d7fe3
126 changed files with 1812 additions and 2273 deletions
|
|
@ -12,7 +12,7 @@ import * as sharp from 'sharp';
|
|||
import DriveFile, { IMetadata, getDriveFileBucket, IDriveFile } from '../../models/drive-file';
|
||||
import DriveFolder from '../../models/drive-folder';
|
||||
import { pack } from '../../models/drive-file';
|
||||
import { publishUserStream, publishDriveStream } from '../../stream';
|
||||
import { publishMainStream, publishDriveStream } from '../../stream';
|
||||
import { isLocalUser, IUser, IRemoteUser } from '../../models/user';
|
||||
import delFile from './delete-file';
|
||||
import config from '../../config';
|
||||
|
|
@ -383,8 +383,8 @@ export default async function(
|
|||
log(`drive file has been created ${driveFile._id}`);
|
||||
|
||||
pack(driveFile).then(packedFile => {
|
||||
// Publish drive_file_created event
|
||||
publishUserStream(user._id, 'drive_file_created', packedFile);
|
||||
// Publish driveFileCreated event
|
||||
publishMainStream(user._id, 'driveFileCreated', packedFile);
|
||||
publishDriveStream(user._id, 'file_created', packedFile);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import User, { isLocalUser, isRemoteUser, pack as packUser, IUser } from '../../
|
|||
import Following from '../../models/following';
|
||||
import FollowingLog from '../../models/following-log';
|
||||
import FollowedLog from '../../models/followed-log';
|
||||
import { publishUserStream } from '../../stream';
|
||||
import { publishMainStream } from '../../stream';
|
||||
import notify from '../../notify';
|
||||
import pack from '../../remote/activitypub/renderer';
|
||||
import renderFollow from '../../remote/activitypub/renderer/follow';
|
||||
|
|
@ -61,12 +61,12 @@ export default async function(follower: IUser, followee: IUser) {
|
|||
|
||||
// Publish follow event
|
||||
if (isLocalUser(follower)) {
|
||||
packUser(followee, follower).then(packed => publishUserStream(follower._id, 'follow', packed));
|
||||
packUser(followee, follower).then(packed => publishMainStream(follower._id, 'follow', packed));
|
||||
}
|
||||
|
||||
// Publish followed event
|
||||
if (isLocalUser(followee)) {
|
||||
packUser(follower, followee).then(packed => publishUserStream(followee._id, 'followed', packed)),
|
||||
packUser(follower, followee).then(packed => publishMainStream(followee._id, 'followed', packed)),
|
||||
|
||||
// 通知を作成
|
||||
notify(followee._id, follower._id, 'follow');
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import User, { isLocalUser, isRemoteUser, pack as packUser, IUser } from '../../
|
|||
import Following from '../../models/following';
|
||||
import FollowingLog from '../../models/following-log';
|
||||
import FollowedLog from '../../models/followed-log';
|
||||
import { publishUserStream } from '../../stream';
|
||||
import { publishMainStream } from '../../stream';
|
||||
import pack from '../../remote/activitypub/renderer';
|
||||
import renderFollow from '../../remote/activitypub/renderer/follow';
|
||||
import renderUndo from '../../remote/activitypub/renderer/undo';
|
||||
|
|
@ -52,7 +52,7 @@ export default async function(follower: IUser, followee: IUser) {
|
|||
|
||||
// Publish unfollow event
|
||||
if (isLocalUser(follower)) {
|
||||
packUser(followee, follower).then(packed => publishUserStream(follower._id, 'unfollow', packed));
|
||||
packUser(followee, follower).then(packed => publishMainStream(follower._id, 'unfollow', packed));
|
||||
}
|
||||
|
||||
if (isLocalUser(follower) && isRemoteUser(followee)) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { deliver } from '../../../queue';
|
|||
import Following from '../../../models/following';
|
||||
import FollowingLog from '../../../models/following-log';
|
||||
import FollowedLog from '../../../models/followed-log';
|
||||
import { publishUserStream } from '../../../stream';
|
||||
import { publishMainStream } from '../../../stream';
|
||||
|
||||
export default async function(followee: IUser, follower: IUser) {
|
||||
const following = await Following.insert({
|
||||
|
|
@ -74,7 +74,7 @@ export default async function(followee: IUser, follower: IUser) {
|
|||
|
||||
packUser(followee, followee, {
|
||||
detail: true
|
||||
}).then(packed => publishUserStream(followee._id, 'meUpdated', packed));
|
||||
}).then(packed => publishMainStream(followee._id, 'meUpdated', packed));
|
||||
|
||||
packUser(followee, follower).then(packed => publishUserStream(follower._id, 'follow', packed));
|
||||
packUser(followee, follower).then(packed => publishMainStream(follower._id, 'follow', packed));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import pack from '../../../remote/activitypub/renderer';
|
|||
import renderFollow from '../../../remote/activitypub/renderer/follow';
|
||||
import renderUndo from '../../../remote/activitypub/renderer/undo';
|
||||
import { deliver } from '../../../queue';
|
||||
import { publishUserStream } from '../../../stream';
|
||||
import { publishMainStream } from '../../../stream';
|
||||
|
||||
export default async function(followee: IUser, follower: IUser) {
|
||||
if (isRemoteUser(followee)) {
|
||||
|
|
@ -34,5 +34,5 @@ export default async function(followee: IUser, follower: IUser) {
|
|||
|
||||
packUser(followee, followee, {
|
||||
detail: true
|
||||
}).then(packed => publishUserStream(followee._id, 'meUpdated', packed));
|
||||
}).then(packed => publishMainStream(followee._id, 'meUpdated', packed));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import User, { isLocalUser, isRemoteUser, pack as packUser, IUser } from '../../../models/user';
|
||||
import { publishUserStream } from '../../../stream';
|
||||
import { publishMainStream } from '../../../stream';
|
||||
import notify from '../../../notify';
|
||||
import pack from '../../../remote/activitypub/renderer';
|
||||
import renderFollow from '../../../remote/activitypub/renderer/follow';
|
||||
|
|
@ -33,11 +33,11 @@ export default async function(follower: IUser, followee: IUser) {
|
|||
|
||||
// Publish receiveRequest event
|
||||
if (isLocalUser(followee)) {
|
||||
packUser(follower, followee).then(packed => publishUserStream(followee._id, 'receiveFollowRequest', packed));
|
||||
packUser(follower, followee).then(packed => publishMainStream(followee._id, 'receiveFollowRequest', packed));
|
||||
|
||||
packUser(followee, followee, {
|
||||
detail: true
|
||||
}).then(packed => publishUserStream(followee._id, 'meUpdated', packed));
|
||||
}).then(packed => publishMainStream(followee._id, 'meUpdated', packed));
|
||||
|
||||
// 通知を作成
|
||||
notify(followee._id, follower._id, 'receiveFollowRequest');
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import pack from '../../../remote/activitypub/renderer';
|
|||
import renderFollow from '../../../remote/activitypub/renderer/follow';
|
||||
import renderReject from '../../../remote/activitypub/renderer/reject';
|
||||
import { deliver } from '../../../queue';
|
||||
import { publishUserStream } from '../../../stream';
|
||||
import { publishMainStream } from '../../../stream';
|
||||
|
||||
export default async function(followee: IUser, follower: IUser) {
|
||||
if (isRemoteUser(follower)) {
|
||||
|
|
@ -23,5 +23,5 @@ export default async function(followee: IUser, follower: IUser) {
|
|||
}
|
||||
});
|
||||
|
||||
packUser(followee, follower).then(packed => publishUserStream(follower._id, 'unfollow', packed));
|
||||
packUser(followee, follower).then(packed => publishMainStream(follower._id, 'unfollow', packed));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import es from '../../db/elasticsearch';
|
||||
import Note, { pack, INote } from '../../models/note';
|
||||
import User, { isLocalUser, IUser, isRemoteUser, IRemoteUser, ILocalUser } from '../../models/user';
|
||||
import { publishUserStream, publishLocalTimelineStream, publishHybridTimelineStream, publishGlobalTimelineStream, publishUserListStream, publishHashtagStream } from '../../stream';
|
||||
import { publishMainStream, publishHomeTimelineStream, publishLocalTimelineStream, publishHybridTimelineStream, publishGlobalTimelineStream, publishUserListStream, publishHashtagStream } from '../../stream';
|
||||
import Following from '../../models/following';
|
||||
import { deliver } from '../../queue';
|
||||
import renderNote from '../../remote/activitypub/renderer/note';
|
||||
|
|
@ -234,7 +234,7 @@ export default async (user: IUser, data: Option, silent = false) => new Promise<
|
|||
// 通知
|
||||
if (isLocalUser(data.reply._user)) {
|
||||
nm.push(data.reply.userId, 'reply');
|
||||
publishUserStream(data.reply.userId, 'reply', noteObj);
|
||||
publishMainStream(data.reply.userId, 'reply', noteObj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -257,7 +257,7 @@ export default async (user: IUser, data: Option, silent = false) => new Promise<
|
|||
|
||||
// Publish event
|
||||
if (!user._id.equals(data.renote.userId) && isLocalUser(data.renote._user)) {
|
||||
publishUserStream(data.renote.userId, 'renote', noteObj);
|
||||
publishMainStream(data.renote.userId, 'renote', noteObj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -306,11 +306,11 @@ async function publish(user: IUser, note: INote, noteObj: any, reply: INote, ren
|
|||
detail: true
|
||||
});
|
||||
// Publish event to myself's stream
|
||||
publishUserStream(note.userId, 'note', detailPackedNote);
|
||||
publishHomeTimelineStream(note.userId, detailPackedNote);
|
||||
publishHybridTimelineStream(note.userId, detailPackedNote);
|
||||
} else {
|
||||
// Publish event to myself's stream
|
||||
publishUserStream(note.userId, 'note', noteObj);
|
||||
publishHomeTimelineStream(note.userId, noteObj);
|
||||
|
||||
// Publish note to local and hybrid timeline stream
|
||||
if (note.visibility != 'home') {
|
||||
|
|
@ -495,7 +495,7 @@ async function publishToFollowers(note: INote, user: IUser, noteActivity: any) {
|
|||
}
|
||||
|
||||
// Publish event to followers stream
|
||||
publishUserStream(following.followerId, 'note', detailPackedNote);
|
||||
publishHomeTimelineStream(following.followerId, detailPackedNote);
|
||||
|
||||
if (isRemoteUser(user) || note.visibility != 'public') {
|
||||
publishHybridTimelineStream(following.followerId, detailPackedNote);
|
||||
|
|
@ -526,7 +526,7 @@ function createMentionedEvents(mentionedUsers: IUser[], note: INote, nm: Notific
|
|||
detail: true
|
||||
});
|
||||
|
||||
publishUserStream(u._id, 'mention', detailPackedNote);
|
||||
publishMainStream(u._id, 'mention', detailPackedNote);
|
||||
|
||||
// Create notification
|
||||
nm.push(u._id, 'mention');
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ export default async function(user: IUser, note: INote) {
|
|||
}
|
||||
});
|
||||
|
||||
publishNoteStream(note._id, 'deleted');
|
||||
publishNoteStream(note._id, 'deleted', {});
|
||||
|
||||
//#region ローカルの投稿なら削除アクティビティを配送
|
||||
if (isLocalUser(user)) {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@ export default async (user: IUser, note: INote, reaction: string) => new Promise
|
|||
$inc: inc
|
||||
});
|
||||
|
||||
publishNoteStream(note._id, 'reacted');
|
||||
publishNoteStream(note._id, 'reacted', {
|
||||
reaction: reaction
|
||||
});
|
||||
|
||||
// リアクションされたユーザーがローカルユーザーなら通知を作成
|
||||
if (isLocalUser(note._user)) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import * as mongo from 'mongodb';
|
||||
import { publishUserStream } from '../../stream';
|
||||
import { publishMainStream } from '../../stream';
|
||||
import User from '../../models/user';
|
||||
import NoteUnread from '../../models/note-unread';
|
||||
|
||||
|
|
@ -56,11 +56,11 @@ export default (
|
|||
|
||||
if (count1 == 0) {
|
||||
// 全て既読になったイベントを発行
|
||||
publishUserStream(userId, 'readAllUnreadMentions');
|
||||
publishMainStream(userId, 'readAllUnreadMentions');
|
||||
}
|
||||
|
||||
if (count2 == 0) {
|
||||
// 全て既読になったイベントを発行
|
||||
publishUserStream(userId, 'readAllUnreadSpecifiedNotes');
|
||||
publishMainStream(userId, 'readAllUnreadSpecifiedNotes');
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import NoteUnread from '../../models/note-unread';
|
|||
import User, { IUser } from '../../models/user';
|
||||
import { INote } from '../../models/note';
|
||||
import Mute from '../../models/mute';
|
||||
import { publishUserStream } from '../../stream';
|
||||
import { publishMainStream } from '../../stream';
|
||||
|
||||
export default async function(user: IUser, note: INote, isSpecified = false) {
|
||||
//#region ミュートしているなら無視
|
||||
|
|
@ -38,10 +38,10 @@ export default async function(user: IUser, note: INote, isSpecified = false) {
|
|||
}
|
||||
});
|
||||
|
||||
publishUserStream(user._id, 'unreadMention', note._id);
|
||||
publishMainStream(user._id, 'unreadMention', note._id);
|
||||
|
||||
if (isSpecified) {
|
||||
publishUserStream(user._id, 'unreadSpecifiedNote', note._id);
|
||||
publishMainStream(user._id, 'unreadSpecifiedNote', note._id);
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue