mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 14:07:04 +03:00
Use the new b64EncodeJSONSafe
This commit is contained in:
parent
e6b6531248
commit
76627ae2f6
1 changed files with 3 additions and 17 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { isArray, arrayLength, pString, pInt } from 'Common/Utils';
|
||||
import { isArray, arrayLength, pString, pInt, b64EncodeJSONSafe } from 'Common/Utils';
|
||||
|
||||
import {
|
||||
getFolderHash,
|
||||
|
|
@ -19,20 +19,6 @@ import { AbstractFetchRemote } from 'Remote/AbstractFetch';
|
|||
|
||||
import { FolderCollectionModel } from 'Model/FolderCollection';
|
||||
|
||||
// unescape(encodeURIComponent()) makes the UTF-16 DOMString to an UTF-8 string
|
||||
const urlSafeJSON = data => btoa(unescape(encodeURIComponent(JSON.stringify(data))))
|
||||
.replace(/\+/g, '-')
|
||||
.replace(/\//g, '_')
|
||||
.replace(/=+$/, '');
|
||||
/* Withous deprecated 'unescape':
|
||||
const urlSafeJSON = data => btoa(encodeURIComponent(JSON.stringify(data)).replace(
|
||||
/%([0-9A-F]{2})/g, (match, p1) => String.fromCharCode('0x' + p1)
|
||||
))
|
||||
.replace(/\+/g, '-')
|
||||
.replace(/\//g, '_')
|
||||
.replace(/=+$/, '');
|
||||
*/
|
||||
|
||||
class RemoteUserFetch extends AbstractFetchRemote {
|
||||
|
||||
/**
|
||||
|
|
@ -66,7 +52,7 @@ class RemoteUserFetch extends AbstractFetchRemote {
|
|||
sGetAdd = 'MessageList/' +
|
||||
SUB_QUERY_PREFIX +
|
||||
'/' +
|
||||
urlSafeJSON(params);
|
||||
b64EncodeJSONSafe(params);
|
||||
params = {};
|
||||
}
|
||||
|
||||
|
|
@ -97,7 +83,7 @@ class RemoteUserFetch extends AbstractFetchRemote {
|
|||
'Message/' +
|
||||
SUB_QUERY_PREFIX +
|
||||
'/' +
|
||||
urlSafeJSON([
|
||||
b64EncodeJSONSafe([
|
||||
sFolderFullName,
|
||||
iUid,
|
||||
AppUserStore.threadsAllowed() && SettingsUserStore.useThreads() ? 1 : 0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue