mirror of
https://github.com/m1k1o/neko.git
synced 2025-04-30 19:06:21 +02:00
legacy: update dispaly name only if not set.
This commit is contained in:
parent
136d2ba1da
commit
13f91477df
1 changed files with 4 additions and 4 deletions
|
@ -47,18 +47,18 @@ func (s *session) wsToBackend(msg []byte) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if request.DisplayName != "" {
|
if request.DisplayName != "" {
|
||||||
// Update display name if it's different
|
// Update display name if it is not set
|
||||||
if s.name == "" || s.name != request.DisplayName {
|
if s.name == "" {
|
||||||
err = s.apiReq(http.MethodPost, "/api/profile", map[string]any{
|
err = s.apiReq(http.MethodPost, "/api/profile", map[string]any{
|
||||||
"name": request.DisplayName,
|
"name": request.DisplayName,
|
||||||
}, nil)
|
}, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
s.name = request.DisplayName
|
s.name = request.DisplayName
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// try to set legacy video stream, if it fails, it will be ignored
|
// try to set legacy video stream, if it fails, it will be ignored
|
||||||
if err := s.toBackend(event.SIGNAL_VIDEO, &message.SignalVideo{
|
if err := s.toBackend(event.SIGNAL_VIDEO, &message.SignalVideo{
|
||||||
|
|
Loading…
Add table
Reference in a new issue