From 06cb57bc934b49c2d5efb66d4ff53eba70e407a3 Mon Sep 17 00:00:00 2001 From: djmaze Date: Sun, 31 Oct 2021 01:06:32 +0200 Subject: [PATCH] No need to respond APP_VERSION in FolderInformation and FolderInformationMultiply requests --- dev/App/User.js | 4 ++-- .../v/0.0.0/app/libraries/RainLoop/Actions/Folders.php | 9 ++------- .../v/0.0.0/app/libraries/RainLoop/Actions/Response.php | 1 + 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/dev/App/User.js b/dev/App/User.js index cc7c37594..c2a1ae844 100644 --- a/dev/App/User.js +++ b/dev/App/User.js @@ -551,9 +551,9 @@ class AppUser extends AbstractApp { const folders = FolderUserStore.getNextFolderNames(refreshFolders); if (arrayLength(folders)) { Remote.folderInformationMultiply((iError, oData) => { - if (!iError && arrayLength(oData.Result.List)) { + if (!iError && arrayLength(oData.Result)) { const utc = Date.now(); - oData.Result.List.forEach(item => { + oData.Result.forEach(item => { const hash = getFolderHash(item.Folder), folder = getFolderFromCacheList(item.Folder); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php index 5bfb6fea2..c5ba7a9ba 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Folders.php @@ -386,8 +386,6 @@ trait Folders throw new ClientException(Notifications::MailServerError, $oException); } - $aInboxInformation['Version'] = APP_VERSION; - return $this->DefaultResponse(__FUNCTION__, $aInboxInformation); } @@ -396,10 +394,7 @@ trait Folders */ public function DoFolderInformationMultiply() : array { - $aResult = array( - 'List' => array(), - 'Version' => APP_VERSION - ); + $aResult = array(); $aFolders = $this->GetActionParam('Folders', null); if (\is_array($aFolders)) @@ -416,7 +411,7 @@ trait Folders $aInboxInformation = $this->MailClient()->FolderInformation($sFolder); if (isset($aInboxInformation['Folder'])) { - $aResult['List'][] = [ + $aResult[] = [ 'Folder' => $aInboxInformation['Folder'], 'Hash' => $aInboxInformation['Hash'], 'MessageCount' => $aInboxInformation['MessageCount'], diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php index dde960ea9..10f593d04 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Response.php @@ -100,6 +100,7 @@ trait Response $sActionName = \preg_replace('/[^a-zA-Z0-9_]+/', '', $sActionName); $aResult = array( +// 'Version' => APP_VERSION, 'Action' => $sActionName, 'Result' => $this->responseObject($mResult, $sActionName) );