Merge branch 'master' into develop

This commit is contained in:
Barış Soner Uşaklı
2025-01-28 19:59:49 -05:00
6 changed files with 19 additions and 14 deletions

View File

@@ -100,7 +100,7 @@
"nconf": "0.12.1",
"nodebb-plugin-2factor": "7.5.8",
"nodebb-plugin-composer-default": "10.2.44",
"nodebb-plugin-dbsearch": "6.2.5",
"nodebb-plugin-dbsearch": "6.2.7",
"nodebb-plugin-emoji": "6.0.2",
"nodebb-plugin-emoji-android": "4.1.1",
"nodebb-plugin-markdown": "13.1.0",
@@ -110,8 +110,8 @@
"nodebb-rewards-essentials": "1.0.0",
"nodebb-theme-harmony": "2.0.5",
"nodebb-theme-lavender": "7.1.17",
"nodebb-theme-peace": "2.2.34",
"nodebb-theme-persona": "14.0.3",
"nodebb-theme-peace": "2.2.35",
"nodebb-theme-persona": "14.0.4",
"nodebb-widget-essentials": "7.0.32",
"nodemailer": "6.10.0",
"nprogress": "0.2.0",

View File

@@ -50,7 +50,10 @@ define('forum/chats/messages', [
messages.updateRemainingLength = function (parent) {
const element = parent.find('[component="chat/input"]');
parent.find('[component="chat/message/length"]').text(element.val().length);
parent.find('[component="chat/message/remaining"]').text(config.maximumChatMessageLength - element.val().length);
const remainingLength = config.maximumChatMessageLength - element.val().length;
parent.find('[component="chat/message/remaining"]').text(remainingLength)
.toggleClass('fw-bold text-danger', remainingLength < 0)
.toggleClass('text-muted', remainingLength >= 0);
hooks.fire('action:chat.updateRemainingLength', {
parent: parent,
});

View File

@@ -327,7 +327,7 @@ define('search', [
});
});
$('.search-result-text').find('img:not(.not-responsive)').addClass('img-fluid');
$('.search-results .content').find('img:not(.not-responsive)').addClass('img-fluid');
};
return Search;

View File

@@ -109,9 +109,6 @@ chatsAPI.sortPublicRooms = async (caller, { roomIds, scores }) => {
chatsAPI.get = async (caller, { uid, roomId }) => await messaging.loadRoom(caller.uid, { uid, roomId });
chatsAPI.post = async (caller, data) => {
if (await rateLimitExceeded(caller, 'lastChatMessageTime')) {
throw new Error('[[error:too-many-messages]]');
}
if (!data || !data.roomId || !caller.uid) {
throw new Error('[[error:invalid-data]]');
}
@@ -122,7 +119,13 @@ chatsAPI.post = async (caller, data) => {
}));
await messaging.canMessageRoom(caller.uid, data.roomId);
const message = await messaging.sendMessage({
await messaging.checkContent(data.message);
if (await rateLimitExceeded(caller, 'lastChatMessageTime')) {
throw new Error('[[error:too-many-messages]]');
}
const message = await messaging.addMessage({
uid: caller.uid,
roomId: data.roomId,
content: data.message,

View File

@@ -15,12 +15,12 @@ categoriesController.get = async function (req, res) {
user.getCategoryWatchState(res.locals.uid),
categories.buildForSelect(res.locals.uid, 'find', ['descriptionParsed', 'depth', 'slug']),
]);
const pageCount = Math.max(1, Math.ceil(allCategoriesData.length / meta.config.categoriesPerPage));
const watchCategories = allCategoriesData.filter(c => c && c.cid !== -1);
const pageCount = Math.max(1, Math.ceil(watchCategories.length / meta.config.categoriesPerPage));
const page = Math.min(parseInt(req.query.page, 10) || 1, pageCount);
const start = Math.max(0, (page - 1) * meta.config.categoriesPerPage);
const stop = start + meta.config.categoriesPerPage - 1;
const categoriesData = allCategoriesData.slice(start, stop + 1);
const categoriesData = watchCategories.slice(start, stop + 1);
categoriesData.forEach((category) => {

View File

@@ -243,8 +243,7 @@ module.exports = function (Topics) {
}
async function filterTids(tids, params) {
const { filter } = params;
const { uid } = params;
const { filter, uid } = params;
if (filter === 'new') {
tids = await Topics.filterNewTids(tids, uid);