mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-24 02:56:52 -05:00
groupware: fix keyword patching syntax for markAsSeen=true
This commit is contained in:
@@ -43,12 +43,9 @@ func (j *Client) GetEmails(accountId string, session *Session, ctx context.Conte
|
||||
|
||||
methodCalls := []Invocation{invokeGet}
|
||||
if markAsSeen {
|
||||
patch := map[string]bool{
|
||||
JmapKeywordSeen: true,
|
||||
}
|
||||
updates := make(map[string]EmailUpdate, len(ids))
|
||||
for _, id := range ids {
|
||||
updates[id] = EmailUpdate{"keywords": patch}
|
||||
updates[id] = EmailUpdate{"keywords/" + JmapKeywordSeen: true}
|
||||
}
|
||||
mark := EmailSetCommand{AccountId: accountId, Update: updates}
|
||||
methodCalls = []Invocation{invocation(CommandEmailSet, mark, "0"), invokeGet}
|
||||
|
||||
@@ -2854,7 +2854,7 @@ type EmailSetCommand struct {
|
||||
//
|
||||
// The value associated with each pointer determines how to apply that patch:
|
||||
// !- If null, set to the default value if specified for this property; otherwise, remove the property from the patched object. If the key is not present in the parent, this a no-op.
|
||||
// ç- Anything else: The value to set for this property (this may be a replacement or addition to the object being patched).
|
||||
// !- Anything else: The value to set for this property (this may be a replacement or addition to the object being patched).
|
||||
//
|
||||
// Any server-set properties MAY be included in the patch if their value is identical to the current server value
|
||||
// (before applying the patches to the object). Otherwise, the update MUST be rejected with an `invalidProperties` `SetError`.
|
||||
|
||||
@@ -1012,6 +1012,7 @@ func (g *Groupware) UpdateEmailKeywords(w http.ResponseWriter, r *http.Request)
|
||||
return noContentResponse(req.session.State)
|
||||
}
|
||||
|
||||
// TODO FIXME use "keywords/$seen" instead, see https://datatracker.ietf.org/doc/html/rfc8620#section-5.7
|
||||
patch := map[string]*bool{}
|
||||
truth := true
|
||||
for _, keyword := range body.Add {
|
||||
|
||||
Reference in New Issue
Block a user