summaryrefslogtreecommitdiff
path: root/src/api/endpoints/messaging
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-01-17 11:11:22 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-01-17 11:11:22 +0900
commit9f81288fccdbaf9184d49e61680747945b34f23d (patch)
treedce25db34136ffd9c05852ed4c2c493c23c96c07 /src/api/endpoints/messaging
parentFix bug (diff)
downloadmisskey-9f81288fccdbaf9184d49e61680747945b34f23d.tar.gz
misskey-9f81288fccdbaf9184d49e61680747945b34f23d.tar.bz2
misskey-9f81288fccdbaf9184d49e61680747945b34f23d.zip
Fix bug
Diffstat (limited to 'src/api/endpoints/messaging')
-rw-r--r--src/api/endpoints/messaging/history.js5
-rw-r--r--src/api/endpoints/messaging/messages.js5
-rw-r--r--src/api/endpoints/messaging/messages/create.js4
3 files changed, 6 insertions, 8 deletions
diff --git a/src/api/endpoints/messaging/history.js b/src/api/endpoints/messaging/history.js
index dafb38fd1a..e6e6ac87b1 100644
--- a/src/api/endpoints/messaging/history.js
+++ b/src/api/endpoints/messaging/history.js
@@ -34,13 +34,12 @@ module.exports = (params, user) =>
const history = await History
.find({
user_id: user._id
- }, {}, {
+ }, {
limit: limit,
sort: {
updated_at: -1
}
- })
- .toArray();
+ });
// Serialize
res(await Promise.all(history.map(async h =>
diff --git a/src/api/endpoints/messaging/messages.js b/src/api/endpoints/messaging/messages.js
index 12bd13597a..9440e2b3aa 100644
--- a/src/api/endpoints/messaging/messages.js
+++ b/src/api/endpoints/messaging/messages.js
@@ -90,11 +90,10 @@ module.exports = (params, user) =>
// Issue query
const messages = await Message
- .find(query, {}, {
+ .find(query, {
limit: limit,
sort: sort
- })
- .toArray();
+ });
// Serialize
res(await Promise.all(messages.map(async message =>
diff --git a/src/api/endpoints/messaging/messages/create.js b/src/api/endpoints/messaging/messages/create.js
index 33634a6140..1cd02cfc58 100644
--- a/src/api/endpoints/messaging/messages/create.js
+++ b/src/api/endpoints/messaging/messages/create.js
@@ -125,7 +125,7 @@ module.exports = (params, user) =>
}
// 履歴作成(自分)
- History.updateOne({
+ History.update({
user_id: user._id,
partner: recipient._id
}, {
@@ -138,7 +138,7 @@ module.exports = (params, user) =>
});
// 履歴作成(相手)
- History.updateOne({
+ History.update({
user_id: recipient._id,
partner: user._id
}, {