use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Database\DBM;
-use Friendica\Model\GlobalContact;
+use Friendica\Model\Contact;
+use Friendica\Model\GContact;
use Friendica\Network\Probe;
-use Friendica\Object\Contact;
+use Friendica\Object\Image;
use Friendica\Util\Lock;
use Friendica\Util\XML;
use dba;
require_once 'include/items.php';
require_once 'mod/share.php';
require_once 'include/enotify.php';
-require_once 'include/Photo.php';
require_once 'include/follow.php';
require_once 'include/api.php';
require_once 'mod/proxy.php';
// Only update the contacts if it is an OStatus contact
if ($r && ($r['id'] > 0) && !$onlyfetch && ($contact["network"] == NETWORK_OSTATUS)) {
- // This contact is vital, so we awake it from the dead
- Contact::unmarkForArchival($contact);
// Update contact data
-
$current = $contact;
unset($current['name-date']);
if (!empty($author["author-avatar"]) && ($author["author-avatar"] != $current['avatar'])) {
logger("Update profile picture for contact ".$contact["id"], LOGGER_DEBUG);
- update_contact_avatar($author["author-avatar"], $importer["uid"], $contact["id"]);
+ Contact::updateAvatar($author["author-avatar"], $importer["uid"], $contact["id"]);
}
// Ensure that we are having this contact (with uid=0)
dba::update('contact', $fields, array('id' => $cid), $old_contact);
// Update the avatar
- update_contact_avatar($author["author-avatar"], 0, $cid);
+ Contact::updateAvatar($author["author-avatar"], 0, $cid);
}
$contact["generation"] = 2;
$contact["hide"] = false; // OStatus contacts are never hidden
$contact["photo"] = $author["author-avatar"];
- $gcid = GlobalContact::update($contact);
+ $gcid = GContact::update($contact);
- GlobalContact::link($gcid, $contact["uid"], $contact["id"]);
+ GContact::link($gcid, $contact["uid"], $contact["id"]);
}
return $author;
* @param array $importer user record of the importing user
* @param array $contact contact
* @param string $hub Called by reference, returns the fetched hub data
+ * @return void
*/
public static function import($xml, $importer, &$contact, &$hub)
{
*
* @param string $xml The XML
* @param array $importer user record of the importing user
- * @param array $contact
+ * @param array $contact contact
* @param string $hub Called by reference, returns the fetched hub data
* @param boolean $stored Is the post fresh imported or from the database?
* @param boolean $initialize Is it the leading post so that data has to be initialized?
return true;
}
+ /**
+ * @param object $item item
+ * @return void
+ */
private static function deleteNotice($item)
{
$condition = array('uid' => $item['uid'], 'author-link' => $item['author-link'], 'uri' => $item['uri']);
* @param object $entry The xml entry that is processed
* @param array $item The item array
* @param array $importer user record of the importing user
+ * @return void
*/
private static function processPost($xpath, $entry, &$item, $importer)
{
*
* @param string $conversation The link to the conversation
* @param string $conversation_uri The conversation in "uri" format
+ * @return void
*/
private static function fetchConversation($conversation, $conversation_uri)
{
* @param string $xml The feed
* @param string $conversation conversation
* @param string $conversation_uri conversation uri
+ * @return void
*/
private static function storeConversation($xml, $conversation = '', $conversation_uri = '')
{
/**
* @brief Fetch the own post so that it can be stored later
- * @param array $item The item array
*
* We want to store the original data for later processing.
* This function is meant for cases where we process a feed with multiple entries.
* In that case we need to fetch the single posts here.
*
* @param string $self The link to the self item
+ * @param array $item The item array
+ * @return void
*/
private static function fetchSelf($self, &$item)
{
* @param string $related The link to the related item
* @param string $related_uri The related item in "uri" format
* @param array $importer user record of the importing user
+ * @return void
*/
private static function fetchRelated($related, $related_uri, $importer)
{
* @param object $doc XML document
* @param object $root XML root element where the hub links are added
* @param object $nick nick
+ * @return void
*/
public static function hublinks($doc, $root, $nick)
{
* @param object $doc XML document
* @param object $root XML root element where the hub links are added
* @param array $item Data of the item that is to be posted
+ * @return void
*/
private static function getAttachment($doc, $root, $item)
{
switch ($siteinfo["type"]) {
case 'photo':
- $imgdata = get_photo_info($siteinfo["image"]);
+ $imgdata = Image::getInfoFromURL($siteinfo["image"]);
$attributes = array("rel" => "enclosure",
"href" => $siteinfo["image"],
"type" => $imgdata["mime"],
}
if (!Config::get('system', 'ostatus_not_attach_preview') && ($siteinfo["type"] != "photo") && isset($siteinfo["image"])) {
- $imgdata = get_photo_info($siteinfo["image"]);
+ $imgdata = Image::getInfoFromURL($siteinfo["image"]);
$attributes = array("rel" => "enclosure",
"href" => $siteinfo["image"],
"type" => $imgdata["mime"],
* @param object $doc XML document
* @param array $item Data of the item that is to be posted
* @param array $owner Contact data of the poster
- * @param $repeated_guid
+ * @param string $repeated_guid guid
* @param bool $toplevel Is it for en entry element (false) or a feed entry (true)?
*
* @return object Entry element
* @param string $title Title for the post
* @param string $verb The activity verb
* @param bool $complete Add the "status_net" element?
+ * @return void
*/
private static function entryContent($doc, $entry, $item, $owner, $title, $verb = "", $complete = true)
{
* @param array $item Data of the item that is to be posted
* @param array $owner Contact data of the poster
* @param bool $complete default true
+ * @return void
*/
private static function entryFooter($doc, $entry, $item, $owner, $complete = true)
{