forked from RainLoop/rainloop-webmail
-
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return all fetched messages headers in JSON.
This is in preperation of BIMI-Selectors #1394
- Loading branch information
the-djmaze
committed
Jan 21, 2024
1 parent
55a5fb4
commit 8292c47
Showing
7 changed files
with
135 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import ko from 'ko'; | ||
|
||
import { AbstractModel } from 'Knoin/AbstractModel'; | ||
|
||
export class MimeHeaderModel extends AbstractModel | ||
{ | ||
constructor() { | ||
super(); | ||
this.name = ''; | ||
this.value = ''; | ||
this.parameters = ko.observableArray(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { AbstractCollectionModel } from 'Model/AbstractCollection'; | ||
import { MimeHeaderModel } from 'Model/MimeHeader'; | ||
|
||
'use strict'; | ||
|
||
export class MimeHeaderCollectionModel extends AbstractCollectionModel | ||
{ | ||
/** | ||
* @param {?Array} json | ||
* @returns {MimeHeaderCollectionModel} | ||
*/ | ||
static reviveFromJson(items) { | ||
return super.reviveFromJson(items, header => MimeHeaderModel.reviveFromJson(header)); | ||
} | ||
|
||
/** | ||
* @param {string} name | ||
* @returns {?MimeHeader} | ||
*/ | ||
getByName(name) | ||
{ | ||
name = name.toLowerCase(); | ||
return this.find(header => header.name.toLowerCase() === name); | ||
} | ||
|
||
valueByName(name) | ||
{ | ||
const header = this.getByName(name); | ||
return header ? header.value : ''; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.