forked from Silverfish/proton-bridge
Other: Fix testCtx.getMBoxID()
Ensure we always translate the labels to their full name so they match properly on all commands.
This commit is contained in:
@ -263,7 +263,19 @@ func (t *testCtx) getMBoxID(userID string, name string) string {
|
||||
}
|
||||
|
||||
idx := xslices.IndexFunc(labels, func(label proton.Label) bool {
|
||||
return label.Name == name
|
||||
var labelName string
|
||||
switch label.Type {
|
||||
case proton.LabelTypeSystem:
|
||||
labelName = label.Name
|
||||
case proton.LabelTypeFolder:
|
||||
labelName = fmt.Sprintf("Folders/%v", label.Name)
|
||||
case proton.LabelTypeLabel:
|
||||
labelName = fmt.Sprintf("Labels/%v", label.Name)
|
||||
case proton.LabelTypeContactGroup:
|
||||
labelName = label.Name
|
||||
}
|
||||
|
||||
return labelName == name
|
||||
})
|
||||
|
||||
if idx < 0 {
|
||||
|
||||
Reference in New Issue
Block a user