Created
July 10, 2025 11:40
-
-
Save mikan-megane/98199675cf2f86cc554aa62c569c1112 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| return (async () => { | |
| // 優先順位(指定外は最優先) | |
| const DomainOrder = this.quicktext.variables[0] | |
| .split(",") | |
| .map((domain) => domain.trim()); | |
| let { to, cc } = await this.compose.getComposeDetails(); | |
| DomainOrder.toReversed().forEach((domain) => { | |
| const otherTo = to.filter((address) => !address.includes(domain)); | |
| if (otherTo.length) { | |
| cc = to.filter((address) => address.includes(domain)).concat(cc); | |
| to = otherTo; | |
| } | |
| }); | |
| to = [...new Set(to)]; | |
| cc = [...new Set(cc)].sort( | |
| (a, b) => | |
| DomainOrder.findIndex((domain) => a.includes(domain)) - | |
| DomainOrder.findIndex((domain) => b.includes(domain)) | |
| ); | |
| await this.compose.setComposeDetails({ to, cc }); | |
| return ""; | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment