Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
6107a806
Commit
6107a806
authored
4 years ago
by
echicken
Browse files
Options
Downloads
Patches
Plain Diff
Removed some unused stuff.
Require authentication for unread-counts; guests don't need this.
parent
03146847
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
webv4/root/api/forum.ssjs
+12
-28
12 additions, 28 deletions
webv4/root/api/forum.ssjs
webv4/root/js/forum.js
+0
-12
0 additions, 12 deletions
webv4/root/js/forum.js
with
12 additions
and
40 deletions
webv4/root/api/forum.ssjs
+
12
−
28
View file @
6107a806
...
...
@@ -23,6 +23,18 @@ if (http_request.query.call !== undefined && (http_request.method === 'GET' || h
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
'
:
reply
.
count
=
user
.
stats
.
mail_waiting
;
break
;
...
...
@@ -227,34 +239,6 @@ if (http_request.query.call !== undefined && (http_request.method === 'GET' || h
}
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
:
break
;
...
...
This diff is collapsed.
Click to expand it.
webv4/root/js/forum.js
+
0
−
12
View file @
6107a806
...
...
@@ -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
)
{
const
res
=
await
v4_get
(
'
./api/forum.ssjs?call=get-sub-unread-counts&group=
'
+
grp
);
onSubUnreadCount
(
res
);
...
...
@@ -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
()
{
const
res
=
await
v4_get
(
'
./api/forum.ssjs?call=get-group-unread-counts
'
);
onGroupUnreadCount
(
res
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment