mirror of
https://github.com/ChronosX88/yans.git
synced 2024-11-24 04:22:19 +00:00
Revert behavior of setting thread property when posting article
This commit is contained in:
parent
86e4290287
commit
3bedb48945
@ -335,11 +335,10 @@ func (h *Handler) handlePost(s *Session, command string, arguments []string, id
|
|||||||
a.Header = envelope.Root.Header
|
a.Header = envelope.Root.Header
|
||||||
a.Envelope = envelope
|
a.Envelope = envelope
|
||||||
|
|
||||||
// TODO handle multipart message
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
a.Body = string(envelope.Text)
|
a.Body = envelope.Text
|
||||||
|
|
||||||
// set thread property
|
// set thread property
|
||||||
if envelope.GetHeader("In-Reply-To") != "" {
|
if envelope.GetHeader("In-Reply-To") != "" {
|
||||||
@ -351,10 +350,14 @@ func (h *Handler) handlePost(s *Session, command string, arguments []string, id
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var parentHeader mail.Header
|
if !parentMessage.Thread.Valid {
|
||||||
err = json.Unmarshal([]byte(parentMessage.HeaderRaw), &parentHeader)
|
var parentHeader mail.Header
|
||||||
parentMessageID := parentHeader.Get("Message-ID")
|
err = json.Unmarshal([]byte(parentMessage.HeaderRaw), &parentHeader)
|
||||||
a.Thread = sql.NullString{String: parentMessageID, Valid: true}
|
parentMessageID := parentHeader.Get("Message-ID")
|
||||||
|
a.Thread = sql.NullString{String: parentMessageID, Valid: true}
|
||||||
|
} else {
|
||||||
|
a.Thread = parentMessage.Thread
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(envelope.Attachments) > 0 {
|
if len(envelope.Attachments) > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user