mirror of
https://github.com/aljazceru/signal-cli-rest-api.git
synced 2025-12-19 15:44:28 +01:00
fix bug in update profile REST API command
* use 'given-name' parameter instead of 'name' see #236
This commit is contained in:
@@ -1022,7 +1022,7 @@ func (s *SignalClient) UpdateProfile(number string, profileName string, base64Av
|
|||||||
|
|
||||||
if s.signalCliMode == JsonRpc {
|
if s.signalCliMode == JsonRpc {
|
||||||
type Request struct {
|
type Request struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"given-name"`
|
||||||
Avatar string `json:"avatar,omitempty"`
|
Avatar string `json:"avatar,omitempty"`
|
||||||
RemoveAvatar bool `json:"remove-avatar"`
|
RemoveAvatar bool `json:"remove-avatar"`
|
||||||
}
|
}
|
||||||
@@ -1039,7 +1039,7 @@ func (s *SignalClient) UpdateProfile(number string, profileName string, base64Av
|
|||||||
}
|
}
|
||||||
_, err = jsonRpc2Client.getRaw("updateProfile", request)
|
_, err = jsonRpc2Client.getRaw("updateProfile", request)
|
||||||
} else {
|
} else {
|
||||||
cmd := []string{"--config", s.signalCliConfig, "-a", number, "updateProfile", "--name", profileName}
|
cmd := []string{"--config", s.signalCliConfig, "-a", number, "updateProfile", "--given-name", profileName}
|
||||||
if base64Avatar == "" {
|
if base64Avatar == "" {
|
||||||
cmd = append(cmd, "--remove-avatar")
|
cmd = append(cmd, "--remove-avatar")
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user