mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: error on replying to remote mids #12834
This commit is contained in:
@@ -43,7 +43,7 @@ module.exports = function (Messaging) {
|
||||
throw new Error('[[error:no-room]]');
|
||||
}
|
||||
if (data.toMid) {
|
||||
if (!utils.isNumber(data.toMid)) {
|
||||
if (!await Messaging.messageExists(data.toMid)) {
|
||||
throw new Error('[[error:invalid-mid]]');
|
||||
}
|
||||
if (!await Messaging.canViewMessage(data.toMid, roomId, uid)) {
|
||||
|
||||
@@ -453,7 +453,7 @@ Messaging.hasPrivateChat = async (uid, withUid) => {
|
||||
|
||||
Messaging.canViewMessage = async (mids, roomId, uid) => {
|
||||
let single = false;
|
||||
if (!Array.isArray(mids) && isFinite(mids)) {
|
||||
if (!Array.isArray(mids) && (utils.isNumber(mids) || activitypub.helpers.isUri(mids))) {
|
||||
mids = [mids];
|
||||
single = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user