fix(GODT-2935): Do not allow parentID into drafts
When sending a message ensure that if a ParentID matches a proton message, it is not a draft. This is not supported by the Proton API.
This commit is contained in:
parent
09ef3b20db
commit
d6000d025e
|
@ -315,7 +315,11 @@ func getParentID(
|
|||
switch len(metadata) {
|
||||
case 1:
|
||||
// found exactly one parent
|
||||
parentID = metadata[0].ID
|
||||
// We can only reference messages that have been sent or received. If this message is a draft
|
||||
// it needs to be ignored.
|
||||
if metadata[0].Flags.Has(proton.MessageFlagSent) || metadata[0].Flags.Has(proton.MessageFlagReceived) {
|
||||
parentID = metadata[0].ID
|
||||
}
|
||||
case 0:
|
||||
// found no parents
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue