diff --git a/package-lock.json b/package-lock.json
index ba585fb6..f17afe1c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -4614,7 +4614,7 @@
},
"node_modules/fosscord-server-util": {
"version": "1.0.0",
- "resolved": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#770b07400e282c5e06fe0638d791139e3984f50f",
+ "resolved": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#3205dc6f6080422b8d2f727fe9e4573b493ffbb1",
"license": "ISC",
"dependencies": {
"jsonwebtoken": "^8.5.1",
@@ -16151,7 +16151,7 @@
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
},
"fosscord-server-util": {
- "version": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#770b07400e282c5e06fe0638d791139e3984f50f",
+ "version": "git+ssh://git@github.com/fosscord/fosscord-server-util.git#3205dc6f6080422b8d2f727fe9e4573b493ffbb1",
"from": "fosscord-server-util@github:fosscord/fosscord-server-util",
"requires": {
"jsonwebtoken": "^8.5.1",
diff --git a/src/routes/channels/#channel_id/messages/index.ts b/src/routes/channels/#channel_id/messages/index.ts
index 0b91a977..4b9d96a1 100644
--- a/src/routes/channels/#channel_id/messages/index.ts
+++ b/src/routes/channels/#channel_id/messages/index.ts
@@ -60,7 +60,11 @@ router.get("/", async (req, res) => {
var query: any;
if (after) query = MessageModel.find({ channel_id, id: { $gt: after } });
else if (before) query = MessageModel.find({ channel_id, id: { $lt: before } });
- else if (around) query = MessageModel.find({ channel_id, id: { $gt: around - halfLimit, $lt: around + halfLimit } });
+ else if (around)
+ query = MessageModel.find({
+ channel_id,
+ id: { $gt: (BigInt(around) - BigInt(halfLimit)).toString(), $lt: (BigInt(around) + BigInt(halfLimit)).toString() },
+ });
else {
query = MessageModel.find({ channel_id }).sort({ id: -1 });
}
|