* 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:
syuilo
2018-10-07 11:06:17 +09:00
committed by GitHub
parent 0b98a2364b
commit d0570d7fe3
126 changed files with 1812 additions and 2273 deletions

View File

@ -2,7 +2,7 @@ import $ from 'cafy'; import ID from '../../../../../misc/cafy-id';
import Matching, { pack as packMatching } from '../../../../../models/games/reversi/matching';
import ReversiGame, { pack as packGame } from '../../../../../models/games/reversi/game';
import User, { ILocalUser } from '../../../../../models/user';
import { publishUserStream, publishReversiStream } from '../../../../../stream';
import { publishMainStream, publishReversiStream } from '../../../../../stream';
import { eighteight } from '../../../../../games/reversi/maps';
export const meta = {
@ -58,7 +58,7 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
});
if (other == 0) {
publishUserStream(user._id, 'reversi_no_invites');
publishMainStream(user._id, 'reversi_no_invites');
}
} else {
// Fetch child
@ -94,6 +94,6 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
// 招待
publishReversiStream(child._id, 'invited', packed);
publishUserStream(child._id, 'reversi_invited', packed);
publishMainStream(child._id, 'reversiInvited', packed);
}
});

View File

@ -1,7 +1,7 @@
import $ from 'cafy';
import * as bcrypt from 'bcryptjs';
import User, { ILocalUser } from '../../../../models/user';
import { publishUserStream } from '../../../../stream';
import { publishMainStream } from '../../../../stream';
import generateUserToken from '../../common/generate-native-user-token';
export const meta = {
@ -33,5 +33,5 @@ export default async (params: any, user: ILocalUser) => new Promise(async (res,
res();
// Publish event
publishUserStream(user._id, 'my_token_regenerated');
publishMainStream(user._id, 'myTokenRegenerated');
});

View File

@ -1,6 +1,6 @@
import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
import User, { isValidName, isValidDescription, isValidLocation, isValidBirthday, pack, ILocalUser } from '../../../../models/user';
import { publishUserStream } from '../../../../stream';
import { publishMainStream } from '../../../../stream';
import DriveFile from '../../../../models/drive-file';
import acceptAllFollowRequests from '../../../../services/following/requests/accept-all';
import { IApp } from '../../../../models/app';
@ -177,7 +177,7 @@ export default async (params: any, user: ILocalUser, app: IApp) => new Promise(a
res(iObj);
// Publish meUpdated event
publishUserStream(user._id, 'meUpdated', iObj);
publishMainStream(user._id, 'meUpdated', iObj);
// 鍵垢を解除したとき、溜まっていたフォローリクエストがあるならすべて承認
if (user.isLocked && ps.isLocked === false) {

View File

@ -1,6 +1,6 @@
import $ from 'cafy';
import User, { ILocalUser } from '../../../../models/user';
import { publishUserStream } from '../../../../stream';
import { publishMainStream } from '../../../../stream';
export const meta = {
requireCredential: true,
@ -26,7 +26,7 @@ export default async (params: any, user: ILocalUser) => new Promise(async (res,
res();
// Publish event
publishUserStream(user._id, 'clientSettingUpdated', {
publishMainStream(user._id, 'clientSettingUpdated', {
key: name,
value
});

View File

@ -1,6 +1,6 @@
import $ from 'cafy';
import User, { ILocalUser } from '../../../../models/user';
import { publishUserStream } from '../../../../stream';
import { publishMainStream } from '../../../../stream';
export const meta = {
requireCredential: true,
@ -25,5 +25,5 @@ export default async (params: any, user: ILocalUser) => new Promise(async (res,
res();
publishUserStream(user._id, 'home_updated', home);
publishMainStream(user._id, 'homeUpdated', home);
});

View File

@ -1,6 +1,6 @@
import $ from 'cafy';
import User, { ILocalUser } from '../../../../models/user';
import { publishUserStream } from '../../../../stream';
import { publishMainStream } from '../../../../stream';
export const meta = {
requireCredential: true,
@ -24,5 +24,5 @@ export default async (params: any, user: ILocalUser) => new Promise(async (res,
res();
publishUserStream(user._id, 'mobile_home_updated', home);
publishMainStream(user._id, 'mobileHomeUpdated', home);
});

View File

@ -1,6 +1,6 @@
import $ from 'cafy';
import User, { ILocalUser } from '../../../../models/user';
import { publishUserStream } from '../../../../stream';
import { publishMainStream } from '../../../../stream';
export const meta = {
requireCredential: true,
@ -73,7 +73,7 @@ export default async (params: any, user: ILocalUser) => new Promise(async (res,
//#endregion
if (widget) {
publishUserStream(user._id, 'widgetUpdated', {
publishMainStream(user._id, 'widgetUpdated', {
id, data
});

View File

@ -6,7 +6,7 @@ import User, { ILocalUser } from '../../../../../models/user';
import Mute from '../../../../../models/mute';
import DriveFile from '../../../../../models/drive-file';
import { pack } from '../../../../../models/messaging-message';
import { publishUserStream } from '../../../../../stream';
import { publishMainStream } from '../../../../../stream';
import { publishMessagingStream, publishMessagingIndexStream } from '../../../../../stream';
import pushSw from '../../../../../push-sw';
@ -88,12 +88,12 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
// 自分のストリーム
publishMessagingStream(message.userId, message.recipientId, 'message', messageObj);
publishMessagingIndexStream(message.userId, 'message', messageObj);
publishUserStream(message.userId, 'messaging_message', messageObj);
publishMainStream(message.userId, 'messagingMessage', messageObj);
// 相手のストリーム
publishMessagingStream(message.recipientId, message.userId, 'message', messageObj);
publishMessagingIndexStream(message.recipientId, 'message', messageObj);
publishUserStream(message.recipientId, 'messaging_message', messageObj);
publishMainStream(message.recipientId, 'messagingMessage', messageObj);
// Update flag
User.update({ _id: recipient._id }, {
@ -117,8 +117,8 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
}
//#endregion
publishUserStream(message.recipientId, 'unread_messaging_message', messageObj);
pushSw(message.recipientId, 'unread_messaging_message', messageObj);
publishMainStream(message.recipientId, 'unreadMessagingMessage', messageObj);
pushSw(message.recipientId, 'unreadMessagingMessage', messageObj);
}
}, 3000);

View File

@ -72,7 +72,10 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
$inc: inc
});
publishNoteStream(note._id, 'poll_voted');
publishNoteStream(note._id, 'pollVoted', {
choice: choice,
userId: user._id.toHexString()
});
// Notify
notify(note.userId, user._id, 'poll_vote', {

View File

@ -1,5 +1,5 @@
import Notification from '../../../../models/notification';
import { publishUserStream } from '../../../../stream';
import { publishMainStream } from '../../../../stream';
import User, { ILocalUser } from '../../../../models/user';
export const meta = {
@ -40,5 +40,5 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
});
// 全ての通知を読みましたよというイベントを発行
publishUserStream(user._id, 'read_all_notifications');
publishMainStream(user._id, 'readAllNotifications');
});