<?php
+/**
+ * @file mod/item.php
+ */
/*
* This is the POST destination for most all locally posted
* Posts that originate externally or do not fall into the above
* posting categories go through item_store() instead of this function.
*/
-
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\System;
use Friendica\Core\Worker;
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\Protocol\Diaspora;
+use Friendica\Protocol\Email;
use Friendica\Util\Emailer;
require_once 'include/crypto.php';
require_once 'include/enotify.php';
-require_once 'include/email.php';
require_once 'include/tags.php';
require_once 'include/files.php';
require_once 'include/threads.php';
$datarray['postopts'] = $postopts;
$datarray['origin'] = $origin;
$datarray['moderated'] = $allow_moderated;
- $datarray['gcontact-id'] = GlobalContact::getId(array("url" => $datarray['author-link'], "network" => $datarray['network'],
+ $datarray['gcontact-id'] = GContact::getId(array("url" => $datarray['author-link'], "network" => $datarray['network'],
"photo" => $datarray['author-avatar'], "name" => $datarray['author-name']));
$datarray['object'] = $object;
$disclaimer .= sprintf( t('You may visit them online at %s'), System::baseUrl() . '/profile/' . $a->user['nickname']) . EOL;
$disclaimer .= t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . EOL;
if (!$datarray['title']=='') {
- $subject = email_header_encode($datarray['title'], 'UTF-8');
+ $subject = Email::encodeHeader($datarray['title'], 'UTF-8');
} else {
- $subject = email_header_encode('[Friendica]' . ' ' . sprintf( t('%s posted an update.'), $a->user['username']), 'UTF-8');
+ $subject = Email::encodeHeader('[Friendica]' . ' ' . sprintf( t('%s posted an update.'), $a->user['username']), 'UTF-8');
}
$link = '<a href="' . System::baseUrl() . '/profile/' . $a->user['nickname'] . '"><img src="' . $author['thumb'] . '" alt="' . $a->user['username'] . '" /></a><br /><br />';
$html = prepare_body($datarray);
if (!DBM::is_result($r)) {
$probed = Probe::uri($name);
if ($result['network'] != NETWORK_PHANTOM) {
- GlobalContact::update($probed);
+ GContact::update($probed);
$r = q("SELECT `url`, `name`, `nick`, `network`, `alias`, `notify` FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
dbesc(normalise_link($probed["url"])));
}