-
Notifications
You must be signed in to change notification settings - Fork 0
/
handler.js
33 lines (29 loc) · 993 Bytes
/
handler.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use strict';
exports = module.exports = {};
let mongo = require('./mongo');
let config = require('./config');
exports.acceptGroupInvite = async function (req, res) {
// let groupList = await mongo.WhiteList.find({ type: 'group', id: req.body.group_id }).toArray();
// if (groupList.length) {
res.send({ approve: true });
console.log(`加入群 ${req.body.group_id}.`)
await mongo.Group.insertOne({
group_id: req.body.group_id,
needNotification: false,
});
// } else {
// res.send({
// approve: false,
// reason: `如需添加我请先和 ${config.adminIdList.join(' 或者 ')} 联系。`
// });
// }
}
exports.acceptFriendInvite = async function (req, res) {
// let friendList = await mongo.WhiteList.find({ type: 'friend', id: req.body.user_id }).toArray();
// if (friendList.length) {
res.send({ approve: true });
console.log(`接受了 ${req.body.user_id} 的好友请求.`)
// } else {
// res.send({ approve: false });
// }
}