mirror of
https://github.com/jech/galene.git
synced 2024-11-22 16:45:58 +01:00
Remove userId and userName from rtpconn.
They're redundant with the client field.
This commit is contained in:
parent
c860fb96a3
commit
e81ee4af5e
2 changed files with 7 additions and 8 deletions
|
@ -508,8 +508,6 @@ type rtpUpConnection struct {
|
||||||
id string
|
id string
|
||||||
client group.Client
|
client group.Client
|
||||||
label string
|
label string
|
||||||
userId string
|
|
||||||
username string
|
|
||||||
pc *webrtc.PeerConnection
|
pc *webrtc.PeerConnection
|
||||||
iceCandidates []*webrtc.ICECandidateInit
|
iceCandidates []*webrtc.ICECandidateInit
|
||||||
|
|
||||||
|
@ -548,7 +546,7 @@ func (up *rtpUpConnection) Label() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (up *rtpUpConnection) User() (string, string) {
|
func (up *rtpUpConnection) User() (string, string) {
|
||||||
return up.userId, up.username
|
return up.client.Id(), up.client.Username()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (up *rtpUpConnection) AddLocal(local conn.Down) error {
|
func (up *rtpUpConnection) AddLocal(local conn.Down) error {
|
||||||
|
|
|
@ -211,10 +211,13 @@ func delUpConn(c *webClient, id string, userId string, push bool) error {
|
||||||
c.mu.Unlock()
|
c.mu.Unlock()
|
||||||
return os.ErrNotExist
|
return os.ErrNotExist
|
||||||
}
|
}
|
||||||
if userId != "" && conn.userId != userId {
|
if userId != "" {
|
||||||
|
id, _ := conn.User()
|
||||||
|
if id != userId {
|
||||||
c.mu.Unlock()
|
c.mu.Unlock()
|
||||||
return ErrUserMismatch
|
return ErrUserMismatch
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
replace := conn.getReplace(false)
|
replace := conn.getReplace(false)
|
||||||
|
|
||||||
|
@ -576,8 +579,6 @@ func gotOffer(c *webClient, id, label string, sdp string, replace string) error
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
up.userId = c.Id()
|
|
||||||
up.username = c.Username()
|
|
||||||
if replace != "" {
|
if replace != "" {
|
||||||
up.replace = replace
|
up.replace = replace
|
||||||
delUpConn(c, replace, c.Id(), false)
|
delUpConn(c, replace, c.Id(), false)
|
||||||
|
|
Loading…
Reference in a new issue