From 877820779c38083988aa94cffad7c9bf77a60291 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 19 Sep 2016 23:24:07 +0300 Subject: [PATCH 01/37] optimize notifications.getMultiple --- src/notifications.js | 63 +++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 36 deletions(-) diff --git a/src/notifications.js b/src/notifications.js index 86a13e3224..4b3111fdad 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -37,50 +37,41 @@ var utils = require('../public/src/utils'); return callback(err); } - if (!Array.isArray(notifications) || !notifications.length) { + notifications = notifications.filter(Boolean); + if (!notifications.length) { return callback(null, []); } - async.map(notifications, function(notification, next) { - if (!notification) { - return next(null, null); + var userKeys = notifications.map(function(notification) { + return notification.from; + }); + + User.getUsersFields(userKeys, ['username', 'userslug', 'picture'], function(err, usersData) { + if (err) { + return callback(err); } + notifications.forEach(function(notification, index) { + notification.datetimeISO = utils.toISOString(notification.datetime); - notification.datetimeISO = utils.toISOString(notification.datetime); - - if (notification.bodyLong) { - notification.bodyLong = S(notification.bodyLong).escapeHTML().s; - } - - if (notification.from && !notification.image) { - User.getUserFields(notification.from, ['username', 'userslug', 'picture'], function(err, userData) { - if (err) { - return next(err); - } - notification.image = userData.picture || null; - notification.user = userData; - - if (userData.username === '[[global:guest]]') { - notification.bodyShort = notification.bodyShort.replace(/([\s\S]*?),[\s\S]*?,([\s\S]*?)/, '$1, [[global:guest]], $2'); - } - - next(null, notification); - }); - return; - } else if (notification.image) { - switch(notification.image) { - case 'brand:logo': - notification.image = meta.config['brand:logo'] || nconf.get('relative_path') + '/logo.png'; - break; + if (notification.bodyLong) { + notification.bodyLong = S(notification.bodyLong).escapeHTML().s; } - return next(null, notification); - } else { - notification.image = meta.config['brand:logo'] || nconf.get('relative_path') + '/logo.png'; - return next(null, notification); - } + notification.user = usersData[index]; + if (notification.user) { + notification.image = notification.user.picture || null; + if (notification.user.username === '[[global:guest]]') { + notification.bodyShort = notification.bodyShort.replace(/([\s\S]*?),[\s\S]*?,([\s\S]*?)/, '$1, [[global:guest]], $2'); + } + } - }, callback); + if (notification.image === 'brand:logo' || !notification.image) { + notification.image = meta.config['brand:logo'] || nconf.get('relative_path') + '/logo.png'; + } + }); + + callback(null, notifications); + }); }); }; From 4ce8e2224a7255052be1b55897aa8bf12c3080e0 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 19 Sep 2016 23:43:50 +0300 Subject: [PATCH 02/37] optimize topics.markTopicNotificationsRead let's not call it once for each tid --- public/src/client/topic/events.js | 2 +- src/controllers/topics.js | 2 +- src/socket.io/topics/unread.js | 11 +++++------ src/topics/unread.js | 26 +++++++++++++++----------- src/user/notifications.js | 6 +++--- 5 files changed, 25 insertions(+), 22 deletions(-) diff --git a/public/src/client/topic/events.js b/public/src/client/topic/events.js index 68a864198e..4d8434adb8 100644 --- a/public/src/client/topic/events.js +++ b/public/src/client/topic/events.js @@ -220,7 +220,7 @@ define('forum/topic/events', [ function onNewNotification(data) { var tid = ajaxify.data.tid; if (data && data.tid && parseInt(data.tid, 10) === parseInt(tid, 10)) { - socket.emit('topics.markTopicNotificationsRead', tid); + socket.emit('topics.markTopicNotificationsRead', [tid]); } } diff --git a/src/controllers/topics.js b/src/controllers/topics.js index 9d106a85f2..d017f1d5c8 100644 --- a/src/controllers/topics.js +++ b/src/controllers/topics.js @@ -283,7 +283,7 @@ topicsController.get = function(req, res, callback) { } if (markedRead) { topics.pushUnreadCount(req.uid); - topics.markTopicNotificationsRead(tid, req.uid); + topics.markTopicNotificationsRead([tid], req.uid); } }); } diff --git a/src/socket.io/topics/unread.js b/src/socket.io/topics/unread.js index a5582d6892..e9279d3f4a 100644 --- a/src/socket.io/topics/unread.js +++ b/src/socket.io/topics/unread.js @@ -19,18 +19,17 @@ module.exports = function(SocketTopics) { topics.pushUnreadCount(socket.uid); - for (var i=0; i Date: Tue, 20 Sep 2016 00:04:05 +0300 Subject: [PATCH 03/37] fix user icon in notifications --- src/notifications.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/notifications.js b/src/notifications.js index 4b3111fdad..e4df61f260 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -63,9 +63,7 @@ var utils = require('../public/src/utils'); if (notification.user.username === '[[global:guest]]') { notification.bodyShort = notification.bodyShort.replace(/([\s\S]*?),[\s\S]*?,([\s\S]*?)/, '$1, [[global:guest]], $2'); } - } - - if (notification.image === 'brand:logo' || !notification.image) { + } else if (notification.image === 'brand:logo' || !notification.image) { notification.image = meta.config['brand:logo'] || nconf.get('relative_path') + '/logo.png'; } }); From 202edfa47ecbe16b8ffe3f5f7b891bae6d1fc765 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 20 Sep 2016 14:26:26 +0300 Subject: [PATCH 04/37] chat history access --- public/src/client/chats.js | 2 +- public/src/modules/chat.js | 4 +- src/controllers/accounts/chats.js | 115 ++++++++++++++++-------------- src/routes/accounts.js | 2 +- 4 files changed, 66 insertions(+), 57 deletions(-) diff --git a/public/src/client/chats.js b/public/src/client/chats.js index 619dbc9ec0..e2019c6c5a 100644 --- a/public/src/client/chats.js +++ b/public/src/client/chats.js @@ -265,7 +265,7 @@ define('forum/chats', [ }; Chats.switchChat = function(roomid) { - ajaxify.go('chats/' + roomid); + ajaxify.go('user/' + ajaxify.data.userslug + '/chats/' + roomid); }; Chats.loadChatSince = function(roomId, chatContentEl, since) { diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js index 8e0b435434..5178d2d03c 100644 --- a/public/src/modules/chat.js +++ b/public/src/modules/chat.js @@ -31,7 +31,7 @@ define('chat', [ if (!ajaxify.currentPage.match(/^chats\//)) { app.openChat(roomId); } else { - ajaxify.go('chats/' + roomId); + ajaxify.go('user/' + app.user.userslug + '/chats/' + roomId); } }); @@ -214,7 +214,7 @@ define('chat', [ components.get('chat/input').val(text); }); - ajaxify.go('chats/' + chatModal.attr('roomId')); + ajaxify.go('user/' + app.user.userslug + '/chats/' + chatModal.attr('roomId')); module.close(chatModal); } diff --git a/src/controllers/accounts/chats.js b/src/controllers/accounts/chats.js index 4af94c5521..b638cb0006 100644 --- a/src/controllers/accounts/chats.js +++ b/src/controllers/accounts/chats.js @@ -4,6 +4,7 @@ var async = require('async'); var messaging = require('../../messaging'); var meta = require('../../meta'); +var user = require('../../user'); var helpers = require('../helpers'); @@ -13,65 +14,73 @@ chatsController.get = function(req, res, callback) { if (parseInt(meta.config.disableChat, 10) === 1) { return callback(); } - - messaging.getRecentChats(req.uid, 0, 19, function(err, recentChats) { + var uid; + var recentChats; + async.waterfall([ + function(next) { + user.getUidByUserslug(req.params.userslug, next); + }, + function(_uid, next) { + uid = _uid; + if (!uid) { + return callback(); + } + messaging.getRecentChats(uid, 0, 19, next); + }, + function(_recentChats, next) { + recentChats = _recentChats; + if (!req.params.roomid) { + return res.render('chats', { + rooms: recentChats.rooms, + userslug: req.params.userslug, + nextStart: recentChats.nextStart, + allowed: true, + title: '[[pages:chats]]', + breadcrumbs: helpers.buildBreadcrumbs([{text: '[[pages:chats]]'}]) + }); + } + messaging.isUserInRoom(req.uid, req.params.roomid, next); + }, + function(inRoom, next) { + if (!inRoom && parseInt(req.uid, 10) === parseInt(uid, 10)) { + return callback(); + } + async.parallel({ + users: async.apply(messaging.getUsersInRoom, req.params.roomid, 0, -1), + messages: async.apply(messaging.getMessages, { + uid: uid, + roomId: req.params.roomid, + since: 'recent', + isNew: false + }), + room: async.apply(messaging.getRoomData, req.params.roomid) + }, next); + } + ], function(err, data) { if (err) { return callback(err); } + var room = data.room; + room.messages = data.messages; - if (!req.params.roomid) { - return res.render('chats', { - rooms: recentChats.rooms, - nextStart: recentChats.nextStart, - allowed: true, - title: '[[pages:chats]]', - breadcrumbs: helpers.buildBreadcrumbs([{text: '[[pages:chats]]'}]) - }); - } - - async.waterfall([ - function (next) { - messaging.isUserInRoom(req.uid, req.params.roomid, next); - }, - function (inRoom, next) { - if (!inRoom) { - return callback(); - } - - async.parallel({ - users: async.apply(messaging.getUsersInRoom, req.params.roomid, 0, -1), - messages: async.apply(messaging.getMessages, { - uid: req.uid, - roomId: req.params.roomid, - since: 'recent', - isNew: false - }), - room: async.apply(messaging.getRoomData, req.params.roomid) - }, next); - } - ], function(err, data) { - if (err) { - return callback(err); - } - var room = data.room; - room.messages = data.messages; - - room.isOwner = parseInt(room.owner, 10) === parseInt(req.uid, 10); - room.users = data.users.filter(function(user) { - return user && parseInt(user.uid, 10) && parseInt(user.uid, 10) !== req.uid; - }); - - room.rooms = recentChats.rooms; - room.nextStart = recentChats.nextStart; - room.title = room.roomName; - room.breadcrumbs = helpers.buildBreadcrumbs([{text: '[[pages:chats]]', url: '/chats'}, {text: room.roomName}]); - room.maximumUsersInChatRoom = parseInt(meta.config.maximumUsersInChatRoom, 10) || 0; - room.maximumChatMessageLength = parseInt(meta.config.maximumChatMessageLength, 10) || 1000; - room.showUserInput = !room.maximumUsersInChatRoom || room.maximumUsersInChatRoom > 2; - - res.render('chats', room); + room.isOwner = parseInt(room.owner, 10) === parseInt(req.uid, 10); + room.users = data.users.filter(function(user) { + return user && parseInt(user.uid, 10) && parseInt(user.uid, 10) !== req.uid; }); + + room.rooms = recentChats.rooms; + room.userslug = req.params.userslug; + room.nextStart = recentChats.nextStart; + room.title = room.roomName; + room.breadcrumbs = helpers.buildBreadcrumbs([{text: '[[pages:chats]]', url: '/chats'}, {text: room.roomName}]); + room.maximumUsersInChatRoom = parseInt(meta.config.maximumUsersInChatRoom, 10) || 0; + room.maximumChatMessageLength = parseInt(meta.config.maximumChatMessageLength, 10) || 1000; + room.showUserInput = !room.maximumUsersInChatRoom || room.maximumUsersInChatRoom > 2; + + res.render('chats', room); }); }; + + module.exports = chatsController; \ No newline at end of file diff --git a/src/routes/accounts.js b/src/routes/accounts.js index 7b6ead07cf..d74316f816 100644 --- a/src/routes/accounts.js +++ b/src/routes/accounts.js @@ -31,5 +31,5 @@ module.exports = function (app, middleware, controllers) { app.delete('/api/user/:userslug/session/:uuid', [middleware.requireUser], controllers.accounts.session.revoke); setupPageRoute(app, '/notifications', middleware, [middleware.authenticate], controllers.accounts.notifications.get); - setupPageRoute(app, '/chats/:roomid?', middleware, [middleware.authenticate], controllers.accounts.chats.get); + setupPageRoute(app, '/user/:userslug/chats/:roomid?', middleware, accountMiddlewares, controllers.accounts.chats.get); }; From 515ed0fc6b8efe7dd004a65fa642018c29668590 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 20 Sep 2016 14:28:59 +0300 Subject: [PATCH 05/37] up themes --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 26daff6dcc..a95acf75ad 100644 --- a/package.json +++ b/package.json @@ -61,8 +61,8 @@ "nodebb-plugin-spam-be-gone": "0.4.10", "nodebb-rewards-essentials": "0.0.9", "nodebb-theme-lavender": "3.0.14", - "nodebb-theme-persona": "4.1.45", - "nodebb-theme-vanilla": "5.1.29", + "nodebb-theme-persona": "4.1.46", + "nodebb-theme-vanilla": "5.1.30", "nodebb-widget-essentials": "2.0.11", "nodemailer": "2.0.0", "nodemailer-sendmail-transport": "1.0.0", From 4be20799ecf78ed51b81c00573670c3de81c0071 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 20 Sep 2016 14:41:53 +0300 Subject: [PATCH 06/37] fix getRecentChats --- public/src/client/chats/recent.js | 1 + src/controllers/accounts/chats.js | 3 +++ src/socket.io/modules.js | 14 +++++++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/public/src/client/chats/recent.js b/public/src/client/chats/recent.js index 6905841269..9afc7ab76a 100644 --- a/public/src/client/chats/recent.js +++ b/public/src/client/chats/recent.js @@ -23,6 +23,7 @@ define('forum/chats/recent', function() { } recentChats.attr('loading', 1); socket.emit('modules.chats.getRecentChats', { + uid: ajaxify.data.uid, after: recentChats.attr('data-nextstart') }, function(err, data) { if (err) { diff --git a/src/controllers/accounts/chats.js b/src/controllers/accounts/chats.js index b638cb0006..c6ff2886c1 100644 --- a/src/controllers/accounts/chats.js +++ b/src/controllers/accounts/chats.js @@ -16,6 +16,7 @@ chatsController.get = function(req, res, callback) { } var uid; var recentChats; + async.waterfall([ function(next) { user.getUidByUserslug(req.params.userslug, next); @@ -32,6 +33,7 @@ chatsController.get = function(req, res, callback) { if (!req.params.roomid) { return res.render('chats', { rooms: recentChats.rooms, + uid: uid, userslug: req.params.userslug, nextStart: recentChats.nextStart, allowed: true, @@ -69,6 +71,7 @@ chatsController.get = function(req, res, callback) { }); room.rooms = recentChats.rooms; + room.uid = uid; room.userslug = req.params.userslug; room.nextStart = recentChats.nextStart; room.title = room.roomName; diff --git a/src/socket.io/modules.js b/src/socket.io/modules.js index b77d22252d..900b4de0e6 100644 --- a/src/socket.io/modules.js +++ b/src/socket.io/modules.js @@ -295,10 +295,18 @@ SocketModules.chats.getRecentChats = function(socket, data, callback) { if (!data || !utils.isNumber(data.after)) { return callback(new Error('[[error:invalid-data]]')); } - var start = parseInt(data.after, 10), - stop = start + 9; + var start = parseInt(data.after, 10); + var stop = start + 9; + if (socket.uid === parseInt(data.uid, 10)) { + return Messaging.getRecentChats(socket.uid, start, stop, callback); + } - Messaging.getRecentChats(socket.uid, start, stop, callback); + user.isAdminOrGlobalMod(socket.uid, function(err, isAdminOrGlobalMod) { + if (err || !isAdminOrGlobalMod) { + return callback(err || new Error('[[error:no-privileges]]')); + } + Messaging.getRecentChats(data.uid, start, stop, callback); + }); }; SocketModules.chats.hasPrivateChat = function(socket, uid, callback) { From 6c7fe6b5cfda600b8c422e916608033222b2bd86 Mon Sep 17 00:00:00 2001 From: NodeBB Misty Date: Tue, 20 Sep 2016 09:03:36 -0400 Subject: [PATCH 07/37] Latest translations and fallbacks --- public/language/tr/error.json | 2 +- public/language/tr/topic.json | 2 +- public/language/tr/user.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/language/tr/error.json b/public/language/tr/error.json index 65c8a3586f..7ae7eff012 100644 --- a/public/language/tr/error.json +++ b/public/language/tr/error.json @@ -29,7 +29,7 @@ "username-too-long": "Kullanıcı ismi çok uzun.", "password-too-long": "Parola çok uzun", "user-banned": "Kullanıcı Yasaklı", - "user-banned-reason": "User banned (Reason: %1)", + "user-banned-reason": "Kullanıcı yasaklandı (Sebep: %1)", "user-too-new": "Özür dileriz, ilk iletinizi yapmadan önce %1 saniye beklemeniz gerekiyor", "blacklisted-ip": "Üzgünüz, IP adresiniz, bu toplulukta yasaklandı. Bunun bir hata olduğunu düşünüyorsanız, bir yönetici ile irtibata geçiniz.", "ban-expiry-missing": "Bu yasak için bir bitiş tarihi girin", diff --git a/public/language/tr/topic.json b/public/language/tr/topic.json index d46d9dc0b5..56d3adc900 100644 --- a/public/language/tr/topic.json +++ b/public/language/tr/topic.json @@ -51,7 +51,7 @@ "not-watching.description": "Yeni bir ileti geldiğinde bildirme.
Kategori susturulmamışsa okunmamış olarak göster.", "ignoring.description": "Yeni bir ileti geldiğinde bildirme.
Okunmamış olarak gösterme.", "thread_tools.title": "Konu Ayaları", - "thread_tools.markAsUnreadForAll": "Mark unread for all", + "thread_tools.markAsUnreadForAll": "Hepsini okundu işaretle", "thread_tools.pin": "Başlığı İğnele", "thread_tools.unpin": "Başlığı İğneleme", "thread_tools.lock": "Başlığı Kitle", diff --git a/public/language/tr/user.json b/public/language/tr/user.json index 4922ec388f..62051c7ba3 100644 --- a/public/language/tr/user.json +++ b/public/language/tr/user.json @@ -93,7 +93,7 @@ "incoming-message-sound": "Gelen mesaj sesi", "outgoing-message-sound": "Giden ileti sesi", "notification-sound": "Bildiri sesi", - "no-sound": "No sound", + "no-sound": "Ses yok", "browsing": "Tarayıcı Ayaları", "open_links_in_new_tab": "Dışarı giden bağlantıları yeni sekmede aç", "enable_topic_searching": "Konu içi aramayı aktive et", From 55396ca442033ebb11302a7ea06170815dd3b85d Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 20 Sep 2016 16:58:50 +0300 Subject: [PATCH 08/37] inf scroll in chat-content --- public/src/client/chats.js | 33 +++++++++++++++++++++++++++++++++ public/src/modules/chat.js | 4 +++- src/messaging.js | 33 ++++++++++++++++++++++++--------- src/socket.io/modules.js | 22 ++++++++++++++++++++++ 4 files changed, 82 insertions(+), 10 deletions(-) diff --git a/public/src/client/chats.js b/public/src/client/chats.js index e2019c6c5a..2435042289 100644 --- a/public/src/client/chats.js +++ b/public/src/client/chats.js @@ -81,6 +81,39 @@ define('forum/chats', [ Chats.addSinceHandler(ajaxify.data.roomId, $('.expanded-chat .chat-content'), $('.expanded-chat [data-since]')); Chats.addRenameHandler(ajaxify.data.roomId, $('[component="chat/room/name"]')); + Chats.addScrollHandler(ajaxify.data.roomId, ajaxify.data.uid, $('.chat-content')); + }; + + Chats.addScrollHandler = function(roomId, uid, el) { + var loading = false; + el.off('scroll').on('scroll', function() { + if (loading) { + return; + } + + var top = (el[0].scrollHeight - el.height()) * 0.1; + if (el.scrollTop() >= top) { + return; + } + loading = true; + + socket.emit('modules.chats.getMessages', {roomId: roomId, uid: uid, start: $('.chat-content').children('[data-index]').first().attr('data-index')}, function(err, data) { + if (err) { + return app.alertError(err.message); + } + + messages.parseMessage(data, function(html) { + var currentScrollTop = el.scrollTop(); + var previousHeight = el[0].scrollHeight; + html = $(html); + el.prepend(html); + html.find('.timeago').timeago(); + html.find('img:not(.not-responsive)').addClass('img-responsive'); + el.scrollTop((el[0].scrollHeight - previousHeight) + currentScrollTop); + loading = false; + }); + }); + }); }; Chats.addEditDeleteHandler = function(element, roomId) { diff --git a/public/src/modules/chat.js b/public/src/modules/chat.js index 5178d2d03c..7b87b6e376 100644 --- a/public/src/modules/chat.js +++ b/public/src/modules/chat.js @@ -104,7 +104,7 @@ define('chat', [ }; module.loadChatsDropdown = function(chatsListEl) { - socket.emit('modules.chats.getRecentChats', {after: 0}, function(err, data) { + socket.emit('modules.chats.getRecentChats', {uid: app.user.uid, after: 0}, function(err, data) { if (err) { return app.alertError(err.message); } @@ -261,6 +261,8 @@ define('chat', [ Chats.loadChatSince(chatModal.attr('roomId'), chatModal.find('.chat-content'), 'recent'); + Chats.addScrollHandler(chatModal.attr('roomId'), app.user.uid, chatModal.find('.chat-content')); + checkStatus(chatModal); taskbar.push('chat', chatModal.attr('UUID'), { diff --git a/src/messaging.js b/src/messaging.js index b17bea6ec2..2fe69e50fe 100644 --- a/src/messaging.js +++ b/src/messaging.js @@ -49,21 +49,22 @@ var async = require('async'), }; Messaging.getMessages = function(params, callback) { - var uid = params.uid, - roomId = params.roomId, - since = params.since, - isNew = params.isNew, - count = params.count || 250, - markRead = params.markRead || true; + var uid = params.uid; + var roomId = params.roomId; + var since = params.since; + var isNew = params.isNew; + var start = params.hasOwnProperty('start') ? params.start : 0; + var count = params.count || 250; + var markRead = params.markRead || true; var min = params.count ? 0 : Date.now() - (terms[since] || terms.day); if (since === 'recent') { - count = 49; + count = 50; min = 0; } - db.getSortedSetRevRangeByScore('uid:' + uid + ':chat:room:' + roomId + ':mids', 0, count, '+inf', min, function(err, mids) { + db.getSortedSetRevRangeByScore('uid:' + uid + ':chat:room:' + roomId + ':mids', start, count, '+inf', min, function(err, mids) { if (err) { return callback(err); } @@ -71,10 +72,24 @@ var async = require('async'), if (!Array.isArray(mids) || !mids.length) { return callback(null, []); } + var indices = {}; + mids.forEach(function(mid, index) { + indices[mid] = start + index; + }); mids.reverse(); - Messaging.getMessagesData(mids, uid, roomId, isNew, callback); + Messaging.getMessagesData(mids, uid, roomId, isNew, function(err, messageData) { + if (err) { + return callback(err); + } + + for(var i=0; i Date: Tue, 20 Sep 2016 17:02:40 +0300 Subject: [PATCH 09/37] up themes --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a95acf75ad..bf82a4584f 100644 --- a/package.json +++ b/package.json @@ -61,8 +61,8 @@ "nodebb-plugin-spam-be-gone": "0.4.10", "nodebb-rewards-essentials": "0.0.9", "nodebb-theme-lavender": "3.0.14", - "nodebb-theme-persona": "4.1.46", - "nodebb-theme-vanilla": "5.1.30", + "nodebb-theme-persona": "4.1.47", + "nodebb-theme-vanilla": "5.1.31", "nodebb-widget-essentials": "2.0.11", "nodemailer": "2.0.0", "nodemailer-sendmail-transport": "1.0.0", From 33306f6236abf94b1975d36c52e10a97142a4899 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 20 Sep 2016 17:21:43 +0300 Subject: [PATCH 10/37] show stack on error --- public/src/modules/translator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/modules/translator.js b/public/src/modules/translator.js index a031efdd0f..e801d9d796 100644 --- a/public/src/modules/translator.js +++ b/public/src/modules/translator.js @@ -298,7 +298,7 @@ Translator.create(lang).translate(text).then(function (output) { return cb(output); }).catch(function (err) { - console.error('Translation failed: ' + err.message); + console.error('Translation failed: ' + err.stack); }); }, From 4b3b123cd049bc7283f16511be30c4c549a19dc7 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 20 Sep 2016 17:46:32 +0300 Subject: [PATCH 11/37] closes #5042 --- src/user/create.js | 3 +++ src/user/settings.js | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/user/create.js b/src/user/create.js index 160971c56a..d01cfaaf64 100644 --- a/src/user/create.js +++ b/src/user/create.js @@ -131,6 +131,9 @@ module.exports = function(User) { async.apply(User.reset.updateExpiry, userData.uid) ], next); }); + }, + function(next) { + User.updateDigestSetting(userData.uid, meta.config.dailyDigestSetting, next); } ], next); }, diff --git a/src/user/settings.js b/src/user/settings.js index f4d9b37986..984bee50f2 100644 --- a/src/user/settings.js +++ b/src/user/settings.js @@ -136,7 +136,7 @@ module.exports = function(User) { db.setObject('user:' + uid + ':settings', settings, next); }, function(next) { - updateDigestSetting(uid, data.dailyDigestFreq, next); + User.updateDigestSetting(uid, data.dailyDigestFreq, next); }, function(next) { User.getSettings(uid, next); @@ -144,7 +144,7 @@ module.exports = function(User) { ], callback); }; - function updateDigestSetting(uid, dailyDigestFreq, callback) { + User.updateDigestSetting = function(uid, dailyDigestFreq, callback) { async.waterfall([ function(next) { db.sortedSetsRemove(['digest:day:uids', 'digest:week:uids', 'digest:month:uids'], uid, next); @@ -157,7 +157,7 @@ module.exports = function(User) { } } ], callback); - } + }; User.setSetting = function(uid, key, value, callback) { db.setObjectField('user:' + uid + ':settings', key, value, callback); From b0b6c66f7728005b3cbd818a68008b9716a5a81c Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 21 Sep 2016 11:36:02 +0300 Subject: [PATCH 12/37] fix unix domain socket --- src/webserver.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/webserver.js b/src/webserver.js index d7457e1b95..3e14ac2a33 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -205,6 +205,8 @@ function initializeNodeBB(callback) { function listen() { var port = parseInt(nconf.get('port'), 10); + var isSocket = isNaN(port); + var socketPath = isSocket ? nconf.get('port') : ''; if (Array.isArray(port)) { if (!port.length) { @@ -230,10 +232,10 @@ function listen() { winston.info('Using ports 80 and 443 is not recommend; use a proxy instead. See README.md'); } - var isSocket = isNaN(port), - args = isSocket ? [port] : [port, nconf.get('bind_address')], - bind_address = ((nconf.get('bind_address') === "0.0.0.0" || !nconf.get('bind_address')) ? '0.0.0.0' : nconf.get('bind_address')) + ':' + port, - oldUmask; + + var args = isSocket ? [socketPath] : [port, nconf.get('bind_address')]; + var bind_address = ((nconf.get('bind_address') === "0.0.0.0" || !nconf.get('bind_address')) ? '0.0.0.0' : nconf.get('bind_address')) + ':' + port; + var oldUmask; args.push(function(err) { if (err) { @@ -241,7 +243,7 @@ function listen() { process.exit(); } - winston.info('NodeBB is now listening on: ' + (isSocket ? port : bind_address)); + winston.info('NodeBB is now listening on: ' + (isSocket ? socketPath : bind_address)); if (oldUmask) { process.umask(oldUmask); } @@ -250,11 +252,11 @@ function listen() { // Alter umask if necessary if (isSocket) { oldUmask = process.umask('0000'); - module.exports.testSocket(port, function(err) { + module.exports.testSocket(socketPath, function(err) { if (!err) { server.listen.apply(server, args); } else { - winston.error('[startup] NodeBB was unable to secure domain socket access (' + port + ')'); + winston.error('[startup] NodeBB was unable to secure domain socket access (' + socketPath + ')'); winston.error('[startup] ' + err.message); process.exit(); } From d60ab3c74c2f7b0ffd74fdfe0b7cb33045749fca Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 21 Sep 2016 12:00:37 +0300 Subject: [PATCH 13/37] removed cacheStaticFiles --- src/webserver.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/webserver.js b/src/webserver.js index 3e14ac2a33..9fbe6f0ef9 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -94,6 +94,11 @@ function setupExpressApp(app) { app.enable('view cache'); + if (global.env !== 'development') { + app.enable('cache'); + app.enable('minification'); + } + app.use(compression()); setupFavicon(app); @@ -130,7 +135,6 @@ function setupFavicon(app) { } } - function setupCookie() { var cookie = { maxAge: 1000 * 60 * 60 * 24 * (parseInt(meta.config.loginDays, 10) || 14) @@ -152,15 +156,6 @@ function setupCookie() { return cookie; } -function cacheStaticFiles() { - if (global.env === 'development') { - return; - } - - app.enable('cache'); - app.enable('minification'); -} - function initializeNodeBB(callback) { var skipJS; var fromFile = nconf.get('from-file') || ''; From 15cae8d6eae7c682609ff8ce3f6c57fbe3d87f7f Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 21 Sep 2016 12:55:44 +0300 Subject: [PATCH 14/37] ability to set moderation note on users --- package.json | 4 ++-- public/language/en_GB/global.json | 1 + public/language/en_GB/user.json | 4 +++- public/src/client/account/info.js | 15 ++++++++++++++- src/controllers/accounts/helpers.js | 1 + src/socket.io/user.js | 21 +++++++++++++++++++++ 6 files changed, 42 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index bf82a4584f..ec9c793eb6 100644 --- a/package.json +++ b/package.json @@ -61,8 +61,8 @@ "nodebb-plugin-spam-be-gone": "0.4.10", "nodebb-rewards-essentials": "0.0.9", "nodebb-theme-lavender": "3.0.14", - "nodebb-theme-persona": "4.1.47", - "nodebb-theme-vanilla": "5.1.31", + "nodebb-theme-persona": "4.1.48", + "nodebb-theme-vanilla": "5.1.32", "nodebb-widget-essentials": "2.0.11", "nodemailer": "2.0.0", "nodemailer-sendmail-transport": "1.0.0", diff --git a/public/language/en_GB/global.json b/public/language/en_GB/global.json index e2785de2f5..1881b53acb 100644 --- a/public/language/en_GB/global.json +++ b/public/language/en_GB/global.json @@ -23,6 +23,7 @@ "you_have_successfully_logged_in": "You have successfully logged in", "save_changes": "Save Changes", + "save": "Save", "close": "Close", "pagination": "Pagination", diff --git a/public/language/en_GB/user.json b/public/language/en_GB/user.json index 4dfd450cff..10a21ff03e 100644 --- a/public/language/en_GB/user.json +++ b/public/language/en_GB/user.json @@ -142,5 +142,7 @@ "info.banned-reason-label": "Reason", "info.banned-no-reason": "No reason given.", "info.username-history": "Username History", - "info.email-history": "Email History" + "info.email-history": "Email History", + "info.moderation-note": "Moderation Note", + "info.moderation-note.success": "Moderation note saved" } diff --git a/public/src/client/account/info.js b/public/src/client/account/info.js index b95f68b838..3e1a218827 100644 --- a/public/src/client/account/info.js +++ b/public/src/client/account/info.js @@ -1,13 +1,26 @@ 'use strict'; -/* globals define */ +/* globals define, socket, ajaxify, app */ define('forum/account/info', ['forum/account/header'], function(header) { var Info = {}; Info.init = function() { header.init(); + handleModerationNote(); }; + function handleModerationNote() { + $('[component="account/save-moderation-note"]').on('click', function() { + var note = $('[component="account/moderation-note"]').val(); + socket.emit('user.setModerationNote', {uid: ajaxify.data.uid, note: note}, function(err) { + if (err) { + return app.alertError(err.message); + } + app.alertSuccess('[[user:info.moderation-note.success]]'); + }); + }); + } + return Info; }); diff --git a/src/controllers/accounts/helpers.js b/src/controllers/accounts/helpers.js index 29bcb1d851..749eca5de8 100644 --- a/src/controllers/accounts/helpers.js +++ b/src/controllers/accounts/helpers.js @@ -92,6 +92,7 @@ helpers.getUserDataByUserSlug = function(userslug, callerUID, callback) { userData.theirid = userData.uid; userData.isAdmin = isAdmin; userData.isGlobalModerator = isGlobalModerator; + userData.isAdminOrGlobalModerator = isAdmin || isGlobalModerator; userData.canBan = isAdmin || isGlobalModerator; userData.canChangePassword = isAdmin || (isSelf && parseInt(meta.config['password:disableEdit'], 10) !== 1); userData.isSelf = isSelf; diff --git a/src/socket.io/user.js b/src/socket.io/user.js index 83539bad3c..453ffed7d2 100644 --- a/src/socket.io/user.js +++ b/src/socket.io/user.js @@ -319,5 +319,26 @@ SocketUser.getUserByEmail = function(socket, email, callback) { apiController.getUserDataByField(socket.uid, 'email', email, callback); }; +SocketUser.setModerationNote = function(socket, data, callback) { + if (!socket.uid || !data || !data.uid) { + return callback(new Error('[[error:invalid-data]]')); + } + + async.waterfall([ + function(next) { + user.isAdminOrGlobalMod(socket.uid, next); + }, + function(isAdminOrGlobalMod, next) { + if (!isAdminOrGlobalMod) { + return next(new Error('[[error:no-privileges]]')); + } + if (data.note) { + user.setUserField(data.uid, 'moderationNote', data.note, next); + } else { + db.deleteObjectField('user:' + data.uid, 'moderationNote', next); + } + } + ], callback); +}; module.exports = SocketUser; From aad1e54c37d0a7d611130cbe7a33b5e0a19dd713 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 21 Sep 2016 15:18:30 +0300 Subject: [PATCH 15/37] closes #5041 --- public/src/client/categoryTools.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/src/client/categoryTools.js b/public/src/client/categoryTools.js index 970ab29d4a..8344ddf355 100644 --- a/public/src/client/categoryTools.js +++ b/public/src/client/categoryTools.js @@ -68,7 +68,9 @@ define('forum/categoryTools', ['forum/topic/move', 'topicSelect', 'components', return app.alertError(err.message); } app.alertSuccess('[[topic:markAsUnreadForAll.success]]'); - + tids.forEach(function(tid) { + $('[component="category/topic"][data-tid="' + tid + '"]').addClass('unread'); + }); onCommandComplete(); }); } From 5c045288ab016dd73ac09347f38aa39c52cb95d2 Mon Sep 17 00:00:00 2001 From: NodeBB Misty Date: Wed, 21 Sep 2016 09:02:33 -0400 Subject: [PATCH 16/37] Latest translations and fallbacks --- public/language/ar/global.json | 3 ++- public/language/ar/user.json | 4 +++- public/language/bg/global.json | 3 ++- public/language/bg/user.json | 4 +++- public/language/bn/global.json | 3 ++- public/language/bn/user.json | 4 +++- public/language/cs/global.json | 3 ++- public/language/cs/user.json | 4 +++- public/language/da/global.json | 3 ++- public/language/da/user.json | 4 +++- public/language/de/global.json | 3 ++- public/language/de/user.json | 4 +++- public/language/el/global.json | 3 ++- public/language/el/user.json | 4 +++- public/language/en@pirate/global.json | 3 ++- public/language/en@pirate/user.json | 4 +++- public/language/en_US/global.json | 3 ++- public/language/en_US/user.json | 4 +++- public/language/es/global.json | 3 ++- public/language/es/user.json | 4 +++- public/language/et/global.json | 3 ++- public/language/et/user.json | 4 +++- public/language/fa_IR/global.json | 3 ++- public/language/fa_IR/user.json | 4 +++- public/language/fi/global.json | 3 ++- public/language/fi/user.json | 4 +++- public/language/fr/global.json | 3 ++- public/language/fr/user.json | 4 +++- public/language/gl/global.json | 3 ++- public/language/gl/user.json | 4 +++- public/language/he/global.json | 3 ++- public/language/he/user.json | 4 +++- public/language/hu/global.json | 3 ++- public/language/hu/user.json | 4 +++- public/language/id/global.json | 3 ++- public/language/id/user.json | 4 +++- public/language/it/global.json | 3 ++- public/language/it/user.json | 4 +++- public/language/ja/global.json | 3 ++- public/language/ja/user.json | 4 +++- public/language/ko/global.json | 3 ++- public/language/ko/user.json | 4 +++- public/language/lt/global.json | 3 ++- public/language/lt/user.json | 4 +++- public/language/ms/global.json | 3 ++- public/language/ms/user.json | 4 +++- public/language/nb/global.json | 3 ++- public/language/nb/user.json | 4 +++- public/language/nl/global.json | 3 ++- public/language/nl/user.json | 4 +++- public/language/pl/global.json | 3 ++- public/language/pl/user.json | 4 +++- public/language/pt_BR/error.json | 2 +- public/language/pt_BR/global.json | 3 ++- public/language/pt_BR/topic.json | 2 +- public/language/pt_BR/user.json | 6 ++++-- public/language/ro/global.json | 3 ++- public/language/ro/user.json | 4 +++- public/language/ru/global.json | 3 ++- public/language/ru/user.json | 4 +++- public/language/rw/global.json | 3 ++- public/language/rw/user.json | 4 +++- public/language/sc/global.json | 3 ++- public/language/sc/user.json | 4 +++- public/language/sk/global.json | 3 ++- public/language/sk/user.json | 4 +++- public/language/sl/global.json | 3 ++- public/language/sl/user.json | 4 +++- public/language/sr/global.json | 3 ++- public/language/sr/user.json | 4 +++- public/language/sv/global.json | 3 ++- public/language/sv/user.json | 4 +++- public/language/th/global.json | 3 ++- public/language/th/user.json | 4 +++- public/language/tr/global.json | 3 ++- public/language/tr/user.json | 4 +++- public/language/vi/global.json | 3 ++- public/language/vi/user.json | 4 +++- public/language/zh_CN/global.json | 3 ++- public/language/zh_CN/user.json | 4 +++- public/language/zh_TW/global.json | 3 ++- public/language/zh_TW/user.json | 4 +++- 82 files changed, 203 insertions(+), 83 deletions(-) diff --git a/public/language/ar/global.json b/public/language/ar/global.json index 4c86069873..fdfd1362f8 100644 --- a/public/language/ar/global.json +++ b/public/language/ar/global.json @@ -96,5 +96,6 @@ "upload": "ارفع", "allowed-file-types": "صيغ الملفات المدعومة هي 1%", "unsaved-changes": "لديك تغييرات لم تحفظ. هل أنت متأكد من تغيير الصفحة؟", - "reconnecting-message": "يبدو أن اتصالك لـ %1 قد فقد. رجاءًا أنتظر ثم حاول الإتصال مرة اخرى." + "reconnecting-message": "يبدو أن اتصالك لـ %1 قد فقد. رجاءًا أنتظر ثم حاول الإتصال مرة اخرى.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/ar/user.json b/public/language/ar/user.json index 1e20b5b6cf..dbee05cfab 100644 --- a/public/language/ar/user.json +++ b/public/language/ar/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/bg/global.json b/public/language/bg/global.json index d4ffed8334..06eb4b3e59 100644 --- a/public/language/bg/global.json +++ b/public/language/bg/global.json @@ -96,5 +96,6 @@ "upload": "Качване", "allowed-file-types": "Разрешените файлови типове са: %1", "unsaved-changes": "Имате незапазени промени. Наистина ли искате да напуснете тази страница?", - "reconnecting-message": "Изглежда връзката Ви към %1 беше прекъсната. Моля, изчакайте докато се опитаме да Ви свържем отново." + "reconnecting-message": "Изглежда връзката Ви към %1 беше прекъсната. Моля, изчакайте докато се опитаме да Ви свържем отново.", + "play": "Пускане" } \ No newline at end of file diff --git a/public/language/bg/user.json b/public/language/bg/user.json index 52c196ef97..2bac3f837e 100644 --- a/public/language/bg/user.json +++ b/public/language/bg/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Блокиран до %1", "info.banned-permanently": "Блокиран за постоянно", "info.banned-reason-label": "Причина", - "info.banned-no-reason": "Няма посочена причина." + "info.banned-no-reason": "Няма посочена причина.", + "info.username-history": "История на потребителските имена", + "info.email-history": "Историята на е-пощите" } \ No newline at end of file diff --git a/public/language/bn/global.json b/public/language/bn/global.json index 545020267d..35c002b5c3 100644 --- a/public/language/bn/global.json +++ b/public/language/bn/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/bn/user.json b/public/language/bn/user.json index 6e099a4896..59811361ce 100644 --- a/public/language/bn/user.json +++ b/public/language/bn/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/cs/global.json b/public/language/cs/global.json index e822b289c3..9043a00952 100644 --- a/public/language/cs/global.json +++ b/public/language/cs/global.json @@ -96,5 +96,6 @@ "upload": "Nahrát", "allowed-file-types": "Povolené typy souborů jsou %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/cs/user.json b/public/language/cs/user.json index 51ff8ce91c..5694a135f0 100644 --- a/public/language/cs/user.json +++ b/public/language/cs/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/da/global.json b/public/language/da/global.json index 5ef9da2842..0d07e841e8 100644 --- a/public/language/da/global.json +++ b/public/language/da/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Tilladte filtyper er %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/da/user.json b/public/language/da/user.json index 4d82a665fb..11a2dd8a92 100644 --- a/public/language/da/user.json +++ b/public/language/da/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/de/global.json b/public/language/de/global.json index 2793fc58cf..99a92d3cf5 100644 --- a/public/language/de/global.json +++ b/public/language/de/global.json @@ -96,5 +96,6 @@ "upload": "Hochladen", "allowed-file-types": "Erlaubte Dateitypen sind %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/de/user.json b/public/language/de/user.json index 125580cfab..63a7e1a2e1 100644 --- a/public/language/de/user.json +++ b/public/language/de/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Grund", - "info.banned-no-reason": "Kein Grund angegeben." + "info.banned-no-reason": "Kein Grund angegeben.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/el/global.json b/public/language/el/global.json index 34df3b45bf..a88c6acf22 100644 --- a/public/language/el/global.json +++ b/public/language/el/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/el/user.json b/public/language/el/user.json index 4753cfbe6d..c83190a479 100644 --- a/public/language/el/user.json +++ b/public/language/el/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/en@pirate/global.json b/public/language/en@pirate/global.json index aa50d9d08a..2b231e6687 100644 --- a/public/language/en@pirate/global.json +++ b/public/language/en@pirate/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/en@pirate/user.json b/public/language/en@pirate/user.json index 9b8a875035..9c67a66c10 100644 --- a/public/language/en@pirate/user.json +++ b/public/language/en@pirate/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/en_US/global.json b/public/language/en_US/global.json index 383516d05c..d2a0e03fa3 100644 --- a/public/language/en_US/global.json +++ b/public/language/en_US/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/en_US/user.json b/public/language/en_US/user.json index 057433ae31..00a3201eb2 100644 --- a/public/language/en_US/user.json +++ b/public/language/en_US/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/es/global.json b/public/language/es/global.json index 42a7109f6a..ba5f1ee95b 100644 --- a/public/language/es/global.json +++ b/public/language/es/global.json @@ -96,5 +96,6 @@ "upload": "Subir", "allowed-file-types": "Los tipos de archivos permitidos son: %1", "unsaved-changes": "Tienes cambios sin guardar. Seguro que quieres salir?", - "reconnecting-message": "Has perdido la conexión. Reconectando a %1." + "reconnecting-message": "Has perdido la conexión. Reconectando a %1.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/es/user.json b/public/language/es/user.json index f8a4a800e0..508ffdae32 100644 --- a/public/language/es/user.json +++ b/public/language/es/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Baneado hasta %1", "info.banned-permanently": "Baneado permanentemente", "info.banned-reason-label": "Motivo", - "info.banned-no-reason": "Motivo no especificado" + "info.banned-no-reason": "Motivo no especificado", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/et/global.json b/public/language/et/global.json index 67ae319e61..12c77773ba 100644 --- a/public/language/et/global.json +++ b/public/language/et/global.json @@ -96,5 +96,6 @@ "upload": "Lae üles", "allowed-file-types": "Lubatud faili formaadid on %1", "unsaved-changes": "Sul on salvestamata muudatusi. Oled kindel, et soovid lahkuda?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/et/user.json b/public/language/et/user.json index e0b9078d8f..1d356f8229 100644 --- a/public/language/et/user.json +++ b/public/language/et/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Keelustatud kuni %1", "info.banned-permanently": "Igavesti keelustatud", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/fa_IR/global.json b/public/language/fa_IR/global.json index 386c069b39..476d95651f 100644 --- a/public/language/fa_IR/global.json +++ b/public/language/fa_IR/global.json @@ -96,5 +96,6 @@ "upload": "بارگذاری", "allowed-file-types": "فایل قابل قبول اینها هستند %1", "unsaved-changes": "تغییرات شما ذخیره نشده. شما مطمئن هستید که میخواهید از اینجا دور شوید؟", - "reconnecting-message": "اتصال شما به %1 به نظر می‌رسد از دست رفته. لطفا صبر کنید ما سعی می‌کنیم که دوباره شما را متصل کنیم." + "reconnecting-message": "اتصال شما به %1 به نظر می‌رسد از دست رفته. لطفا صبر کنید ما سعی می‌کنیم که دوباره شما را متصل کنیم.", + "play": "پخش" } \ No newline at end of file diff --git a/public/language/fa_IR/user.json b/public/language/fa_IR/user.json index 71224d0abe..6e0fd1416a 100644 --- a/public/language/fa_IR/user.json +++ b/public/language/fa_IR/user.json @@ -121,5 +121,7 @@ "info.banned-until": "مسدود شده تا %1", "info.banned-permanently": "مسدود شده به طور دائم", "info.banned-reason-label": "دلیل", - "info.banned-no-reason": "هیچ دلیلی ارایه نشد." + "info.banned-no-reason": "هیچ دلیلی ارایه نشد.", + "info.username-history": "تاریخچه نام کاربری", + "info.email-history": "تاریخچه رایانامه" } \ No newline at end of file diff --git a/public/language/fi/global.json b/public/language/fi/global.json index 434aece0f3..a56b79e888 100644 --- a/public/language/fi/global.json +++ b/public/language/fi/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/fi/user.json b/public/language/fi/user.json index bc44655d7d..ad20653c29 100644 --- a/public/language/fi/user.json +++ b/public/language/fi/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/fr/global.json b/public/language/fr/global.json index a37d6fa925..d7136e0746 100644 --- a/public/language/fr/global.json +++ b/public/language/fr/global.json @@ -96,5 +96,6 @@ "upload": "Envoyer", "allowed-file-types": "Les types de fichiers autorisés sont : %1", "unsaved-changes": "Vous avez des modifications non sauvegardées. Êtes-vous sûr de vouloir naviguer tout de même ?", - "reconnecting-message": "Il semble que votre connexion ait été perdue, veuillez patienter pendant que nous vous re-connectons." + "reconnecting-message": "Il semble que votre connexion ait été perdue, veuillez patienter pendant que nous vous re-connectons.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/fr/user.json b/public/language/fr/user.json index 66d9fd4267..7b6a6c23eb 100644 --- a/public/language/fr/user.json +++ b/public/language/fr/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banni jusqu'au %1", "info.banned-permanently": "Banni de façon permanente", "info.banned-reason-label": "Raison", - "info.banned-no-reason": "Aucune raison donnée" + "info.banned-no-reason": "Aucune raison donnée", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/gl/global.json b/public/language/gl/global.json index 0f8663d96f..f2aa29ee3d 100644 --- a/public/language/gl/global.json +++ b/public/language/gl/global.json @@ -96,5 +96,6 @@ "upload": "Subir", "allowed-file-types": "Os tipos de arquivos permitidos son: %1", "unsaved-changes": "Non gardaches tódolos cambios. Queres continuar e saír da páxina?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/gl/user.json b/public/language/gl/user.json index 075c2d5c51..3fd472308b 100644 --- a/public/language/gl/user.json +++ b/public/language/gl/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Baneado hasta 1%", "info.banned-permanently": "Baneado permanentemente", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/he/global.json b/public/language/he/global.json index 8f2c2347b2..a5dc920333 100644 --- a/public/language/he/global.json +++ b/public/language/he/global.json @@ -96,5 +96,6 @@ "upload": "העלה", "allowed-file-types": "פורמטי הקבצים המורשים הם %1", "unsaved-changes": "יש לך שינויים שאינם נשמרו. האם הנך בטוח שברצונך להמשיך?", - "reconnecting-message": "נראה שההתחברות שלך אל %1 אבדה, אנא המתן בזמן שהמערכת מנסה לחבר אותך מחדש" + "reconnecting-message": "נראה שההתחברות שלך אל %1 אבדה, אנא המתן בזמן שהמערכת מנסה לחבר אותך מחדש", + "play": "Play" } \ No newline at end of file diff --git a/public/language/he/user.json b/public/language/he/user.json index e16b685fee..7373c8c74c 100644 --- a/public/language/he/user.json +++ b/public/language/he/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/hu/global.json b/public/language/hu/global.json index 1aae7c960b..fbca98ab9f 100644 --- a/public/language/hu/global.json +++ b/public/language/hu/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/hu/user.json b/public/language/hu/user.json index b852439d9e..40710b2266 100644 --- a/public/language/hu/user.json +++ b/public/language/hu/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/id/global.json b/public/language/id/global.json index 313a120729..9d596c7d6e 100644 --- a/public/language/id/global.json +++ b/public/language/id/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/id/user.json b/public/language/id/user.json index 666ba89276..d0c0032195 100644 --- a/public/language/id/user.json +++ b/public/language/id/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/it/global.json b/public/language/it/global.json index 8aa3659f7d..57bbaa0164 100644 --- a/public/language/it/global.json +++ b/public/language/it/global.json @@ -96,5 +96,6 @@ "upload": "Carica", "allowed-file-types": "Le estensioni permesse dei file sono %1", "unsaved-changes": "Hai delle modifiche non salvate. Sei sicuro che vuoi lasciare la pagina?", - "reconnecting-message": "Sembra che la tua connessione a %1 sia stata persa, per favore attenti mentre proviamo a riconnetterti." + "reconnecting-message": "Sembra che la tua connessione a %1 sia stata persa, per favore attenti mentre proviamo a riconnetterti.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/it/user.json b/public/language/it/user.json index 3cc0daa921..0042f1ba9f 100644 --- a/public/language/it/user.json +++ b/public/language/it/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Bannato fino %1", "info.banned-permanently": "Bannato permanentemente", "info.banned-reason-label": "Motivo", - "info.banned-no-reason": "Non è stata data nessuna motivazione." + "info.banned-no-reason": "Non è stata data nessuna motivazione.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/ja/global.json b/public/language/ja/global.json index 107ae13ee7..e38ea7315b 100644 --- a/public/language/ja/global.json +++ b/public/language/ja/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/ja/user.json b/public/language/ja/user.json index 613332cdb2..9379383b8a 100644 --- a/public/language/ja/user.json +++ b/public/language/ja/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/ko/global.json b/public/language/ko/global.json index 6e9b7b3a93..9fd5fa47ef 100644 --- a/public/language/ko/global.json +++ b/public/language/ko/global.json @@ -96,5 +96,6 @@ "upload": "업로드", "allowed-file-types": "사용가능한 파일 유형: %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/ko/user.json b/public/language/ko/user.json index 8937d90611..b58a7d9480 100644 --- a/public/language/ko/user.json +++ b/public/language/ko/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/lt/global.json b/public/language/lt/global.json index 1ffeb7040a..1a6070a82c 100644 --- a/public/language/lt/global.json +++ b/public/language/lt/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/lt/user.json b/public/language/lt/user.json index 3046cca2e8..2b52a624bd 100644 --- a/public/language/lt/user.json +++ b/public/language/lt/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Užblokuotas iki %1", "info.banned-permanently": "Užblokuotas visam laikui", "info.banned-reason-label": "Priežastis", - "info.banned-no-reason": "Be priežasties" + "info.banned-no-reason": "Be priežasties", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/ms/global.json b/public/language/ms/global.json index 40d6209ba9..e651a3fdf1 100644 --- a/public/language/ms/global.json +++ b/public/language/ms/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/ms/user.json b/public/language/ms/user.json index 3cbbcf1e26..3d9402845d 100644 --- a/public/language/ms/user.json +++ b/public/language/ms/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/nb/global.json b/public/language/nb/global.json index 020fe6aa62..03ab9adf9f 100644 --- a/public/language/nb/global.json +++ b/public/language/nb/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/nb/user.json b/public/language/nb/user.json index 75c3a35287..0fed01f667 100644 --- a/public/language/nb/user.json +++ b/public/language/nb/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/nl/global.json b/public/language/nl/global.json index bf94e340b2..2cf9f0d6f6 100644 --- a/public/language/nl/global.json +++ b/public/language/nl/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Toegestane bestandstypen zijn %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/nl/user.json b/public/language/nl/user.json index f8c51f1d35..a06c32c5cb 100644 --- a/public/language/nl/user.json +++ b/public/language/nl/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Verbannen tot %1", "info.banned-permanently": "Voor altijd verbannen", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/pl/global.json b/public/language/pl/global.json index b3e8819172..a4c47504b7 100644 --- a/public/language/pl/global.json +++ b/public/language/pl/global.json @@ -96,5 +96,6 @@ "upload": "Załaduj", "allowed-file-types": "Dozwolone typy plików %1", "unsaved-changes": "Posiadasz niezapisane zmiany. Jesteś pewien, że chcesz opuścić stronę?", - "reconnecting-message": "Wygląda na to, że Twoje połączenie z %1 zostało przerwane. Proszę czekać gdy staramy się je odnowić." + "reconnecting-message": "Wygląda na to, że Twoje połączenie z %1 zostało przerwane. Proszę czekać gdy staramy się je odnowić.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/pl/user.json b/public/language/pl/user.json index 10d7b78316..9bc08bc656 100644 --- a/public/language/pl/user.json +++ b/public/language/pl/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Zbanowany do %1", "info.banned-permanently": "Zbanowany permanentnie", "info.banned-reason-label": "Powód", - "info.banned-no-reason": "Nie podano powodu." + "info.banned-no-reason": "Nie podano powodu.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/pt_BR/error.json b/public/language/pt_BR/error.json index b99b1bada0..38571fe60d 100644 --- a/public/language/pt_BR/error.json +++ b/public/language/pt_BR/error.json @@ -29,7 +29,7 @@ "username-too-long": "Nome de usuário muito longo", "password-too-long": "A senha é muito grande", "user-banned": "Usuário banido", - "user-banned-reason": "User banned (Reason: %1)", + "user-banned-reason": "Usuário banido (Motivo: %1)", "user-too-new": "Desculpe, é necessário que você aguarde %1 segundo(s) antes de fazer o seu primeiro post.", "blacklisted-ip": "Desculpe, o seu endereço IP foi banido desta comunidade. Se você acha que isso é um engano, por favor contate um administrador.", "ban-expiry-missing": "Por favor forneça uma data para o fim deste banimento", diff --git a/public/language/pt_BR/global.json b/public/language/pt_BR/global.json index 3b9cb20fea..7e3b515eed 100644 --- a/public/language/pt_BR/global.json +++ b/public/language/pt_BR/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Os tipos de arquivo permitidos são %1", "unsaved-changes": "Você tem alterações não salvas. Tem certeza que você deseja sair da página?", - "reconnecting-message": "Parece que sua conexão com %1 caiu, por favor aguarde enquanto tentamos reconectar." + "reconnecting-message": "Parece que sua conexão com %1 caiu, por favor aguarde enquanto tentamos reconectar.", + "play": "Executar" } \ No newline at end of file diff --git a/public/language/pt_BR/topic.json b/public/language/pt_BR/topic.json index 2b74650131..3d7531fadd 100644 --- a/public/language/pt_BR/topic.json +++ b/public/language/pt_BR/topic.json @@ -51,7 +51,7 @@ "not-watching.description": "Não me notificar de novas respostas.
Mostrar tópico em não-lido se a categoria não estiver sendo ignorada.", "ignoring.description": "Não me notificar de novas respostas.
Não mostrar tópico em não-lido.", "thread_tools.title": "Ferramentas de Tópico", - "thread_tools.markAsUnreadForAll": "Mark unread for all", + "thread_tools.markAsUnreadForAll": "Marcar como não-lido para todos", "thread_tools.pin": "Fixar Tópico", "thread_tools.unpin": "Desfixar Tópico", "thread_tools.lock": "Trancar Tópico", diff --git a/public/language/pt_BR/user.json b/public/language/pt_BR/user.json index e1a090a9b9..2d306417f6 100644 --- a/public/language/pt_BR/user.json +++ b/public/language/pt_BR/user.json @@ -93,7 +93,7 @@ "incoming-message-sound": "Som de recebimento de mensagem", "outgoing-message-sound": "Som de envio de mensagem", "notification-sound": "Som de notificação", - "no-sound": "No sound", + "no-sound": "Sem som", "browsing": "Configurações de Navegação", "open_links_in_new_tab": "Abrir links externos em nova aba", "enable_topic_searching": "Habilitar Pesquisa dentro de Tópico", @@ -121,5 +121,7 @@ "info.banned-until": "Banido até %1", "info.banned-permanently": "Banido permanentemente", "info.banned-reason-label": "Motivo", - "info.banned-no-reason": "Sem motivo escolhido." + "info.banned-no-reason": "Sem motivo escolhido.", + "info.username-history": "Histórico do Nome de Usuário", + "info.email-history": "Histórico do Email" } \ No newline at end of file diff --git a/public/language/ro/global.json b/public/language/ro/global.json index c634e3a1c8..f8b346044f 100644 --- a/public/language/ro/global.json +++ b/public/language/ro/global.json @@ -96,5 +96,6 @@ "upload": "Încărcați", "allowed-file-types": "Tipuri de fișiere permise sunt %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/ro/user.json b/public/language/ro/user.json index fa33cfde6b..9ed9377725 100644 --- a/public/language/ro/user.json +++ b/public/language/ro/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/ru/global.json b/public/language/ru/global.json index f2b3f3d8c5..9c584431ed 100644 --- a/public/language/ru/global.json +++ b/public/language/ru/global.json @@ -96,5 +96,6 @@ "upload": "Загрузить", "allowed-file-types": "Разрешенные форматы файлов %1", "unsaved-changes": "У вас есть несохраненные изменения. Вы уверены, что хотите уйти?", - "reconnecting-message": "Похоже, подключение к %1 было разорвано, подождите, пока мы пытаемся восстановить соединение." + "reconnecting-message": "Похоже, подключение к %1 было разорвано, подождите, пока мы пытаемся восстановить соединение.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/ru/user.json b/public/language/ru/user.json index 2e2fe18957..ab372b0d1a 100644 --- a/public/language/ru/user.json +++ b/public/language/ru/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Заблокирован до %1", "info.banned-permanently": "Заблокирован навсегда", "info.banned-reason-label": "Причина", - "info.banned-no-reason": "Без объяснения причин." + "info.banned-no-reason": "Без объяснения причин.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/rw/global.json b/public/language/rw/global.json index bb0164820c..f0922ae9ac 100644 --- a/public/language/rw/global.json +++ b/public/language/rw/global.json @@ -96,5 +96,6 @@ "upload": "Pakira", "allowed-file-types": "Ubwoko bw'amafayilo bwemewe ni %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/rw/user.json b/public/language/rw/user.json index 5b65837c81..ab2f435f54 100644 --- a/public/language/rw/user.json +++ b/public/language/rw/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/sc/global.json b/public/language/sc/global.json index a5b6a3e20f..159188e8c2 100644 --- a/public/language/sc/global.json +++ b/public/language/sc/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/sc/user.json b/public/language/sc/user.json index 23f54011e1..90746c1fe8 100644 --- a/public/language/sc/user.json +++ b/public/language/sc/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/sk/global.json b/public/language/sk/global.json index 7a2ac8cbaa..f184a5f15a 100644 --- a/public/language/sk/global.json +++ b/public/language/sk/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/sk/user.json b/public/language/sk/user.json index 1b0005c625..a98ec25207 100644 --- a/public/language/sk/user.json +++ b/public/language/sk/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/sl/global.json b/public/language/sl/global.json index 14ae52986b..bdf0f36896 100644 --- a/public/language/sl/global.json +++ b/public/language/sl/global.json @@ -96,5 +96,6 @@ "upload": "Prenos", "allowed-file-types": "Dovoljene vrste datotek so %1", "unsaved-changes": "Imate neshranjene spremembe. A res želite stran?", - "reconnecting-message": "Kot kaže je bila povezava do %1 prekinjena. Počakajte, ponovno poskušamo vzpostaviti povezavo." + "reconnecting-message": "Kot kaže je bila povezava do %1 prekinjena. Počakajte, ponovno poskušamo vzpostaviti povezavo.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/sl/user.json b/public/language/sl/user.json index 26d2040d4b..2162c5aab9 100644 --- a/public/language/sl/user.json +++ b/public/language/sl/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/sr/global.json b/public/language/sr/global.json index 8af7ca5b1d..57615dd8df 100644 --- a/public/language/sr/global.json +++ b/public/language/sr/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/sr/user.json b/public/language/sr/user.json index c4f7639e10..824efb8cc5 100644 --- a/public/language/sr/user.json +++ b/public/language/sr/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/sv/global.json b/public/language/sv/global.json index 992f2a32fe..50e107b718 100644 --- a/public/language/sv/global.json +++ b/public/language/sv/global.json @@ -96,5 +96,6 @@ "upload": "Ladda upp", "allowed-file-types": "Tillåtna filtyper är %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/sv/user.json b/public/language/sv/user.json index 03ba94fc00..74baf42d74 100644 --- a/public/language/sv/user.json +++ b/public/language/sv/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/th/global.json b/public/language/th/global.json index 09e26d956a..94080b0922 100644 --- a/public/language/th/global.json +++ b/public/language/th/global.json @@ -96,5 +96,6 @@ "upload": "Upload", "allowed-file-types": "Allowed file types are %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/th/user.json b/public/language/th/user.json index af15ad9890..41048b8c6a 100644 --- a/public/language/th/user.json +++ b/public/language/th/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/tr/global.json b/public/language/tr/global.json index 59c01ab819..647decf42f 100644 --- a/public/language/tr/global.json +++ b/public/language/tr/global.json @@ -96,5 +96,6 @@ "upload": "Yükle", "allowed-file-types": "İzin verilen dosya tipleri %1", "unsaved-changes": "Kaydedilmemiş değişiklikler var. Çıkmak istediğinize emin misiniz?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/tr/user.json b/public/language/tr/user.json index 62051c7ba3..4f39a0238e 100644 --- a/public/language/tr/user.json +++ b/public/language/tr/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Yasaklama süresi %1", "info.banned-permanently": "Kalıcı yasakla", "info.banned-reason-label": "Gerekçe", - "info.banned-no-reason": "Gerekçe belirtilmedi." + "info.banned-no-reason": "Gerekçe belirtilmedi.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/vi/global.json b/public/language/vi/global.json index 01890dcd33..5d16408aae 100644 --- a/public/language/vi/global.json +++ b/public/language/vi/global.json @@ -96,5 +96,6 @@ "upload": "Tải lên", "allowed-file-types": "Các định dạng file được cho phép là %1", "unsaved-changes": "You have unsaved changes. Are you sure you wish to navigate away?", - "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect." + "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", + "play": "Play" } \ No newline at end of file diff --git a/public/language/vi/user.json b/public/language/vi/user.json index 0d3666bbe7..55615761b0 100644 --- a/public/language/vi/user.json +++ b/public/language/vi/user.json @@ -121,5 +121,7 @@ "info.banned-until": "Banned until %1", "info.banned-permanently": "Banned permanently", "info.banned-reason-label": "Reason", - "info.banned-no-reason": "No reason given." + "info.banned-no-reason": "No reason given.", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/zh_CN/global.json b/public/language/zh_CN/global.json index 23a31f52a6..67baf99e9d 100644 --- a/public/language/zh_CN/global.json +++ b/public/language/zh_CN/global.json @@ -96,5 +96,6 @@ "upload": "上传", "allowed-file-types": "允许的文件类型有 %1", "unsaved-changes": "您有未保存的更改,您确定您要离开么?", - "reconnecting-message": "与 %1 的连接断开,我们正在尝试重连,请耐心等待" + "reconnecting-message": "与 %1 的连接断开,我们正在尝试重连,请耐心等待", + "play": "Play" } \ No newline at end of file diff --git a/public/language/zh_CN/user.json b/public/language/zh_CN/user.json index 4f61238f56..fac99339d1 100644 --- a/public/language/zh_CN/user.json +++ b/public/language/zh_CN/user.json @@ -121,5 +121,7 @@ "info.banned-until": "封禁到 %1", "info.banned-permanently": "永久封禁", "info.banned-reason-label": "原因", - "info.banned-no-reason": "没有原因" + "info.banned-no-reason": "没有原因", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file diff --git a/public/language/zh_TW/global.json b/public/language/zh_TW/global.json index 54a8ce2248..6c523cf698 100644 --- a/public/language/zh_TW/global.json +++ b/public/language/zh_TW/global.json @@ -96,5 +96,6 @@ "upload": "上傳", "allowed-file-types": "允許的檔案類型是 %1", "unsaved-changes": "你還沒有儲存更動。你確定想要離開這個頁面?", - "reconnecting-message": "看起來你的連線到 %1 已經遺失,請稍等一下我們嘗試重新連線。" + "reconnecting-message": "看起來你的連線到 %1 已經遺失,請稍等一下我們嘗試重新連線。", + "play": "Play" } \ No newline at end of file diff --git a/public/language/zh_TW/user.json b/public/language/zh_TW/user.json index 99e3adca75..d25b5fc25b 100644 --- a/public/language/zh_TW/user.json +++ b/public/language/zh_TW/user.json @@ -121,5 +121,7 @@ "info.banned-until": "禁用至 %1", "info.banned-permanently": "永久禁用", "info.banned-reason-label": "理由", - "info.banned-no-reason": "沒有給理由" + "info.banned-no-reason": "沒有給理由", + "info.username-history": "Username History", + "info.email-history": "Email History" } \ No newline at end of file From 13e624cc86a92f45fd3442b8043b1789873f2e41 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 21 Sep 2016 17:09:30 +0300 Subject: [PATCH 17/37] on login update lastonline --- src/controllers/authentication.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index ce2c652b6a..43707bfccd 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -322,6 +322,9 @@ authenticationController.onSuccessfulLogin = function(req, uid, callback) { }, function (next) { db.setObjectField('uid:' + uid + 'sessionUUID:sessionId', uuid, req.sessionID, next); + }, + function (next) { + user.updateLastOnlineTime(uid, next); } ], function(err) { if (err) { From 9256c8332ac75f5e3545c928a464434af25c3a4b Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 21 Sep 2016 21:07:52 +0300 Subject: [PATCH 18/37] get raw values for status and lastonline --- src/user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/user.js b/src/user.js index bc7b2a724c..f2060497ff 100644 --- a/src/user.js +++ b/src/user.js @@ -38,7 +38,7 @@ var utils = require('../public/src/utils'); User.updateLastOnlineTime = function(uid, callback) { callback = callback || function() {}; - User.getUserFields(uid, ['status', 'lastonline'], function(err, userData) { + db.getObjectFields('user:' + uid, ['status', 'lastonline'], function(err, userData) { var now = Date.now(); if (err || userData.status === 'offline' || now - parseInt(userData.lastonline, 10) < 300000) { return callback(err); From 930f3b28a5fe75508890854387d69063a3ac8228 Mon Sep 17 00:00:00 2001 From: NodeBB Misty Date: Thu, 22 Sep 2016 09:02:36 -0400 Subject: [PATCH 19/37] Latest translations and fallbacks --- public/language/fa_IR/error.json | 6 +++--- public/language/fa_IR/users.json | 6 +++--- public/language/fr/global.json | 2 +- public/language/fr/user.json | 4 ++-- public/language/sl/global.json | 2 +- public/language/sl/user.json | 12 ++++++------ 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/public/language/fa_IR/error.json b/public/language/fa_IR/error.json index 4426710bc8..497dcd049a 100644 --- a/public/language/fa_IR/error.json +++ b/public/language/fa_IR/error.json @@ -1,9 +1,9 @@ { "invalid-data": "داده(های) نامعتبر", - "not-logged-in": "وارد حساب کاربری نشده اید.", + "not-logged-in": "وارد حساب کاربری نشده‌اید.", "account-locked": "حساب کاربری شما موقتاً مسدود شده است.", - "search-requires-login": "استفاده از جستجو نیازمند ورود با نام کاربری و رمز عبور است. لطفا ابتدا وارد شوید.", - "invalid-cid": "شناسه دسته نامعتبر است.", + "search-requires-login": "استفاده از جستجو نیازمند ورود با نام‌کاربری و رمز‌عبور است. لطفا ابتدا وارد شوید.", + "invalid-cid": "آی‌دی دسته‌بندی نامعتبر است.", "invalid-tid": "شناسه موضوع نامعتبر است.", "invalid-pid": "شناسه پست نامعتبر است.", "invalid-uid": "شناسه کاربر نامعتبر است.", diff --git a/public/language/fa_IR/users.json b/public/language/fa_IR/users.json index 81b664bbb1..0e470d9fef 100644 --- a/public/language/fa_IR/users.json +++ b/public/language/fa_IR/users.json @@ -1,7 +1,7 @@ { "latest_users": "آخرین کاربران", "top_posters": "برترین فرستنده‌ها", - "most_reputation": "بیش‌ترین اعتبار", + "most_reputation": "بیشترین اعتبار", "most_flags": "بیشترین پرچم‌ها", "search": "جستجو", "enter_username": "یک نام کاربری برای جستجو وارد کنید", @@ -10,12 +10,12 @@ "filter-by": "فیلتر با", "online-only": "فقط آنلاین", "invite": "دعوت", - "invitation-email-sent": "ایمیل دعوتنامه برای %1 ارسال شد", + "invitation-email-sent": "رایانامه دعوت‌نامه برای %1 ارسال شد", "user_list": "فهرست کاربران", "recent_topics": "موضوع‌های اخیر", "popular_topics": "موضوع‌های پربازدید", "unread_topics": "موضوع‌های خوانده نشده", - "categories": "دسته‌ها", + "categories": "دسته‌بندی‌ها", "tags": "برچسب‌ها", "no-users-found": "کاربری پیدا نشد!" } \ No newline at end of file diff --git a/public/language/fr/global.json b/public/language/fr/global.json index d7136e0746..84d20f4319 100644 --- a/public/language/fr/global.json +++ b/public/language/fr/global.json @@ -97,5 +97,5 @@ "allowed-file-types": "Les types de fichiers autorisés sont : %1", "unsaved-changes": "Vous avez des modifications non sauvegardées. Êtes-vous sûr de vouloir naviguer tout de même ?", "reconnecting-message": "Il semble que votre connexion ait été perdue, veuillez patienter pendant que nous vous re-connectons.", - "play": "Play" + "play": "Lire" } \ No newline at end of file diff --git a/public/language/fr/user.json b/public/language/fr/user.json index 7b6a6c23eb..c6633441f3 100644 --- a/public/language/fr/user.json +++ b/public/language/fr/user.json @@ -122,6 +122,6 @@ "info.banned-permanently": "Banni de façon permanente", "info.banned-reason-label": "Raison", "info.banned-no-reason": "Aucune raison donnée", - "info.username-history": "Username History", - "info.email-history": "Email History" + "info.username-history": "Historique des noms d'utilisateur", + "info.email-history": "Historique des adresses email" } \ No newline at end of file diff --git a/public/language/sl/global.json b/public/language/sl/global.json index bdf0f36896..e1bd5970e0 100644 --- a/public/language/sl/global.json +++ b/public/language/sl/global.json @@ -51,7 +51,7 @@ "users": "Uporabniki", "topics": "Teme", "posts": "Objave", - "best": "Najbolše", + "best": "Najboljše", "upvoters": "Glasovalcev za", "upvoted": "Glasov za", "downvoters": "Glasovalcev proti", diff --git a/public/language/sl/user.json b/public/language/sl/user.json index 2162c5aab9..fedcef19fc 100644 --- a/public/language/sl/user.json +++ b/public/language/sl/user.json @@ -62,7 +62,7 @@ "upload_a_picture": "Naloži fotografijo", "remove_uploaded_picture": "Odstrani preneseno sliko ", "upload_cover_picture": "Prenesi fotografijo naslovnice", - "settings": "Nastavitve.", + "settings": "Nastavitve", "show_email": "Pokaži moj e-poštni naslov.", "show_fullname": "Pokaži moj ime in priimek.", "restrict_chats": "Dovoli klepet samo z osebami, ki jim sledim.", @@ -89,11 +89,11 @@ "topics_per_page": "Število tem na stran", "posts_per_page": "Število objav na stran", "notification_sounds": "Zvočno me opozori, ko prejmem obvestilo", - "notifications_and_sounds": "Notifications & Sounds", - "incoming-message-sound": "Incoming message sound", - "outgoing-message-sound": "Outgoing message sound", - "notification-sound": "Notification sound", - "no-sound": "No sound", + "notifications_and_sounds": "Obvestila in zvoki", + "incoming-message-sound": "Zvok za prejeto sporočilo", + "outgoing-message-sound": "Zvok za poslano sporočilo", + "notification-sound": "Zvok obvestila", + "no-sound": "Ni zvoka", "browsing": "Preglej nastavitve", "open_links_in_new_tab": "Zunanje povezave odpri v novem zavihku", "enable_topic_searching": "Omogoči iskanje znotraj teme", From a6c3be0bb1cc3900d291f1b73e93a7f3c44e2144 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 22 Sep 2016 18:21:49 +0300 Subject: [PATCH 20/37] store category recent tids for faster retrieval --- src/categories/recentreplies.js | 77 ++++++++++++++++----------------- src/categories/topics.js | 3 ++ src/topics/create.js | 3 ++ src/upgrade.js | 41 +++++++++++++++++- 4 files changed, 83 insertions(+), 41 deletions(-) diff --git a/src/categories/recentreplies.js b/src/categories/recentreplies.js index d9393c7c08..e7a1d0ba4e 100644 --- a/src/categories/recentreplies.js +++ b/src/categories/recentreplies.js @@ -32,6 +32,39 @@ module.exports = function(Categories) { ], callback); }; + Categories.updateRecentTid = function(cid, tid, callback) { + async.parallel({ + count: function(next) { + db.sortedSetCard('cid:' + cid + ':recent_tids', next); + }, + numRecentReplies: function(next) { + db.getObjectField('category:' + cid, 'numRecentReplies', next); + } + }, function(err, results) { + if (err) { + return callback(err); + } + + if (results.count < results.numRecentReplies) { + return db.sortedSetAdd('cid:' + cid + ':recent_tids', Date.now(), tid, callback); + } + async.waterfall([ + function(next) { + db.getSortedSetRangeWithScores('cid:' + cid + ':recent_tids', 0, results.count - results.numRecentReplies, next); + }, + function(data, next) { + if (!data.length) { + return next(); + } + db.sortedSetsRemoveRangeByScore(['cid:' + cid + ':recent_tids'], '-inf', data[data.length - 1].score, next); + }, + function(next) { + db.sortedSetAdd('cid:' + cid + ':recent_tids', Date.now(), tid, next); + } + ], callback); + }); + }; + Categories.getRecentTopicReplies = function(categoryData, uid, callback) { if (!Array.isArray(categoryData) || !categoryData.length) { return callback(); @@ -39,7 +72,10 @@ module.exports = function(Categories) { async.waterfall([ function(next) { - async.map(categoryData, getRecentTopicTids, next); + var keys = categoryData.map(function(category) { + return 'cid:' + category.cid + ':recent_tids'; + }); + db.getSortedSetsMembers(keys, next); }, function(results, next) { var tids = _.flatten(results); @@ -62,45 +98,6 @@ module.exports = function(Categories) { ], callback); }; - function getRecentTopicTids(category, callback) { - var count = parseInt(category.numRecentReplies, 10); - if (!count) { - return callback(null, []); - } - - if (count === 1) { - async.waterfall([ - function (next) { - db.getSortedSetRevRange('cid:' + category.cid + ':pids', 0, 0, next); - }, - function (pid, next) { - posts.getPostField(pid, 'tid', next); - }, - function (tid, next) { - next(null, [tid]); - } - ], callback); - return; - } - - async.parallel({ - pinnedTids: function(next) { - db.getSortedSetRevRangeByScore('cid:' + category.cid + ':tids', 0, -1, '+inf', Date.now(), next); - }, - tids: function(next) { - db.getSortedSetRevRangeByScore('cid:' + category.cid + ':tids', 0, Math.max(1, count), Date.now(), '-inf', next); - } - }, function(err, results) { - if (err) { - return callback(err); - } - - results.tids = results.tids.concat(results.pinnedTids); - - callback(null, results.tids); - }); - } - function getTopics(tids, callback) { var topicData; async.waterfall([ diff --git a/src/categories/topics.js b/src/categories/topics.js index 05b20668cf..b1a0bfae54 100644 --- a/src/categories/topics.js +++ b/src/categories/topics.js @@ -89,6 +89,9 @@ module.exports = function(Categories) { db.sortedSetAdd('cid:' + cid + ':tids', postData.timestamp, postData.tid, next); } }, + function(next){ + Categories.updateRecentTid(cid, postData.tid, next); + }, function(next) { db.sortedSetIncrBy('cid:' + cid + ':tids:posts', 1, postData.tid, next); } diff --git a/src/topics/create.js b/src/topics/create.js index db4976678c..85491a0643 100644 --- a/src/topics/create.js +++ b/src/topics/create.js @@ -63,6 +63,9 @@ module.exports = function(Topics) { 'cid:' + topicData.cid + ':uid:' + topicData.uid + ':tids' ], timestamp, topicData.tid, next); }, + function(next) { + categories.updateRecentTid(topicData.cid, topicData.tid, next); + }, function(next) { user.addTopicIdToUser(topicData.uid, topicData.tid, timestamp, next); }, diff --git a/src/upgrade.js b/src/upgrade.js index 317f1837da..c6fbe767e3 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -10,7 +10,7 @@ var db = require('./database'), schemaDate, thisSchemaDate, // IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema - latestSchema = Date.UTC(2016, 8, 7); + latestSchema = Date.UTC(2016, 8, 22); Upgrade.check = function(callback) { db.get('schemaDate', function(err, value) { @@ -811,6 +811,45 @@ Upgrade.upgrade = function(callback) { winston.info('[2016/08/07] Granting edit/delete/delete topic on existing categories - skipped!'); next(); } + }, + function(next) { + thisSchemaDate = Date.UTC(2016, 8, 22); + + if (schemaDate < thisSchemaDate) { + updatesMade = true; + winston.info('[2016/09/22] Setting category recent tids'); + + + db.getSortedSetRange('categories:cid', 0, -1, function(err, cids) { + if (err) { + return next(err); + } + + async.eachSeries(cids, function(cid, next) { + db.getSortedSetRevRange('cid:' + cid + ':pids', 0, 0, function(err, pid) { + if (err || !pid) { + return next(err); + } + db.getObjectFields('post:' + pid, ['tid', 'timestamp'], function(err, postData) { + if (err || !postData || !postData.tid) { + return next(err); + } + db.sortedSetAdd('cid:' + cid + ':recent_tids', postData.timestamp, postData.tid, next); + }); + }); + }, function(err) { + if (err) { + return next(err); + } + + winston.info('[2016/09/22] Setting category recent tids - done'); + Upgrade.update(thisSchemaDate, next); + }); + }); + } else { + winston.info('[2016/09/22] Setting category recent tids - skipped!'); + next(); + } } // Add new schema updates here // IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema IN LINE 24!!! From d1989babf55e78469dcca5c895d83a457287ff69 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 22 Sep 2016 20:00:39 +0300 Subject: [PATCH 21/37] closes #5044 --- src/controllers/accounts/chats.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/controllers/accounts/chats.js b/src/controllers/accounts/chats.js index c6ff2886c1..35eab94a83 100644 --- a/src/controllers/accounts/chats.js +++ b/src/controllers/accounts/chats.js @@ -15,14 +15,19 @@ chatsController.get = function(req, res, callback) { return callback(); } var uid; + var username; var recentChats; async.waterfall([ function(next) { - user.getUidByUserslug(req.params.userslug, next); + async.parallel({ + uid: async.apply(user.getUidByUserslug, req.params.userslug), + username: async.apply(user.getUsernameByUserslug, req.params.userslug) + }, next); }, - function(_uid, next) { - uid = _uid; + function(results, next) { + uid = results.uid; + username = results.username; if (!uid) { return callback(); } @@ -38,7 +43,7 @@ chatsController.get = function(req, res, callback) { nextStart: recentChats.nextStart, allowed: true, title: '[[pages:chats]]', - breadcrumbs: helpers.buildBreadcrumbs([{text: '[[pages:chats]]'}]) + breadcrumbs: helpers.buildBreadcrumbs([{text: username, url: '/user/' + req.params.userslug}, {text: '[[pages:chats]]'}]) }); } messaging.isUserInRoom(req.uid, req.params.roomid, next); @@ -75,7 +80,11 @@ chatsController.get = function(req, res, callback) { room.userslug = req.params.userslug; room.nextStart = recentChats.nextStart; room.title = room.roomName; - room.breadcrumbs = helpers.buildBreadcrumbs([{text: '[[pages:chats]]', url: '/chats'}, {text: room.roomName}]); + room.breadcrumbs = helpers.buildBreadcrumbs([ + {text: username, url: '/user/' + req.params.userslug}, + {text: '[[pages:chats]]', url: '/user/' + req.params.userslug + '/chats'}, + {text: room.roomName} + ]); room.maximumUsersInChatRoom = parseInt(meta.config.maximumUsersInChatRoom, 10) || 0; room.maximumChatMessageLength = parseInt(meta.config.maximumChatMessageLength, 10) || 1000; room.showUserInput = !room.maximumUsersInChatRoom || room.maximumUsersInChatRoom > 2; From c4f82a3f60a88c82eb539f27f0d0938544146060 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 23 Sep 2016 13:13:02 +0300 Subject: [PATCH 22/37] closes #5046 --- public/src/admin/admin.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/public/src/admin/admin.js b/public/src/admin/admin.js index 5647f8b2d7..4351f4eae3 100644 --- a/public/src/admin/admin.js +++ b/public/src/admin/admin.js @@ -1,5 +1,5 @@ "use strict"; -/*global config, componentHandler, define, socket, app, ajaxify, utils, bootbox, Slideout, NProgress, RELATIVE_PATH*/ +/*global config, componentHandler, socket, app, bootbox, Slideout, NProgress*/ (function() { var logoutTimer = 0; @@ -31,7 +31,7 @@ function showCorrectNavTab() { // show correct tab if url has # if (window.location.hash) { - $('.nav-pills a[href=' + window.location.hash + ']').tab('show'); + $('.nav-pills a[href="' + window.location.hash + '"]').tab('show'); } } @@ -52,8 +52,6 @@ }); $(window).on('action:ajaxify.contentLoaded', function(ev, data) { - var url = data.url; - selectMenuItem(data.url); setupRestartLinks(); @@ -65,7 +63,7 @@ NProgress.set(0.7); }); - $(window).on('action:ajaxify.end', function(ev, data) { + $(window).on('action:ajaxify.end', function() { NProgress.done(); }); } @@ -82,7 +80,7 @@ socket.emit('admin.restart'); }); - mousetrap.bind('/', function(event) { + mousetrap.bind('/', function() { $('#acp-search input').focus(); return false; From cd9e2d17a37fc19639b31c4ea4e06d14b2730cbe Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 23 Sep 2016 13:42:14 +0300 Subject: [PATCH 23/37] fix db.incrObjectFieldBy for mongo convert string to int --- src/database/mongo/hash.js | 4 +++- tests/database/hash.js | 12 ++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/database/mongo/hash.js b/src/database/mongo/hash.js index dbf294119e..585abea8b6 100644 --- a/src/database/mongo/hash.js +++ b/src/database/mongo/hash.js @@ -231,9 +231,11 @@ module.exports = function(db, module) { module.incrObjectFieldBy = function(key, field, value, callback) { callback = callback || helpers.noop; - if (!key) { + value = parseInt(value, 10); + if (!key || isNaN(value)) { return callback(); } + var data = {}; field = helpers.fieldToString(field); data[field] = value; diff --git a/tests/database/hash.js b/tests/database/hash.js index 7bcd23f5d8..8489669e92 100644 --- a/tests/database/hash.js +++ b/tests/database/hash.js @@ -347,7 +347,7 @@ describe('Hash methods', function() { it('should set an objects field to 5 if object does not exist', function(done) { db.incrObjectFieldBy('testObject16', 'field1', 5, function(err, newValue) { - assert.equal(err, null); + assert.ifError(err); assert.equal(arguments.length, 2); assert.equal(newValue, 5); done(); @@ -356,12 +356,20 @@ describe('Hash methods', function() { it('should increment an object fields by passed in value and return it', function(done) { db.incrObjectFieldBy('testObject15', 'age', 11, function(err, newValue) { - assert.equal(err, null); + assert.ifError(err); assert.equal(arguments.length, 2); assert.equal(newValue, 111); done(); }); }); + + it('should increment an object fields by passed in value and return it', function(done) { + db.incrObjectFieldBy('testObject15', 'age', '11', function(err, newValue) { + assert.ifError(err); + assert.equal(newValue, 122); + done(); + }); + }); }); From 574634109960e7daa609214e47e66d689327bc23 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 23 Sep 2016 17:06:19 +0300 Subject: [PATCH 24/37] closes #5048 --- src/socket.io/user/status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/socket.io/user/status.js b/src/socket.io/user/status.js index e3411ddbf3..4bcd2b0bc9 100644 --- a/src/socket.io/user/status.js +++ b/src/socket.io/user/status.js @@ -6,7 +6,7 @@ var websockets = require('../index'); module.exports = function(SocketUser) { SocketUser.checkStatus = function(socket, uid, callback) { if (!socket.uid) { - return callback('[[error:invalid-uid]]'); + return callback(new Error('[[error:invalid-uid]]')); } user.getUserFields(uid, ['lastonline', 'status'], function(err, userData) { From ff29d0e826d0e2d696ead8e5a824fa7d0eab5c2f Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sat, 24 Sep 2016 14:35:56 +0300 Subject: [PATCH 25/37] closes #4290 --- package.json | 4 +- public/src/client/topic/delete-posts.js | 50 ++++++++++--------------- 2 files changed, 21 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index ec9c793eb6..d1a4724a42 100644 --- a/package.json +++ b/package.json @@ -61,8 +61,8 @@ "nodebb-plugin-spam-be-gone": "0.4.10", "nodebb-rewards-essentials": "0.0.9", "nodebb-theme-lavender": "3.0.14", - "nodebb-theme-persona": "4.1.48", - "nodebb-theme-vanilla": "5.1.32", + "nodebb-theme-persona": "4.1.49", + "nodebb-theme-vanilla": "5.1.33", "nodebb-widget-essentials": "2.0.11", "nodemailer": "2.0.0", "nodemailer-sendmail-transport": "1.0.0", diff --git a/public/src/client/topic/delete-posts.js b/public/src/client/topic/delete-posts.js index a40ef3dbc5..bae1614edd 100644 --- a/public/src/client/topic/delete-posts.js +++ b/public/src/client/topic/delete-posts.js @@ -1,31 +1,33 @@ 'use strict'; -/* globals define, app, ajaxify, socket, templates */ +/* globals define, app, ajaxify, socket */ -define('forum/topic/delete-posts', ['components', 'postSelect', 'translator'], function(components, postSelect, translator) { +define('forum/topic/delete-posts', ['components', 'postSelect'], function(components, postSelect) { - var DeletePosts = {}, - modal, - deleteBtn, - purgeBtn; + var DeletePosts = {}; + var modal; + var deleteBtn; + var purgeBtn; DeletePosts.init = function() { $('.topic').on('click', '[component="topic/delete/posts"]', onDeletePostsClicked); + $(window).on('action:ajaxify.start', onAjaxifyStart); }; - function onDeletePostsClicked() { - parseModal(function(html) { - modal = $(html); + function onAjaxifyStart() { + closeModal(); + $(window).off('action:ajaxify.start', onAjaxifyStart); + } - modal.on('hidden.bs.modal', function() { - modal.remove(); - }); + function onDeletePostsClicked() { + app.parseAndTranslate('partials/delete_posts_modal', {}, function(html) { + modal = html; + + $('body').append(modal); deleteBtn = modal.find('#delete_posts_confirm'); purgeBtn = modal.find('#purge_posts_confirm'); - showModal(); - modal.find('.close,#delete_posts_cancel').on('click', closeModal); postSelect.init(function() { @@ -43,20 +45,6 @@ define('forum/topic/delete-posts', ['components', 'postSelect', 'translator'], f }); } - function parseModal(callback) { - templates.parse('partials/delete_posts_modal', {}, function(html) { - translator.translate(html, callback); - }); - } - - function showModal() { - modal.modal({backdrop: false, show: true}) - .css('position', 'fixed') - .css('left', Math.max(0, (($(window).width() - modal.outerWidth()) / 2) + $(window).scrollLeft()) + 'px') - .css('top', '0px') - .css('z-index', '2000'); - } - function deletePosts(btn, command) { btn.attr('disabled', true); socket.emit(command, { @@ -74,7 +62,7 @@ define('forum/topic/delete-posts', ['components', 'postSelect', 'translator'], f function showPostsSelected() { if (postSelect.pids.length) { - modal.find('#pids').text(postSelect.pids.join(', ')); + modal.find('#pids').translateHtml('[[topic:fork_pid_count, ' + postSelect.pids.length + ']]'); } else { modal.find('#pids').translateHtml('[[topic:fork_no_pids]]'); } @@ -92,10 +80,10 @@ define('forum/topic/delete-posts', ['components', 'postSelect', 'translator'], f function closeModal() { postSelect.pids.forEach(function(pid) { - components.get('post', 'pid', pid).css('opacity', 1); + components.get('post', 'pid', pid).toggleClass('bg-success', false); }); - modal.modal('hide'); + modal.remove(); components.get('topic').off('click', '[data-pid]'); postSelect.enableClicksOnPosts(); From a04a80b15ae42e7209633ca5b5f39815b45dbafc Mon Sep 17 00:00:00 2001 From: NodeBB Misty Date: Sun, 25 Sep 2016 09:02:31 -0400 Subject: [PATCH 26/37] Latest translations and fallbacks --- public/language/pl/error.json | 2 +- public/language/pl/global.json | 2 +- public/language/pl/topic.json | 2 +- public/language/pl/user.json | 6 +++--- public/language/sl/tags.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/public/language/pl/error.json b/public/language/pl/error.json index 9e2e24f64d..b865879460 100644 --- a/public/language/pl/error.json +++ b/public/language/pl/error.json @@ -29,7 +29,7 @@ "username-too-long": "Zbyt długa nazwa użytkownika", "password-too-long": "Hasło jest za długie", "user-banned": "Użytkownik zbanowany", - "user-banned-reason": "User banned (Reason: %1)", + "user-banned-reason": "Użytkownik zbanowany (powód: %1)", "user-too-new": "Przepraszamy, musisz odczekać %1 sekund(y) przed utworzeniem pierwszego posta", "blacklisted-ip": "Twój adres IP został zablokowany na tej społeczności. Jeśli uważasz to za błąd, zgłoś to administratorowi", "ban-expiry-missing": "Wprowadź datę końca blokady", diff --git a/public/language/pl/global.json b/public/language/pl/global.json index a4c47504b7..cccd6705d6 100644 --- a/public/language/pl/global.json +++ b/public/language/pl/global.json @@ -97,5 +97,5 @@ "allowed-file-types": "Dozwolone typy plików %1", "unsaved-changes": "Posiadasz niezapisane zmiany. Jesteś pewien, że chcesz opuścić stronę?", "reconnecting-message": "Wygląda na to, że Twoje połączenie z %1 zostało przerwane. Proszę czekać gdy staramy się je odnowić.", - "play": "Play" + "play": "Odtwórz" } \ No newline at end of file diff --git a/public/language/pl/topic.json b/public/language/pl/topic.json index dc5ec1e37c..cf2c18fbe3 100644 --- a/public/language/pl/topic.json +++ b/public/language/pl/topic.json @@ -51,7 +51,7 @@ "not-watching.description": "Nie informuj mnie o nowych odpowiedziach
Pokaż temat w nieprzeczytanych, jeśli kategoria nie jest ignorowana.", "ignoring.description": "Nie informuj mnie o nowych odpowiedziach
Nie pokazuj tematu w nieprzeczytanych.", "thread_tools.title": "Narzędzia Tematu", - "thread_tools.markAsUnreadForAll": "Mark unread for all", + "thread_tools.markAsUnreadForAll": "Zaznacz wszystkie jako nieprzeczytane", "thread_tools.pin": "Przypnij Temat", "thread_tools.unpin": "Odepnij Temat", "thread_tools.lock": "Zablokuj Temat", diff --git a/public/language/pl/user.json b/public/language/pl/user.json index 9bc08bc656..0fc4ba0af9 100644 --- a/public/language/pl/user.json +++ b/public/language/pl/user.json @@ -93,7 +93,7 @@ "incoming-message-sound": "Dźwięk przychodzącej wiadomości", "outgoing-message-sound": "Dźwięk wychodzącej wiadomości", "notification-sound": "Dźwięk powiadomienia", - "no-sound": "No sound", + "no-sound": "Bez dźwięku", "browsing": "Ustawienia szukania", "open_links_in_new_tab": "Otwieraj linki wychodzące w nowej karcie", "enable_topic_searching": "Odblokuj szukanie w temacie", @@ -122,6 +122,6 @@ "info.banned-permanently": "Zbanowany permanentnie", "info.banned-reason-label": "Powód", "info.banned-no-reason": "Nie podano powodu.", - "info.username-history": "Username History", - "info.email-history": "Email History" + "info.username-history": "Historia nazwy użytkownika", + "info.email-history": "Historia adresu e-mail" } \ No newline at end of file diff --git a/public/language/sl/tags.json b/public/language/sl/tags.json index df2187edd8..90d0a74dc2 100644 --- a/public/language/sl/tags.json +++ b/public/language/sl/tags.json @@ -1,7 +1,7 @@ { "no_tag_topics": "Ni novih tem s to oznako.", "tags": "Oznake", - "enter_tags_here": "Tu vpišite oznake. Dovoljeno število znakov: najmaj %1 in največ 2%.", + "enter_tags_here": "Tu vpišite oznake. Dovoljeno število znakov: najmaj %1 in največ %2.", "enter_tags_here_short": "Vpišite oznake...", "no_tags": "Oznak še ni." } \ No newline at end of file From 1866f93e9c2f523d0d22f999582180b9390e4d49 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 26 Sep 2016 15:37:08 +0300 Subject: [PATCH 27/37] closes #5045 --- public/src/modules/translator.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/src/modules/translator.js b/public/src/modules/translator.js index e801d9d796..f0fc980666 100644 --- a/public/src/modules/translator.js +++ b/public/src/modules/translator.js @@ -183,6 +183,10 @@ var namespace = result[0]; var key = result[1]; + if (namespace && !key) { + return Promise.resolve('[[' + namespace + ']]'); + } + var translation = this.getTranslation(namespace, key); var argsToTranslate = args.map(function (arg) { return string(arg).collapseWhitespace().decodeHTMLEntities().escapeHTML().s; From 4b14be80e378348b58a3fb1ab4802bdb01170424 Mon Sep 17 00:00:00 2001 From: NodeBB Misty Date: Mon, 26 Sep 2016 09:02:32 -0400 Subject: [PATCH 28/37] Latest translations and fallbacks --- public/language/tr/global.json | 2 +- public/language/tr/user.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/language/tr/global.json b/public/language/tr/global.json index 647decf42f..98c65856b4 100644 --- a/public/language/tr/global.json +++ b/public/language/tr/global.json @@ -97,5 +97,5 @@ "allowed-file-types": "İzin verilen dosya tipleri %1", "unsaved-changes": "Kaydedilmemiş değişiklikler var. Çıkmak istediğinize emin misiniz?", "reconnecting-message": "Looks like your connection to %1 was lost, please wait while we try to reconnect.", - "play": "Play" + "play": "Oynat" } \ No newline at end of file diff --git a/public/language/tr/user.json b/public/language/tr/user.json index 4f39a0238e..1d7b966ecb 100644 --- a/public/language/tr/user.json +++ b/public/language/tr/user.json @@ -122,6 +122,6 @@ "info.banned-permanently": "Kalıcı yasakla", "info.banned-reason-label": "Gerekçe", "info.banned-no-reason": "Gerekçe belirtilmedi.", - "info.username-history": "Username History", - "info.email-history": "Email History" + "info.username-history": "Kullanıcı Adı Geçmişi", + "info.email-history": "Email Geçmişi" } \ No newline at end of file From 8326846c2fbbb7a4d11663ba53c36cabd3eca265 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 26 Sep 2016 16:55:38 +0300 Subject: [PATCH 29/37] closes #5043 --- package.json | 2 +- public/language/en_GB/groups.json | 4 ++- public/src/client/groups/details.js | 50 ++++++++++++++++++++--------- src/socket.io/groups.js | 22 +++++++++++++ 4 files changed, 60 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index d1a4724a42..fb117469dd 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "nodebb-plugin-spam-be-gone": "0.4.10", "nodebb-rewards-essentials": "0.0.9", "nodebb-theme-lavender": "3.0.14", - "nodebb-theme-persona": "4.1.49", + "nodebb-theme-persona": "4.1.50", "nodebb-theme-vanilla": "5.1.33", "nodebb-widget-essentials": "2.0.11", "nodemailer": "2.0.0", diff --git a/public/language/en_GB/groups.json b/public/language/en_GB/groups.json index 8d129fe376..2efc9a69fc 100644 --- a/public/language/en_GB/groups.json +++ b/public/language/en_GB/groups.json @@ -59,5 +59,7 @@ "membership.reject": "Reject", "new-group.group_name": "Group Name:", - "upload-group-cover": "Upload group cover" + "upload-group-cover": "Upload group cover", + "bulk-invite-instructions": "Enter a list of comma separated usernames to invite to this group", + "bulk-invite": "Bulk Invite" } \ No newline at end of file diff --git a/public/src/client/groups/details.js b/public/src/client/groups/details.js index f71b37886e..d2f1cfbd8d 100644 --- a/public/src/client/groups/details.js +++ b/public/src/client/groups/details.js @@ -1,5 +1,5 @@ "use strict"; -/* globals define, socket, ajaxify, app, bootbox, utils, RELATIVE_PATH */ +/* globals define, socket, ajaxify, app, bootbox, utils, config */ define('forum/groups/details', [ 'forum/groups/memberlist', @@ -227,23 +227,41 @@ define('forum/groups/details', [ }; function handleMemberInvitations() { - if (ajaxify.data.group.isOwner) { - var searchInput = $('[component="groups/members/invite"]'); - require(['autocomplete'], function(autocomplete) { - autocomplete.user(searchInput, function(event, selected) { - socket.emit('groups.issueInvite', { - toUid: selected.item.user.uid, - groupName: ajaxify.data.group.name - }, function(err) { - if (!err) { - ajaxify.refresh(); - } else { - app.alertError(err.message); - } - }); + if (!ajaxify.data.group.isOwner) { + return; + } + + var searchInput = $('[component="groups/members/invite"]'); + require(['autocomplete'], function(autocomplete) { + autocomplete.user(searchInput, function(event, selected) { + socket.emit('groups.issueInvite', { + toUid: selected.item.user.uid, + groupName: ajaxify.data.group.name + }, function(err) { + if (err) { + return app.alertError(err.message); + } + ajaxify.refresh(); }); }); - } + }); + + $('[component="groups/members/bulk-invite-button"]').on('click', function() { + var usernames = $('[component="groups/members/bulk-invite"]').val(); + if (!usernames) { + return false; + } + socket.emit('groups.issueMassInvite', { + usernames: usernames, + groupName: ajaxify.data.group.name + }, function(err) { + if (err) { + return app.alertError(err.message); + } + ajaxify.refresh(); + }); + return false; + }); } function removeCover() { diff --git a/src/socket.io/groups.js b/src/socket.io/groups.js index 5df97f80f5..41de928b51 100644 --- a/src/socket.io/groups.js +++ b/src/socket.io/groups.js @@ -135,6 +135,28 @@ SocketGroups.issueInvite = isOwner(function(socket, data, callback) { groups.invite(data.groupName, data.toUid, callback); }); +SocketGroups.issueMassInvite = isOwner(function(socket, data, callback) { + if (!data || !data.usernames || !data.groupName) { + return callback(new Error('[[error:invalid-data]]')); + } + var usernames = data.usernames.split(','); + usernames = usernames.map(function(username) { + return username && username.trim(); + }); + user.getUidsByUsernames(usernames, function(err, uids) { + if (err) { + return callback(err); + } + uids = uids.filter(function(uid) { + return !!uid && parseInt(uid, 10); + }); + + async.eachSeries(uids, function(uid, next) { + groups.invite(data.groupName, uid, callback); + }, callback); + }); +}); + SocketGroups.rescindInvite = isOwner(function(socket, data, callback) { groups.rejectMembership(data.groupName, data.toUid, callback); }); From 42a8346d2d0eabb12c8a9ac9650fabf03b841a57 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 26 Sep 2016 17:00:47 +0300 Subject: [PATCH 30/37] closes #5051 --- src/controllers/unread.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/unread.js b/src/controllers/unread.js index c610b91723..4f0b40bf38 100644 --- a/src/controllers/unread.js +++ b/src/controllers/unread.js @@ -3,6 +3,7 @@ var async = require('async'); var querystring = require('querystring'); +var validator = require('validator'); var categories = require('../categories'); var privileges = require('../privileges'); @@ -18,7 +19,7 @@ var validFilter = {'': true, 'new': true, 'watched': true}; unreadController.get = function(req, res, next) { var page = parseInt(req.query.page, 10) || 1; var results; - var cid = req.query.cid; + var cid = validator.escape(String(req.query.cid)); var filter = req.params.filter || ''; if (!validFilter[filter]) { @@ -85,7 +86,7 @@ unreadController.get = function(req, res, next) { return filter && filter.selected; })[0]; - data.querystring = req.query.cid ? ('?cid=' + req.query.cid) : ''; + data.querystring = cid ? ('?cid=' + cid) : ''; res.render('unread', data); }); From f4649668178bca8af6444eb6cc24ff92f35de921 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 26 Sep 2016 17:04:43 +0300 Subject: [PATCH 31/37] closes #5053 --- src/controllers/admin/flags.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controllers/admin/flags.js b/src/controllers/admin/flags.js index 75a82d1e55..bed5c57767 100644 --- a/src/controllers/admin/flags.js +++ b/src/controllers/admin/flags.js @@ -1,6 +1,8 @@ "use strict"; var async = require('async'); +var validator = require('validator'); + var posts = require('../../posts'); var user = require('../../user'); var categories = require('../../categories'); @@ -54,7 +56,7 @@ flagsController.get = function(req, res, next) { assignees: results.assignees, analytics: results.analytics, categories: results.categories, - byUsername: byUsername, + byUsername: validator(String(byUsername)), sortByCount: sortBy === 'count', sortByTime: sortBy === 'time', pagination: pagination.create(page, pageCount, req.query), From 6540b07ab2b102f9fe208aeff6df07cc84d49d1c Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 26 Sep 2016 17:09:26 +0300 Subject: [PATCH 32/37] closes #5052 --- src/controllers/accounts/helpers.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/controllers/accounts/helpers.js b/src/controllers/accounts/helpers.js index 749eca5de8..3d9b2a9a1e 100644 --- a/src/controllers/accounts/helpers.js +++ b/src/controllers/accounts/helpers.js @@ -119,6 +119,7 @@ helpers.getUserDataByUserSlug = function(userslug, callerUID, callback) { userData.location = validator.escape(String(userData.location || '')); userData.signature = validator.escape(String(userData.signature || '')); userData.aboutme = validator.escape(String(userData.aboutme || '')); + userData.birthday = validator.escape(String(userData.birthday || '')); userData['cover:url'] = userData['cover:url'] || require('../../coverPhoto').getDefaultProfileCover(userData.uid); userData['cover:position'] = userData['cover:position'] || '50% 50%'; From ae6305365e83453ffee4a1e9243a0d252e7499c3 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 26 Sep 2016 17:21:08 +0300 Subject: [PATCH 33/37] dont set search term from localstorage --- public/src/client/search.js | 44 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/public/src/client/search.js b/public/src/client/search.js index b9632513bc..91839ff880 100644 --- a/public/src/client/search.js +++ b/public/src/client/search.js @@ -63,49 +63,49 @@ define('forum/search', ['search', 'autocomplete'], function(searchModule, autoco function fillOutForm() { var params = utils.params(); var searchData = searchModule.getSearchPreferences(); - params = utils.merge(searchData, params); + var formData = utils.merge(searchData, params); - if (params) { + if (formData) { if (params.term) { $('#search-input').val(params.term); } - if (params.in) { - $('#search-in').val(params.in); - updateFormItemVisiblity(params.in); + if (formData.in) { + $('#search-in').val(formData.in); + updateFormItemVisiblity(formData.in); } - if (params.by) { - $('#posted-by-user').val(params.by); + if (formData.by) { + $('#posted-by-user').val(formData.by); } - if (params.categories) { - $('#posted-in-categories').val(params.categories); + if (formData.categories) { + $('#posted-in-categories').val(formData.categories); } - if (params.searchChildren) { + if (formData.searchChildren) { $('#search-children').prop('checked', true); } - if (params.replies) { - $('#reply-count').val(params.replies); - $('#reply-count-filter').val(params.repliesFilter); + if (formData.replies) { + $('#reply-count').val(formData.replies); + $('#reply-count-filter').val(formData.repliesFilter); } - if (params.timeRange) { - $('#post-time-range').val(params.timeRange); - $('#post-time-filter').val(params.timeFilter); + if (formData.timeRange) { + $('#post-time-range').val(formData.timeRange); + $('#post-time-filter').val(formData.timeFilter); } - if (params.sortBy) { - $('#post-sort-by').val(params.sortBy); - $('#post-sort-direction').val(params.sortDirection); + if (formData.sortBy) { + $('#post-sort-by').val(formData.sortBy); + $('#post-sort-direction').val(formData.sortDirection); } - if (params.showAs) { - var isTopic = params.showAs === 'topics'; - var isPost = params.showAs === 'posts'; + if (formData.showAs) { + var isTopic = formData.showAs === 'topics'; + var isPost = formData.showAs === 'posts'; $('#show-as-topics').prop('checked', isTopic).parent().toggleClass('active', isTopic); $('#show-as-posts').prop('checked', isPost).parent().toggleClass('active', isPost); } From 2704727cafb41123d49d801083331ce0e1c70258 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 26 Sep 2016 18:42:01 +0300 Subject: [PATCH 34/37] fix /unread --- src/controllers/unread.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/unread.js b/src/controllers/unread.js index 4f0b40bf38..8860f541d9 100644 --- a/src/controllers/unread.js +++ b/src/controllers/unread.js @@ -19,7 +19,7 @@ var validFilter = {'': true, 'new': true, 'watched': true}; unreadController.get = function(req, res, next) { var page = parseInt(req.query.page, 10) || 1; var results; - var cid = validator.escape(String(req.query.cid)); + var cid = req.query.cid; var filter = req.params.filter || ''; if (!validFilter[filter]) { @@ -86,7 +86,7 @@ unreadController.get = function(req, res, next) { return filter && filter.selected; })[0]; - data.querystring = cid ? ('?cid=' + cid) : ''; + data.querystring = cid ? ('?cid=' + validator.escape(String(cid))) : ''; res.render('unread', data); }); From 1ec5539adc9d45659bd301550f3ed227be8055a4 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 26 Sep 2016 21:13:55 +0300 Subject: [PATCH 35/37] closes #5055 --- public/src/client/topic/delete-posts.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/src/client/topic/delete-posts.js b/public/src/client/topic/delete-posts.js index bae1614edd..8c114679c4 100644 --- a/public/src/client/topic/delete-posts.js +++ b/public/src/client/topic/delete-posts.js @@ -83,7 +83,10 @@ define('forum/topic/delete-posts', ['components', 'postSelect'], function(compon components.get('post', 'pid', pid).toggleClass('bg-success', false); }); - modal.remove(); + if (modal) { + modal.remove(); + modal = null; + } components.get('topic').off('click', '[data-pid]'); postSelect.enableClicksOnPosts(); From c50486b47d644b762dade1b7957c6f732c61d62f Mon Sep 17 00:00:00 2001 From: Anil Mandepudi Date: Mon, 26 Sep 2016 11:45:32 -0700 Subject: [PATCH 36/37] Fix [socket.io] Unrecognized message: admin.reload --- src/socket.io/admin.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/socket.io/admin.js b/src/socket.io/admin.js index c599abf491..4f224f48fd 100644 --- a/src/socket.io/admin.js +++ b/src/socket.io/admin.js @@ -49,11 +49,6 @@ SocketAdmin.before = function(socket, method, data, next) { }); }; -/** - * Reload deprecated as of v1.1.2+, remove in v2.x - */ -SocketAdmin.reload = SocketAdmin.restart; - SocketAdmin.restart = function(socket, data, callback) { events.log({ type: 'restart', @@ -64,6 +59,11 @@ SocketAdmin.restart = function(socket, data, callback) { callback(); }; +/** + * Reload deprecated as of v1.1.2+, remove in v2.x + */ +SocketAdmin.reload = SocketAdmin.restart; + SocketAdmin.fireEvent = function(socket, data, callback) { index.server.emit(data.name, data.payload || {}); callback(); From 9f2533b5ba00c6c0be8995406203197f16585329 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 26 Sep 2016 22:01:47 +0300 Subject: [PATCH 37/37] closes #5054 --- src/controllers/accounts/chats.js | 18 +++++++++++++++++- src/routes/accounts.js | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/controllers/accounts/chats.js b/src/controllers/accounts/chats.js index 35eab94a83..7ff867134c 100644 --- a/src/controllers/accounts/chats.js +++ b/src/controllers/accounts/chats.js @@ -7,7 +7,6 @@ var meta = require('../../meta'); var user = require('../../user'); var helpers = require('../helpers'); - var chatsController = {}; chatsController.get = function(req, res, callback) { @@ -93,6 +92,23 @@ chatsController.get = function(req, res, callback) { }); }; +chatsController.redirectToChat = function(req, res, next) { + var roomid = parseInt(req.params.roomid, 10); + if (!req.uid) { + return next(); + } + user.getUserField(req.uid, 'userslug', function(err, userslug) { + if (err || !userslug) { + return next(err); + } + + if (!roomid) { + return helpers.redirect(res, '/user/' + userslug + '/chats'); + } + helpers.redirect(res, '/user/' + userslug + '/chats/' + roomid); + }); +}; + module.exports = chatsController; \ No newline at end of file diff --git a/src/routes/accounts.js b/src/routes/accounts.js index d74316f816..9d17b8f86a 100644 --- a/src/routes/accounts.js +++ b/src/routes/accounts.js @@ -32,4 +32,5 @@ module.exports = function (app, middleware, controllers) { setupPageRoute(app, '/notifications', middleware, [middleware.authenticate], controllers.accounts.notifications.get); setupPageRoute(app, '/user/:userslug/chats/:roomid?', middleware, accountMiddlewares, controllers.accounts.chats.get); + setupPageRoute(app, '/chats/:roomid?', middleware, [], controllers.accounts.chats.redirectToChat); };