Commit 212f314a authored by mku's avatar mku

ZP-44 #comment Implement ResolveRecipients command - added to IBackend...

ZP-44 #comment   Implement ResolveRecipients command  -  added to IBackend interface, Backend class and handling in Zarafa backend   #time 4h

git-svn-id: https://z-push.org/svn/z-push/trunk@1623 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent 33025ef1
......@@ -222,6 +222,80 @@ class MAPIUtils {
);
}
/**
* Create a MAPI restriction for a certain email address
*
* @access public
*
* @param MAPIStore $store the MAPI store
* @param string $query email address
*
* @return array
*/
public static function GetEmailAddressRestriction($store, $email) {
$props = MAPIMapping::GetContactProperties();
$props = getPropIdsFromStrings($store, $props);
return array(RES_OR,
array(
array( RES_PROPERTY,
array( RELOP => RELOP_EQ,
ULPROPTAG => $props['emailaddress1'],
VALUE => array($props['emailaddress1'] => $email),
),
),
array( RES_PROPERTY,
array( RELOP => RELOP_EQ,
ULPROPTAG => $props['emailaddress2'],
VALUE => array($props['emailaddress2'] => $email),
),
),
array( RES_PROPERTY,
array( RELOP => RELOP_EQ,
ULPROPTAG => $props['emailaddress3'],
VALUE => array($props['emailaddress3'] => $email),
),
),
),
);
}
/**
* Create a MAPI restriction for a certain folder type
*
* @access public
*
* @param string $foldertype folder type for restriction
* @return array
*/
public static function GetFolderTypeRestriction($foldertype) {
return array( RES_PROPERTY,
array( RELOP => RELOP_EQ,
ULPROPTAG => PR_CONTAINER_CLASS,
VALUE => array(PR_CONTAINER_CLASS => $foldertype)
),
);
}
/**
* Returns subfolders of given type for a folder or false if there are none.
*
* @access public
*
* @param MAPIFolder $folder
* @param string $type
*
* @return MAPITable|boolean
*/
public static function GetSubfoldersForType($folder, $type) {
$subfolders = mapi_folder_gethierarchytable($folder, CONVENIENT_DEPTH);
mapi_table_restrict($subfolders, MAPIUtils::GetFolderTypeRestriction($type));
if (mapi_table_getrowcount($subfolders) > 0) {
return mapi_table_queryallrows($subfolders, array(PR_ENTRYID));
}
return false;
}
/**
* Checks if mapimessage is inside the synchronization interval
* also defined by MAPIUtils::GetEmailRestriction()
......
This diff is collapsed.
......@@ -188,6 +188,21 @@ abstract class Backend implements IBackend {
return $settings;
}
/**
* Resolves recipients
*
* @param SyncObject $resolveRecipients
*
* @access public
* @return SyncObject $resolveRecipients
*/
public function ResolveRecipients($resolveRecipients) {
$r = new SyncResolveRecipients();
$r->status = SYNC_RESOLVERECIPSSTATUS_PROTOCOLERROR;
$r->recipient = array();
return $r;
}
/**----------------------------------------------------------------------------------------------------------
* Protected methods for BackendStorage
......
......@@ -279,6 +279,16 @@ interface IBackend {
* @return SyncObject $settings
*/
public function Settings($settings);
/**
* Resolves recipients
*
* @param SyncObject $resolveRecipients
*
* @access public
* @return SyncObject $resolveRecipients
*/
public function ResolveRecipients($resolveRecipients);
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment