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
ea321be1
Commit
ea321be1
authored
Feb 26, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Kick part of the Client interface.
All clients implement Kick, no need for a separate interface.
parent
69c438ab
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
13 deletions
+2
-13
group/client.go
group/client.go
+0
-3
group/group.go
group/group.go
+1
-4
rtpconn/webclient.go
rtpconn/webclient.go
+1
-6
No files found.
group/client.go
View file @
ea321be1
...
@@ -101,8 +101,5 @@ type Client interface {
...
@@ -101,8 +101,5 @@ type Client interface {
OverridePermissions
(
*
Group
)
bool
OverridePermissions
(
*
Group
)
bool
PushConn
(
g
*
Group
,
id
string
,
conn
conn
.
Up
,
tracks
[]
conn
.
UpTrack
,
replace
string
)
error
PushConn
(
g
*
Group
,
id
string
,
conn
conn
.
Up
,
tracks
[]
conn
.
UpTrack
,
replace
string
)
error
PushClient
(
id
,
username
string
,
add
bool
)
error
PushClient
(
id
,
username
string
,
add
bool
)
error
}
type
Kickable
interface
{
Kick
(
id
,
user
,
message
string
)
error
Kick
(
id
,
user
,
message
string
)
error
}
}
group/group.go
View file @
ea321be1
...
@@ -586,10 +586,7 @@ func (g *Group) Range(f func(c Client) bool) {
...
@@ -586,10 +586,7 @@ func (g *Group) Range(f func(c Client) bool) {
func
kickall
(
g
*
Group
,
message
string
)
{
func
kickall
(
g
*
Group
,
message
string
)
{
g
.
Range
(
func
(
c
Client
)
bool
{
g
.
Range
(
func
(
c
Client
)
bool
{
cc
,
ok
:=
c
.
(
Kickable
)
c
.
Kick
(
""
,
""
,
message
)
if
ok
{
cc
.
Kick
(
""
,
""
,
message
)
}
return
true
return
true
})
})
}
}
...
...
rtpconn/webclient.go
View file @
ea321be1
...
@@ -1099,12 +1099,7 @@ func kickClient(g *group.Group, id, user, dest string, message string) error {
...
@@ -1099,12 +1099,7 @@ func kickClient(g *group.Group, id, user, dest string, message string) error {
return
group
.
UserError
(
"no such user"
)
return
group
.
UserError
(
"no such user"
)
}
}
c
,
ok
:=
client
.
(
group
.
Kickable
)
return
client
.
Kick
(
id
,
user
,
message
)
if
!
ok
{
return
group
.
UserError
(
"this client is not kickable"
)
}
return
c
.
Kick
(
id
,
user
,
message
)
}
}
func
handleClientMessage
(
c
*
webClient
,
m
clientMessage
)
error
{
func
handleClientMessage
(
c
*
webClient
,
m
clientMessage
)
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