use Friendica\Core\Worker;
use Friendica\Core\System;
use Friendica\Database\DBM;
-use Friendica\Model\GlobalContact;
-use Friendica\Object\Contact;
+use Friendica\Model\Contact;
+use Friendica\Model\GContact;
+use Friendica\Model\Group;
+use Friendica\Model\User;
+use Friendica\Object\Image;
use Friendica\Protocol\DFRN;
use Friendica\Protocol\OStatus;
-use Friendica\Util\Lock;
+use Friendica\Protocol\Feed;
require_once 'include/bbcode.php';
require_once 'include/oembed.php';
require_once 'include/text.php';
require_once 'include/threads.php';
require_once 'include/plaintext.php';
-require_once 'include/feed.php';
require_once 'mod/share.php';
require_once 'include/enotify.php';
-require_once 'include/group.php';
function construct_verb($item) {
if ($item['verb']) {
* The purpose of this function is to apply system message length limits to
* imported messages without including any embedded photos in the length
*/
-if (! function_exists('limit_body_size')) {
function limit_body_size($body) {
// logger('limit_body_size: start', LOGGER_DEBUG);
} else {
return $body;
}
-}}
+}
function title_is_body($title, $body) {
* On comments the author is the better choice.
*/
if ($arr['parent-uri'] === $arr['uri']) {
- $arr["gcontact-id"] = GlobalContact::getId(array("url" => $arr['owner-link'], "network" => $arr['network'],
+ $arr["gcontact-id"] = GContact::getId(array("url" => $arr['owner-link'], "network" => $arr['network'],
"photo" => $arr['owner-avatar'], "name" => $arr['owner-name']));
} else {
- $arr["gcontact-id"] = GlobalContact::getId(array("url" => $arr['author-link'], "network" => $arr['network'],
+ $arr["gcontact-id"] = GContact::getId(array("url" => $arr['author-link'], "network" => $arr['network'],
"photo" => $arr['author-avatar'], "name" => $arr['author-name']));
}
}
if ($contact['network'] === NETWORK_FEED) {
if ($pass < 2) {
logger("Consume feeds", LOGGER_DEBUG);
- feed_import($xml, $importer, $contact, $hub);
+ Feed::import($xml, $importer, $contact, $hub);
}
return;
}
'hash' => $hash, 'datetime' => datetime_convert()));
}
- $def_gid = get_default_group($importer['uid'], $contact_record["network"]);
-
- if (intval($def_gid)) {
- group_add_member($importer['uid'], '', $contact_record['id'], $def_gid);
- }
+ Group::addMember(User::getDefaultGroup($importer['uid'], $contact_record["network"]), $contact_record['id']);
if (($r[0]['notify-flags'] & NOTIFY_INTRO) &&
in_array($r[0]['page-flags'], array(PAGE_NORMAL))) {
$width = intval($match[1]);
$height = intval($match[2]);
- $ph = new Photo($data, $type);
- if ($ph->isValid()) {
- $ph->scaleImage(max($width, $height));
- $data = $ph->imageString();
- $type = $ph->getType();
+ $Image = new Image($data, $type);
+ if ($Image->isValid()) {
+ $Image->scaleDown(max($width, $height));
+ $data = $Image->asString();
+ $type = $Image->getType();
}
}
/// @TODO type-hint is array
function enumerate_permissions($obj) {
$allow_people = expand_acl($obj['allow_cid']);
- $allow_groups = expand_groups(expand_acl($obj['allow_gid']));
+ $allow_groups = Group::expand(expand_acl($obj['allow_gid']));
$deny_people = expand_acl($obj['deny_cid']);
- $deny_groups = expand_groups(expand_acl($obj['deny_gid']));
+ $deny_groups = Group::expand(expand_acl($obj['deny_gid']));
$recipients = array_unique(array_merge($allow_people, $allow_groups));
$deny = array_unique(array_merge($deny_people, $deny_groups));
$recipients = array_diff($recipients, $deny);
// Now delete them
if ($parentid != "") {
- $r = q("DELETE FROM `item_id` WHERE `iid` IN (%s)", dbesc($parentid));
$r = q("DELETE FROM `sign` WHERE `iid` IN (%s)", dbesc($parentid));
}