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
caa22643
Commit
caa22643
authored
Apr 25, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Close up connections when presenter permission lost.
parent
3ea63c39
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
client.go
client.go
+21
-1
group.go
group.go
+2
-2
No files found.
client.go
View file @
caa22643
...
...
@@ -205,6 +205,16 @@ func getUpConn(c *client, id string) *upConnection {
return
conn
}
func
getUpConns
(
c
*
client
)
[]
string
{
c
.
group
.
mu
.
Lock
()
defer
c
.
group
.
mu
.
Unlock
()
up
:=
make
([]
string
,
0
,
len
(
c
.
up
))
for
id
:=
range
c
.
up
{
up
=
append
(
up
,
id
)
}
return
up
}
func
addUpConn
(
c
*
client
,
id
string
)
(
*
upConnection
,
error
)
{
pc
,
err
:=
groups
.
api
.
NewPeerConnection
(
iceConfiguration
())
if
err
!=
nil
{
...
...
@@ -740,11 +750,21 @@ func clientLoop(c *client, conn *websocket.Conn) error {
}
}
case
sendPermissions
Action
:
case
permissionsChanged
Action
:
c
.
write
(
clientMessage
{
Type
:
"permissions"
,
Permissions
:
c
.
permissions
,
})
if
(
!
c
.
permissions
.
Present
)
{
ids
:=
getUpConns
(
c
)
for
_
,
id
:=
range
ids
{
c
.
write
(
clientMessage
{
Type
:
"abort"
,
Id
:
id
,
})
delUpConn
(
c
,
id
)
}
}
case
kickAction
:
return
userError
(
"you have been kicked"
)
default
:
...
...
group.go
View file @
caa22643
...
...
@@ -84,7 +84,7 @@ type pushTracksAction struct {
c
*
client
}
type
sendPermissions
Action
struct
{}
type
permissionsChanged
Action
struct
{}
type
kickAction
struct
{}
...
...
@@ -424,7 +424,7 @@ func setPermission(g *group, id string, perm string) error {
default
:
return
userError
(
"unknown permission"
)
}
return
c
.
action
(
sendPermissions
Action
{})
return
c
.
action
(
permissionsChanged
Action
{})
}
func
kickClient
(
g
*
group
,
id
string
)
error
{
...
...
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