This commit is contained in:
syuilo
2021-12-09 23:58:30 +09:00
parent 0abe2dfee0
commit c69b72e199
573 changed files with 3318 additions and 3318 deletions

View File

@ -25,12 +25,12 @@ export const meta = {
},
text: {
validator: $.optional.str.pipe(MessagingMessages.validateText)
validator: $.optional.str.pipe(MessagingMessages.validateText),
},
fileId: {
validator: $.optional.type(ID),
}
},
},
res: {
@ -43,45 +43,45 @@ export const meta = {
recipientIsYourself: {
message: 'You can not send a message to yourself.',
code: 'RECIPIENT_IS_YOURSELF',
id: '17e2ba79-e22a-4cbc-bf91-d327643f4a7e'
id: '17e2ba79-e22a-4cbc-bf91-d327643f4a7e',
},
noSuchUser: {
message: 'No such user.',
code: 'NO_SUCH_USER',
id: '11795c64-40ea-4198-b06e-3c873ed9039d'
id: '11795c64-40ea-4198-b06e-3c873ed9039d',
},
noSuchGroup: {
message: 'No such group.',
code: 'NO_SUCH_GROUP',
id: 'c94e2a5d-06aa-4914-8fa6-6a42e73d6537'
id: 'c94e2a5d-06aa-4914-8fa6-6a42e73d6537',
},
groupAccessDenied: {
message: 'You can not send messages to groups that you have not joined.',
code: 'GROUP_ACCESS_DENIED',
id: 'd96b3cca-5ad1-438b-ad8b-02f931308fbd'
id: 'd96b3cca-5ad1-438b-ad8b-02f931308fbd',
},
noSuchFile: {
message: 'No such file.',
code: 'NO_SUCH_FILE',
id: '4372b8e2-185d-4146-8749-2f68864a3e5f'
id: '4372b8e2-185d-4146-8749-2f68864a3e5f',
},
contentRequired: {
message: 'Content required. You need to set text or fileId.',
code: 'CONTENT_REQUIRED',
id: '25587321-b0e6-449c-9239-f8925092942c'
id: '25587321-b0e6-449c-9239-f8925092942c',
},
youHaveBeenBlocked: {
message: 'You cannot send a message because you have been blocked by this user.',
code: 'YOU_HAVE_BEEN_BLOCKED',
id: 'c15a5199-7422-4968-941a-2a462c478f7d'
id: 'c15a5199-7422-4968-941a-2a462c478f7d',
},
}
},
};
export default define(meta, async (ps, user) => {
@ -119,7 +119,7 @@ export default define(meta, async (ps, user) => {
// check joined
const joining = await UserGroupJoinings.findOne({
userId: user.id,
userGroupId: recipientGroup.id
userGroupId: recipientGroup.id,
});
if (joining == null) {
@ -131,7 +131,7 @@ export default define(meta, async (ps, user) => {
if (ps.fileId != null) {
file = await DriveFiles.findOne({
id: ps.fileId,
userId: user.id
userId: user.id,
});
if (file == null) {