Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit fdd93709 authored by echicken's avatar echicken 🐔

Removed some unused stuff.

Require authentication for unread-counts; guests don't need this.
parent fbdcd2de
...@@ -23,6 +23,18 @@ if (http_request.query.call !== undefined && (http_request.method === 'GET' || h ...@@ -23,6 +23,18 @@ if (http_request.query.call !== undefined && (http_request.method === 'GET' || h
switch(http_request.query.call[0].toLowerCase()) { switch(http_request.query.call[0].toLowerCase()) {
// Unread message counts for every sub in a group
case 'get-sub-unread-counts':
if (typeof http_request.query.group !== 'undefined' && msg_area.grp_list[http_request.query.group[0]]) {
reply = getSubUnreadCounts(http_request.query.group[0]);
}
break;
// Unread message counts for all groups user has access to
case 'get-group-unread-counts':
reply = getGroupUnreadCounts();
break;
case 'get-mail-unread-count': case 'get-mail-unread-count':
reply.count = user.stats.mail_waiting; reply.count = user.stats.mail_waiting;
break; break;
...@@ -227,34 +239,6 @@ if (http_request.query.call !== undefined && (http_request.method === 'GET' || h ...@@ -227,34 +239,6 @@ if (http_request.query.call !== undefined && (http_request.method === 'GET' || h
} }
break; break;
case 'get-group-unread-count':
if (typeof http_request.query.group !== 'undefined') {
http_request.query.group.forEach(function(group) {
reply[group] = getGroupUnreadCount(group);
});
}
break;
case 'get-sub-unread-count':
if (typeof http_request.query.sub !== 'undefined') {
http_request.query.sub.forEach(function(sub) {
reply[sub] = getSubUnreadCount(sub);
});
}
break;
// Unread message counts for every sub in a group
case 'get-sub-unread-counts':
if (typeof http_request.query.group !== 'undefined' && msg_area.grp_list[http_request.query.group[0]]) {
reply = getSubUnreadCounts(http_request.query.group[0]);
}
break;
// Unread message counts for all groups user has access to
case 'get-group-unread-counts':
reply = getGroupUnreadCounts();
break;
default: default:
break; break;
......
...@@ -269,12 +269,6 @@ function onSubUnreadCount(data) { ...@@ -269,12 +269,6 @@ function onSubUnreadCount(data) {
} }
} }
// 'sub' can be a single sub code, or a string of <sub1>&sub=<sub2>&sub=<sub3>...
async function getSubUnreadCount(sub) {
const res = await v4_get('./api/forum.ssjs?call=get-sub-unread-count&sub=' + sub);
onSubUnreadCount(res);
}
async function getSubUnreadCounts(grp) { async function getSubUnreadCounts(grp) {
const res = await v4_get('./api/forum.ssjs?call=get-sub-unread-counts&group=' + grp); const res = await v4_get('./api/forum.ssjs?call=get-sub-unread-counts&group=' + grp);
onSubUnreadCount(res); onSubUnreadCount(res);
...@@ -293,12 +287,6 @@ function onGroupUnreadCount(data) { ...@@ -293,12 +287,6 @@ function onGroupUnreadCount(data) {
} }
} }
// 'group' can be a single group index, or a string of 0&group=1&group=2...
async function getGroupUnreadCount(group) {
const res = await v4_get('./api/forum.ssjs?call=get-group-unread-count&group=' + group);
onGroupUnreadCount(res);
}
async function getGroupUnreadCounts() { async function getGroupUnreadCounts() {
const res = await v4_get('./api/forum.ssjs?call=get-group-unread-counts'); const res = await v4_get('./api/forum.ssjs?call=get-group-unread-counts');
onGroupUnreadCount(res); onGroupUnreadCount(res);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment