Skip to content

Commit

Permalink
Start standardizing on "client" instead of "device" or "PIM".
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Dec 7, 2014
1 parent 5a990a2 commit e2744f8
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 72 deletions.
Expand Up @@ -337,7 +337,7 @@ public function messageChange($id, Horde_ActiveSync_Message_Base $message)
}

/**
* Stream a message deletion to the PIM
* Stream a message deletion to the client.
*
* @param string $id The uid of the message we are deleting.
* @param boolean $soft If true, send a SOFTDELETE, otherwise a REMOVE.
Expand Down
Expand Up @@ -130,7 +130,7 @@ public function setLogger($logger)
* false if a new message.
* @param Horde_ActiveSync_Message_Base $message A message object
* @param Horde_ActiveSync_Device $device A device descriptor
* @param integer $clientid Client id sent from PIM
* @param integer $clientid Client id sent from client.
* on message addition.
* @param string $class The collection class (only needed for SMS).
* @since 2.6.0
Expand Down Expand Up @@ -165,7 +165,7 @@ public function importMessageChange(
return array($id, Horde_ActiveSync_Request_Sync::STATUS_CONFLICT);
}
} elseif (!$id && $uid = $this->_state->isDuplicatePIMAddition($clientid)) {
// Already saw this addition, but PIM never received UID
// Already saw this addition, but client never received UID
$this->_logger->notice(sprintf(
'[%s] Duplicate addition for %s',
$this->_procid, $uid)
Expand Down Expand Up @@ -264,7 +264,7 @@ public function importMessageReadFlag($id, $flag)
}

/**
* Perform a message move initiated on the PIM
* Perform a message move initiated on the clinet.
*
* @param array $uids The source message ids.
* @param string $dst The destination folder uid.
Expand Down Expand Up @@ -383,7 +383,7 @@ public function importFolderChange($uid, $displayname, $parent = Horde_ActiveSyn
}

/**
* Imports a folder deletion from the PIM
* Imports a folder deletion from the client.
*
* @param string $uid The folder uid
* @param string $parent The folder id of the parent folder.
Expand Down
2 changes: 1 addition & 1 deletion framework/ActiveSync/lib/Horde/ActiveSync/Driver/Base.php
Expand Up @@ -662,7 +662,7 @@ abstract public function changeMessage($folderid, $id, Horde_ActiveSync_Message_
abstract public function setReadFlag($folderid, $uid, $flag);

/**
* Sends the email represented by the rfc822 string received by the PIM.
* Sends the email represented by the rfc822 string received by the client.
*
* @param mixed $rfc822 The rfc822 mime message, a string or stream
* resource.
Expand Down
2 changes: 1 addition & 1 deletion framework/ActiveSync/lib/Horde/ActiveSync/Driver/Mock.php
Expand Up @@ -558,7 +558,7 @@ public function changeMessage($folderid, $id, Horde_ActiveSync_Message_Base $mes
public function setReadFlag($folderid, $uid, $flag) { }

/**
* Sends the email represented by the rfc822 string received by the PIM.
* Sends the email represented by the rfc822 string received by the client.
*
* @param mixed $rfc822 The rfc822 mime message, a string or stream
* resource.
Expand Down
Expand Up @@ -390,7 +390,7 @@ public function getSubject()
}

/**
* Set the appointment uid. Note that this is the PIM's UID value, and not
* Set the appointment uid. Note that this is the client's UID value, and not
* the value that the server uses for the UID. ActiveSync messages do not
* include any server uid value as part of the message natively.
*
Expand All @@ -402,7 +402,7 @@ public function setUid($uid)
}

/**
* Get the PIM's UID. See not above regarding server UIDs.
* Get the client's UID. See not above regarding server UIDs.
*
* @return string
*/
Expand All @@ -412,7 +412,7 @@ public function getUid()
}

/**
* Because the PIM doesn't pass the server uid as part of the message,
* Because the client doesn't pass the server uid as part of the message,
* we need to add it manually so the backend can have access to it
* when changing this object.
*
Expand Down
2 changes: 1 addition & 1 deletion framework/ActiveSync/lib/Horde/ActiveSync/Request/Base.php
Expand Up @@ -74,7 +74,7 @@ abstract class Horde_ActiveSync_Request_Base
protected $_provisioning;

/**
* Used to track what error code to send back to PIM on failure
* Used to track what error code to send back to client on failure
*
* @var integer
*/
Expand Down
Expand Up @@ -81,7 +81,7 @@ protected function _handle()
return true;
}

// Get the current synckey from PIM
// Get the current synckey from client
if (!$this->_decoder->getElementStartTag(Horde_ActiveSync::FOLDERHIERARCHY_SYNCKEY)) {
$this->_logger->err('[Horde_ActiveSync::handleFolderSync] No input to parse');
$this->_statusCode = self::STATUS_PROTOERR;
Expand Down Expand Up @@ -180,7 +180,7 @@ protected function _handle()
return true;
}

// Start sending server -> PIM changes
// Start sending server -> client changes
$newsynckey = $this->_state->getNewSyncKey($synckey);
$exporter = new Horde_ActiveSync_Connector_Exporter($this->_activeSync);
$exporter->setChanges($collections->getHierarchyChanges(), false);
Expand Down
14 changes: 7 additions & 7 deletions framework/ActiveSync/lib/Horde/ActiveSync/Request/Ping.php
Expand Up @@ -90,13 +90,13 @@ protected function _checkHeartbeat($lifetime)
}

/**
* Handle a PING command from the PIM. PING is sent periodically by the PIM
* to tell the server what folders we are interested in monitoring for
* changes. If no changes are detected by the server during the 'heartbeat'
* interval, the server sends back a status of self::STATUS_NOCHANGES to
* indicate heartbeat expired and the client should re-issue the PING
* command. If a change has been found, the client is sent a
* self::STATUS_NEEDSYNC and should issue a SYNC command.
* Handle a PING command from the client. PING is sent periodically by
* the client to tell the server what folders we are interested in
* monitoring for changes. If no changes are detected by the server during
* the 'heartbeat' interval, the server sends back a status of
* self::STATUS_NOCHANGES to indicate heartbeat expired and the client
* should re-issue the PING command. If a change has been found, the client
* is sent a self::STATUS_NEEDSYNC and should issue a SYNC command.
*
* @return boolean
*/
Expand Down
Expand Up @@ -135,7 +135,7 @@ protected function _handle()
// POLICYKEY is only sent by client in phase 3
if ($this->_decoder->getElementStartTag(Horde_ActiveSync::PROVISION_POLICYKEY)) {
$policykey = $this->_decoder->getElementContent();
$this->_logger->info('[' . $this->_device->id .'] PHASE 3 policykey sent from PIM: ' . $policykey);
$this->_logger->info('[' . $this->_device->id .'] PHASE 3 policykey sent from client: ' . $policykey);
if (!$this->_decoder->getElementEndTag() ||
!$this->_decoder->getElementStartTag(Horde_ActiveSync::PROVISION_STATUS)) {

Expand Down
10 changes: 5 additions & 5 deletions framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php
Expand Up @@ -332,7 +332,7 @@ protected function _handle()
return true;
}

// Start output to PIM
// Start output to client
$this->_encoder->startWBXML();
$this->_encoder->startTag(Horde_ActiveSync::SYNC_SYNCHRONIZE);
$this->_encoder->startTag(Horde_ActiveSync::SYNC_STATUS);
Expand Down Expand Up @@ -427,7 +427,7 @@ protected function _handle()
// any changes (incoming or outgoing), if this is during the
// initial sync pairing of the collection, or if we received a
// SYNC due to changes found during a PING (since those changes
// may be changes to items that never even made it to the PIM in
// may be changes to items that never even made it to the client in
// the first place (See Bug: 12075).
if ($statusCode == self::STATUS_SUCCESS &&
(!empty($collection['importedchanges']) ||
Expand Down Expand Up @@ -478,7 +478,7 @@ protected function _handle()
$ensure_sent = array();
if ($statusCode == self::STATUS_SUCCESS) {

// Send server changes to PIM
// Send server changes to client
if ($statusCode == self::STATUS_SUCCESS &&
empty($forceChanges) &&
(!empty($collection['getchanges']) ||
Expand Down Expand Up @@ -543,7 +543,7 @@ protected function _handle()
}
}

// Output server IDs for new items we received and added from PIM
// Output server IDs for new items we received and added from client
if (!empty($collection['clientids'])) {
foreach ($collection['clientids'] as $clientid => $serverid) {
if ($serverid) {
Expand Down Expand Up @@ -959,7 +959,7 @@ protected function _parseSyncCommands(&$collection)
$clientid = false;
}

// Create Message object from messages passed from PIM.
// Create Message object from messages passed from client.
// Only passed during SYNC_ADD or SYNC_MODIFY
if (($element[Horde_ActiveSync_Wbxml::EN_TAG] == Horde_ActiveSync::SYNC_ADD ||
$element[Horde_ActiveSync_Wbxml::EN_TAG] == Horde_ActiveSync::SYNC_MODIFY) &&
Expand Down
40 changes: 20 additions & 20 deletions framework/ActiveSync/lib/Horde/ActiveSync/State/Base.php
Expand Up @@ -80,7 +80,7 @@ abstract class Horde_ActiveSync_State_Base
* Keys include:
* - class: The collection class Contacts, Calendar etc...
* - synckey: The current synckey
* - newsynckey: The new synckey sent back to the PIM
* - newsynckey: The new synckey sent back to the client
* - id: Server folder id
* - filtertype: Filter
* - conflict: Conflicts
Expand All @@ -105,7 +105,7 @@ abstract class Horde_ActiveSync_State_Base
protected $_deviceInfo;

/**
* Local cache for changes to *send* to PIM
* Local cache for changes to *send* to client.
* (Will remain null until getChanges() is called)
*
* @var array
Expand Down Expand Up @@ -257,10 +257,10 @@ public function getChangeCount()

/**
* Determines if the server version of the message represented by $stat
* conflicts with the PIM version of the message. For this driver, this is
* conflicts with the client version of the message. For this driver, this is
* true whenever $lastSyncTime is older then $stat['mod']. Method is only
* called from the Importer during an import of a non-new change from the
* PIM.
* client.
*
* @param array $stat A message stat array
* @param string $type The type of change (change, delete, add)
Expand Down Expand Up @@ -448,7 +448,7 @@ public function getChanges(array $options = array())
$this->_changes = array();
if (count($changes) && $this->_havePIMChanges()) {
$this->_logger->info(sprintf(
'[%s] Checking for PIM initiated changes.',
'[%s] Checking for client initiated changes.',
$this->_procid));

switch ($this->_collection['class']) {
Expand Down Expand Up @@ -477,7 +477,7 @@ public function getChanges(array $options = array())
continue;
}
$this->_logger->info(sprintf(
'[%s] Ignoring PIM initiated %s for %s',
'[%s] Ignoring client initiated %s for %s',
$this->_procid,
$flag_map[$change['type']],
$change['id']));
Expand All @@ -488,9 +488,9 @@ public function getChanges(array $options = array())
break;

default:
$pim_timestamps = $this->_getPIMChangeTS($changes);
$client_timestamps = $this->_getPIMChangeTS($changes);
foreach ($changes as $change) {
if (empty($pim_timestamps[$change['id']])) {
if (empty($client_timestamps[$change['id']])) {
$this->_changes[] = $change;
continue;
}
Expand All @@ -503,19 +503,19 @@ public function getChanges(array $options = array())
// so will return (int)0 for ADD or DELETE.
$stat = $this->_backend->statMessage($this->_folder->serverid(), $change['id']);
}
if ($pim_timestamps[$change['id']] >= $stat['mod']) {
if ($client_timestamps[$change['id']] >= $stat['mod']) {
$this->_logger->info(sprintf(
'[%s] Ignoring PIM initiated change for %s (PIM TS: %s Stat TS: %s)',
'[%s] Ignoring client initiated change for %s (client TS: %s Stat TS: %s)',
$this->_procid,
$change['id'], $pim_timestamps[$change['id']], $stat['mod']));
$change['id'], $client_timestamps[$change['id']], $stat['mod']));
} else {
$this->_changes[] = $change;
}
}
}
} elseif (count($changes)) {
$this->_logger->info(sprintf(
'[%s] No PIM changes present, returning all messages.',
'[%s] No client changes present, returning all messages.',
$this->_procid));
$this->_changes = $changes;
}
Expand Down Expand Up @@ -671,10 +671,10 @@ protected static function _getCutOffDate($restrict)
}

/**
* Helper function that performs the actual diff between PIM state and
* Helper function that performs the actual diff between client state and
* server state FOLDERSYNC arrays.
*
* @param array $old The PIM state
* @param array $old The client state
* @param array $new The current server state
*
* @return unknown_type
Expand Down Expand Up @@ -862,8 +862,8 @@ protected function _loadState($type)
* and user.
*
* An extra database query for each sync, but the payoff is that we avoid
* having to stat every message change we send to the PIM if there are no
* PIM generated changes for this sync period.
* having to stat every message change we send to the client if there are no
* client generated changes for this sync period.
*
* @return boolean
* @throws Horde_ActiveSync_Exception
Expand Down Expand Up @@ -909,11 +909,11 @@ abstract public function save();
*
* @param integer $origin Flag to indicate the origin of the change:
* Horde_ActiveSync::CHANGE_ORIGIN_NA - Not applicapble/not important
* Horde_ActiveSync::CHANGE_ORIGIN_PIM - Change originated from PIM
* Horde_ActiveSync::CHANGE_ORIGIN_PIM - Change originated from client
*
* @param string $user The current sync user, only needed if change
* origin is CHANGE_ORIGIN_PIM
* @param string $clientid PIM clientid sent when adding a new message
* @param string $clientid client clientid sent when adding a new message
*/
abstract public function updateState(
$type, array $change, $origin = Horde_ActiveSync::CHANGE_ORIGIN_NA,
Expand Down Expand Up @@ -1052,8 +1052,8 @@ abstract public function saveSyncCache(array $cache, $devid, $user, array $dirty
abstract public function deleteSyncCache($devid, $user);

/**
* Check and see that we didn't already see the incoming change from the PIM.
* This would happen e.g., if the PIM failed to receive the server response
* Check and see that we didn't already see the incoming change from the client.
* This would happen e.g., if the client failed to receive the server response
* after successfully importing new messages.
*
* @param string $id The client id sent during message addition.
Expand Down

0 comments on commit e2744f8

Please sign in to comment.