Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
f8ae908d
Commit
f8ae908d
authored
Sep 18, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement message for locked groups.
parent
e824b935
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
11 deletions
+25
-11
README
README
+1
-1
group/group.go
group/group.go
+19
-7
rtpconn/webclient.go
rtpconn/webclient.go
+1
-1
static/protocol.js
static/protocol.js
+3
-1
static/sfu.js
static/sfu.js
+1
-1
No files found.
README
View file @
f8ae908d
...
...
@@ -114,7 +114,7 @@ The following commands are only available to users with operator
privileges:
- `/clear`: clears the chat history for all users;
- `/lock`: prevents any new users from connecting to the group unless
- `/lock
message
`: prevents any new users from connecting to the group unless
they have operator privileges;
- `/unlock`: reverts the effect of `/lock`;
- `/record`: start recording;
...
...
group/group.go
View file @
f8ae908d
...
...
@@ -78,7 +78,7 @@ type Group struct {
description
*
groupDescription
// indicates that the group no longer exists, but it still has clients
dead
bool
locked
bool
locked
*
string
clients
map
[
string
]
Client
history
[]
ChatHistoryEntry
}
...
...
@@ -87,16 +87,24 @@ func (g *Group) Name() string {
return
g
.
name
}
func
(
g
*
Group
)
Locked
()
bool
{
func
(
g
*
Group
)
Locked
()
(
bool
,
string
)
{
g
.
mu
.
Lock
()
defer
g
.
mu
.
Unlock
()
return
g
.
locked
if
(
g
.
locked
!=
nil
)
{
return
true
,
*
g
.
locked
}
else
{
return
false
,
""
}
}
func
(
g
*
Group
)
SetLocked
(
locked
bool
)
{
func
(
g
*
Group
)
SetLocked
(
locked
bool
,
message
string
)
{
g
.
mu
.
Lock
()
defer
g
.
mu
.
Unlock
()
g
.
locked
=
locked
if
locked
{
g
.
locked
=
&
message
}
else
{
g
.
locked
=
nil
}
}
func
(
g
*
Group
)
Public
()
bool
{
...
...
@@ -272,8 +280,12 @@ func AddClient(name string, c Client) (*Group, error) {
c
.
SetPermissions
(
perms
)
if
!
perms
.
Op
&&
g
.
locked
{
return
nil
,
UserError
(
"group is locked"
)
if
!
perms
.
Op
&&
g
.
locked
!=
nil
{
m
:=
*
g
.
locked
if
m
==
""
{
m
=
"group is locked"
}
return
nil
,
UserError
(
m
)
}
if
!
perms
.
Op
&&
g
.
description
.
MaxClients
>
0
{
...
...
rtpconn/webclient.go
View file @
f8ae908d
...
...
@@ -1008,7 +1008,7 @@ func handleClientMessage(c *webClient, m clientMessage) error {
if
!
c
.
permissions
.
Op
{
return
c
.
error
(
group
.
UserError
(
"not authorised"
))
}
c
.
group
.
SetLocked
(
m
.
Kind
==
"lock"
)
c
.
group
.
SetLocked
(
m
.
Kind
==
"lock"
,
m
.
Value
)
case
"record"
:
if
!
c
.
permissions
.
Record
{
return
c
.
error
(
group
.
UserError
(
"not authorised"
))
...
...
static/protocol.js
View file @
f8ae908d
...
...
@@ -419,11 +419,13 @@ ServerConnection.prototype.chat = function(username, kind, message) {
*
* @param {string} kind - One of "clearchat", "lock", "unlock", "record or
* "unrecord".
* @param {string} [message]
*/
ServerConnection
.
prototype
.
groupAction
=
function
(
kind
)
{
ServerConnection
.
prototype
.
groupAction
=
function
(
kind
,
message
)
{
this
.
send
({
type
:
'
groupaction
'
,
kind
:
kind
,
value
:
message
,
});
};
...
...
static/sfu.js
View file @
f8ae908d
...
...
@@ -1072,7 +1072,7 @@ function handleInput() {
displayError
(
"
You're not an operator
"
);
return
;
}
serverConnection
.
groupAction
(
cmd
.
slice
(
1
));
serverConnection
.
groupAction
(
cmd
.
slice
(
1
)
,
rest
);
return
;
case
'
/record
'
:
case
'
/unrecord
'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment