Skip to content

Node.js based forum software built for the modern web

Revert "feat: newsletter opt-in/out in UCP, closes #21"

Julian Lamcc275e101613
diff --git a/src/controllers/accounts/settings.js b/src/controllers/accounts/settings.js
index de9bfffed1..8d561bc976 100644
--- a/src/controllers/accounts/settings.js
+++ b/src/controllers/accounts/settings.js
@@ -33,13 +33,11 @@ settingsController.get = async function (req, res, next) {
userData.acpLanguages = _.cloneDeep(languagesData);
}
- console.log('dorp');
const data = await plugins.hooks.fire('filter:user.customSettings', {
settings: settings,
customSettings: [],
uid: req.uid,
});
- console.log(data.customSettings);
const [notificationSettings, routes] = await Promise.all([
getNotificationSettings(userData),
diff --git a/src/user/notifications.js b/src/user/notifications.js
index a6116c3cb1..ad9175cab0 100644
--- a/src/user/notifications.js
+++ b/src/user/notifications.js
@@ -24,12 +24,10 @@ UserNotifications.get = async function (uid) {
if (unread.length < 30) {
read = await getNotificationsFromSet(`uid:${uid}:notifications:read`, uid, 0, 29 - unread.length);
}
-
- return await plugins.hooks.fire('filter:user.notifications.get', {
- uid,
+ return {
read: read.filter(Boolean),
unread: unread,
- });
+ };
};
async function filterNotifications(nids, filter) {
@@ -135,7 +133,7 @@ UserNotifications.getUnreadCount = async function (uid) {
const mergeIds = notifData.map(n => n.mergeId);
// Collapse any notifications with identical mergeIds
- let count = mergeIds.reduce((count, mergeId, idx, arr) => {
+ return mergeIds.reduce((count, mergeId, idx, arr) => {
// A missing (null) mergeId means that notification is counted separately.
if (mergeId === null || idx === arr.indexOf(mergeId)) {
count += 1;
@@ -143,9 +141,6 @@ UserNotifications.getUnreadCount = async function (uid) {
return count;
}, 0);
-
- ({ count } = await plugins.hooks.fire('filter:user.notifications.getCount', { uid, count }));
- return count;
};
UserNotifications.getUnreadByField = async function (uid, field, values) {