1 import type { AutoResponder as tsAutoResponder } from '../interfaces/AutoResponder';
2 import type { BLOCK_SENDER_CONFIRMATION } from '../mail/constants';
4 AUTO_DELETE_SPAM_AND_TRASH_DAYS,
11 } from '../mail/mailSettings';
13 export const getMailSettings = () => ({
14 url: 'mail/v4/settings',
18 export const updatePageSize = (PageSize: MAIL_PAGE_SIZE) => ({
19 url: 'mail/v4/settings/pagesize',
24 export const updateNextMessageOnMove = (NextMessageOnMove: NEXT_MESSAGE_ON_MOVE) => ({
25 url: 'mail/v4/settings/next-message-on-move',
27 data: { NextMessageOnMove },
30 export const updateShowMoved = (ShowMoved: number) => ({
31 url: 'mail/v4/settings/moved',
36 export const updateHideRemoteImages = (HideRemoteImages: number) => ({
37 url: 'mail/v4/settings/hide-remote-images',
39 data: { HideRemoteImages },
42 export const updateShowAlmostAllMail = (AlmostAllMail: number) => ({
43 url: 'mail/v4/settings/almost-all-mail',
45 data: { AlmostAllMail },
48 export const updateHideEmbeddedImages = (HideEmbeddedImages: number) => ({
49 url: 'mail/v4/settings/hide-embedded-images',
51 data: { HideEmbeddedImages },
54 export const updateAutoSaveContacts = (AutoSaveContacts: number) => ({
55 url: 'mail/v4/settings/autocontacts',
57 data: { AutoSaveContacts },
60 export const updateTheme = (Theme: string | number) => ({
61 url: 'mail/v4/settings/theme',
66 export const updateDisplayName = (DisplayName: string) => ({
67 url: 'mail/v4/settings/display',
69 data: { DisplayName },
72 export const updateSignature = (Signature: string) => ({
73 url: 'mail/v4/settings/signature',
78 export const updatePMSignature = (PMSignature: number) => ({
79 url: 'mail/v4/settings/pmsignature',
81 data: { PMSignature },
84 export const updatePMSignatureReferralLink = (PMSignatureReferralLink: PM_SIGNATURE_REFERRAL) => ({
85 url: 'mail/v4/settings/pmsignature-referral',
87 data: { PMSignatureReferralLink },
90 export const updateComposerMode = (ComposerMode: number) => ({
91 url: 'mail/v4/settings/composermode',
93 data: { ComposerMode },
96 export const updateMessageButtons = (MessageButtons: number) => ({
97 url: 'mail/v4/settings/messagebuttons',
99 data: { MessageButtons },
102 export const updateViewMode = (ViewMode: number) => ({
103 url: 'mail/v4/settings/viewmode',
108 export const updateStickyLabels = (StickyLabels: number) => ({
109 url: 'mail/v4/settings/stickylabels',
111 data: { StickyLabels },
114 export const updateDraftType = (MIMEType: string) => ({
115 url: 'mail/v4/settings/drafttype',
120 export const updateRightToLeft = (RightToLeft: DIRECTION) => ({
121 url: 'mail/v4/settings/righttoleft',
123 data: { RightToLeft },
126 export const updateViewLayout = (ViewLayout: number) => ({
127 url: 'mail/v4/settings/viewlayout',
129 data: { ViewLayout },
132 export const updatePromptPin = (PromptPin: number) => ({
133 url: 'mail/v4/settings/promptpin',
138 export const updateKT = (KT: number) => ({
139 url: 'mail/v4/settings/kt',
144 export const updatePGPScheme = (PGPScheme: number) => ({
145 url: 'mail/v4/settings/pgpscheme',
150 export const updateSign = (Sign: number) => ({
151 url: 'mail/v4/settings/sign',
156 export const updateAttachPublicKey = (AttachPublicKey: number) => ({
157 url: 'mail/v4/settings/attachpublic',
159 data: { AttachPublicKey },
162 export const updateShortcuts = (Shortcuts: number) => ({
163 url: 'mail/v4/settings/shortcuts',
168 export const updateAutoresponder = (AutoResponder: tsAutoResponder) => ({
169 url: 'mail/v4/settings/autoresponder',
171 data: { AutoResponder },
174 export const updateConfirmLink = (ConfirmLink: number) => ({
175 url: 'mail/v4/settings/confirmlink',
177 data: { ConfirmLink },
180 export const updateDelaySend = (DelaySendSeconds: number) => ({
181 url: 'mail/v4/settings/delaysend',
183 data: { DelaySendSeconds },
186 export const updateEnableFolderColor = (EnableFolderColor: number) => ({
187 url: 'mail/v4/settings/enablefoldercolor',
189 data: { EnableFolderColor },
192 export const updateInheritParentFolderColor = (InheritParentFolderColor: number) => ({
193 url: 'mail/v4/settings/inheritparentfoldercolor',
195 data: { InheritParentFolderColor },
198 export const updateFontFace = (FontFace: string) => ({
199 url: 'mail/v4/settings/fontface',
204 export const updateFontSize = (FontSize: number) => ({
205 url: 'mail/v4/settings/fontsize',
210 export const updateImageProxy = (ImageProxy: number, Action: 'add' | 'remove') => ({
211 url: 'mail/v4/settings/imageproxy',
213 data: { ImageProxy, Action: Action === 'add' ? 1 : 0 },
216 export const updateSpamAction = (SpamAction: SPAM_ACTION | null) => ({
217 url: 'mail/v4/settings/spam-action',
219 data: { SpamAction },
222 export const updateBlockSenderConfirmation = (BlockSenderConfirmation: BLOCK_SENDER_CONFIRMATION | null) => ({
223 url: 'mail/v4/settings/block-sender-confirmation',
225 data: { BlockSenderConfirmation },
228 export const updateHideSenderImages = (HideSenderImages: number) => ({
229 url: 'mail/v4/settings/hide-sender-images',
231 data: { HideSenderImages },
234 export const updateDisplayUnreadFavicon = (UnreadFavicon: number) => ({
235 url: 'mail/v4/settings/unread-favicon',
237 data: { UnreadFavicon },
240 export const updateAutoDelete = (AutoDeleteSpamAndTrashDays: AUTO_DELETE_SPAM_AND_TRASH_DAYS) => ({
241 url: 'mail/v4/settings/auto-delete-spam-and-trash-days',
243 data: { Days: AutoDeleteSpamAndTrashDays },
246 export const updateSwipeLeft = (SwipeLeft: SWIPE_ACTION) => ({
247 url: 'mail/v4/settings/swipeleft',
252 export const updateSwipeRight = (SwipeRight: SWIPE_ACTION) => ({
253 url: 'mail/v4/settings/swiperight',
255 data: { SwipeRight },