fix: migrate support email
This commit is contained in:
parent
fbaa238f43
commit
bce4ea722b
2 changed files with 6 additions and 2 deletions
|
|
@ -32,6 +32,7 @@ var supportedChannels = map[string]bool{
|
|||
"qq": true,
|
||||
"dingtalk": true,
|
||||
"maixcam": true,
|
||||
"email": true,
|
||||
}
|
||||
|
||||
func findOpenClawConfig(openclawHome string) (string, error) {
|
||||
|
|
@ -203,6 +204,9 @@ func ConvertConfig(data map[string]any) (*config.Config, []string, error) {
|
|||
if v, ok := getFloat(cMap, "port"); ok {
|
||||
cfg.Channels.MaixCam.Port = int(v)
|
||||
}
|
||||
case "email":
|
||||
cfg.Channels.Email.Enabled = enabled
|
||||
cfg.Channels.Email.AllowFrom = allowFrom
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ func TestConvertConfig(t *testing.T) {
|
|||
t.Run("unsupported channel warning", func(t *testing.T) {
|
||||
data := map[string]any{
|
||||
"channels": map[string]any{
|
||||
"email": map[string]any{
|
||||
"unknown_channel": map[string]any{
|
||||
"enabled": true,
|
||||
},
|
||||
},
|
||||
|
|
@ -247,7 +247,7 @@ func TestConvertConfig(t *testing.T) {
|
|||
if len(warnings) != 1 {
|
||||
t.Fatalf("expected 1 warning, got %d", len(warnings))
|
||||
}
|
||||
if warnings[0] != "Channel 'email' not supported in PicoClaw, skipping" {
|
||||
if warnings[0] != "Channel 'unknown_channel' not supported in PicoClaw, skipping" {
|
||||
t.Errorf("unexpected warning: %s", warnings[0])
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue