mirror of
https://github.com/m1k1o/neko.git
synced 2025-08-03 08:50:13 +02:00
legacy: only update name if its different.
This commit is contained in:
parent
82aa68097b
commit
e018bcc886
1 changed files with 8 additions and 5 deletions
|
@ -49,11 +49,14 @@ func (s *session) wsToBackend(msg []byte) error {
|
|||
if request.DisplayName != "" {
|
||||
s.name = request.DisplayName
|
||||
|
||||
err = s.apiReq(http.MethodPost, "/api/profile", map[string]any{
|
||||
"name": request.DisplayName,
|
||||
}, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
// Update display name if it's different
|
||||
if s.name == "" || s.name != request.DisplayName {
|
||||
err = s.apiReq(http.MethodPost, "/api/profile", map[string]any{
|
||||
"name": request.DisplayName,
|
||||
}, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue