use Friendica\Core\Worker;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
-use Friendica\Model\GContact;
use Friendica\Model\Item;
use Friendica\Protocol\Diaspora;
use Friendica\Protocol\Email;
$verb = notags(trim($_REQUEST['verb']));
$emailcc = notags(trim($_REQUEST['emailcc']));
$body = escape_tags(trim($_REQUEST['body']));
- $network = notags(trim($_REQUEST['network']));
+ $network = notags(trim(defaults($_REQUEST, 'network', NETWORK_DFRN)));
$guid = get_guid(32);
$postopts = defaults($_REQUEST, 'postopts', '');
$datarray['owner-name'] = $contact_record['name'];
$datarray['owner-link'] = $contact_record['url'];
$datarray['owner-avatar'] = $contact_record['thumb'];
- $datarray['owner-id'] = Contact::getIdForURL($datarray['owner-link'], 0);
+ $datarray['owner-id'] = Contact::getIdForURL($datarray['owner-link']);
$datarray['author-name'] = $author['name'];
$datarray['author-link'] = $author['url'];
$datarray['author-avatar'] = $author['thumb'];
- $datarray['author-id'] = Contact::getIdForURL($datarray['author-link'], 0);
+ $datarray['author-id'] = Contact::getIdForURL($datarray['author-link']);
$datarray['created'] = DateTimeFormat::utcNow();
$datarray['edited'] = DateTimeFormat::utcNow();
$datarray['commented'] = DateTimeFormat::utcNow();
$datarray['postopts'] = $postopts;
$datarray['origin'] = $origin;
$datarray['moderated'] = false;
- $datarray['gcontact-id'] = GContact::getId(["url" => $datarray['author-link'], "network" => $datarray['network'],
- "photo" => $datarray['author-avatar'], "name" => $datarray['author-name']]);
$datarray['object'] = $object;
/*
$link = '<a href="' . System::baseUrl() . '/profile/' . $a->user['nickname'] . '"><img src="' . $author['thumb'] . '" alt="' . $a->user['username'] . '" /></a><br /><br />';
$html = prepare_body($datarray);
$message = '<html><body>' . $link . $html . $disclaimer . '</body></html>';
- include_once 'include/html2plain.php';
$params = [
'fromName' => $a->user['username'],
'fromEmail' => $a->user['email'],
'replyTo' => $a->user['email'],
'messageSubject' => $subject,
'htmlVersion' => $message,
- 'textVersion' => html2plain($html.$disclaimer)
+ 'textVersion' => Friendica\Content\Text\HTML::toPlaintext($html.$disclaimer)
];
Emailer::send($params);
}
$o = '';
if (($a->argc == 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) {
if (is_ajax()) {
- $o = Item::delete($a->argv[2]);
+ $o = Item::deleteById($a->argv[2]);
} else {
$o = drop_item($a->argv[2]);
}