Skip to content

Commit

Permalink
AS16.1 - Fixed Android Nine App
Browse files Browse the repository at this point in the history
AS16.1 changes based on grommunio-sync commit
grommunio/grommunio-sync@a567bb4
  • Loading branch information
matidau committed Oct 4, 2024
1 parent 446e046 commit 489674b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
header(ZPush::GetServerHeader());
header(ZPush::GetSupportedProtocolVersions());
header(ZPush::GetSupportedCommands());
header("X-AspNet-Version: 4.0.30319");
ZLog::Write(LOGLEVEL_INFO, $nopostex->getMessage());
}
else if ($nopostex->getCode() == NoPostRequestException::GET_REQUEST) {
Expand Down
12 changes: 3 additions & 9 deletions src/lib/request/sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -1496,17 +1496,11 @@ private function importMessage($spa, &$actiondata, $todo, $message, $clientid, $
$actiondata["statusids"][$serverid] = SYNC_STATUS_CLIENTSERVERCONVERSATIONERROR;
}
else {
if(isset($message->read)) {
// Currently, 'read' is only sent by the PDA when it is ONLY setting the read flag.
// if there is just a read flag change, import it via ImportMessageReadFlag()
if (isset($message->read) && !isset($message->flag) && $message->getCheckedParameters() < 3) {
$this->importer->ImportMessageReadFlag($serverid, $message->read);
}
elseif (!isset($message->flag)) {
$this->importer->ImportMessageChange($serverid, $message);
}

// email todoflags - some devices send todos flags together with read flags,
// so they have to be handled separately
if (isset($message->flag)){
else {
$this->importer->ImportMessageChange($serverid, $message);
}

Expand Down
17 changes: 17 additions & 0 deletions src/lib/syncobjects/syncobject.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ abstract class SyncObject extends Streamer {

protected $unsetVars;
protected $supportsPrivateStripping;
protected $checkedParameters;


public function __construct($mapping) {
$this->unsetVars = array();
$this->supportsPrivateStripping = false;
$this->checkedParameters = false;
parent::__construct($mapping);
}

Expand Down Expand Up @@ -397,6 +399,15 @@ public function SupportsPrivateStripping() {
return $this->supportsPrivateStripping;
}

/**
* Indicates the amount of paramters that were set before Checks were executed and potentially set other parameters.
*
* @return bool/int - returns false if Check() was not executed
*/
public function getCheckedParameters() {
return $this->checkedParameters;
}

/**
* Method checks if the object has the minimum of required parameters
* and fullfills semantic dependencies
Expand Down Expand Up @@ -424,6 +435,7 @@ public function Check($logAsDebug = false) {
}

$defaultLogLevel = LOGLEVEL_WARN;
$this->checkedParameters = 0;

// in some cases non-false checks should not provoke a WARN log but only a DEBUG log
if ($logAsDebug)
Expand All @@ -447,6 +459,11 @@ public function Check($logAsDebug = false) {

if (isset($v[self::STREAMER_CHECKS])) {
foreach ($v[self::STREAMER_CHECKS] as $rule => $condition) {
// count parameter if it's set
if (isset($this->{$v[self::STREAMER_VAR]})) {
++$this->checkedParameters;
}

// check REQUIRED settings
if ($rule === self::STREAMER_CHECK_REQUIRED && (!isset($this->{$v[self::STREAMER_VAR]}) || $this->{$v[self::STREAMER_VAR]} === '' ) ) {
// parameter is not set but ..
Expand Down

0 comments on commit 489674b

Please sign in to comment.