Merge pull request #5789 from friendica/master

Update develop from master-2019.09
This commit is contained in:
Hypolite Petovan 2018-09-23 18:55:20 -04:00 committed by GitHub
commit a6996601d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
125 changed files with 17335 additions and 17104 deletions

View file

@ -17,6 +17,7 @@ use Friendica\Model\Profile;
use Friendica\Network\Probe;
use Friendica\Object\Image;
use Friendica\Protocol\Diaspora;
use Friendica\Protocol\DFRN;
use Friendica\Protocol\OStatus;
use Friendica\Protocol\PortableContact;
use Friendica\Protocol\Salmon;
@ -528,13 +529,16 @@ class Contact extends BaseObject
/**
* @brief Sends an unfriend message. Does not remove the contact
*
* @param array $user User unfriending
* @param array $contact Contact unfriended
* @param array $user User unfriending
* @param array $contact Contact unfriended
* @param boolean $dissolve Remove the contact on the remote side
* @return void
*/
public static function terminateFriendship(array $user, array $contact)
public static function terminateFriendship(array $user, array $contact, $dissolve = false)
{
if (in_array($contact['network'], [Protocol::OSTATUS, Protocol::DFRN])) {
if (($contact['network'] == Protocol::DFRN) && $dissolve) {
DFRN::deliver($user, $contact, 'placeholder', true);
} elseif (in_array($contact['network'], [Protocol::OSTATUS, Protocol::DFRN])) {
// create an unfollow slap
$item = [];
$item['verb'] = NAMESPACE_OSTATUS . "/unfollow";
@ -1076,6 +1080,11 @@ class Contact extends BaseObject
if (empty($data)) {
$data = Probe::uri($url, "", $uid);
// Ensure that there is a gserver entry
if (!empty($data['baseurl']) && ($data['network'] != Protocol::PHANTOM)) {
PortableContact::checkServer($data['baseurl']);
}
}
// Last try in gcontact for unsupported networks

View file

@ -12,6 +12,7 @@ use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Map;
@ -589,6 +590,12 @@ class Event extends BaseObject
$title = strip_tags(html_entity_decode($title, ENT_QUOTES, 'UTF-8'));
}
$author_link = $event['author-link'];
$plink = $event['plink'];
$event['author-link'] = Contact::magicLink($author_link);
$event['plink'] = Contact::magicLink($author_link, $plink);
$html = self::getHTML($event);
$event['desc'] = BBCode::convert($event['desc']);
$event['location'] = BBCode::convert($event['location']);

View file

@ -1462,15 +1462,6 @@ class Item extends BaseObject
return 0;
}
// These fields aren't stored anymore in the item table, they are fetched upon request
unset($item['author-link']);
unset($item['author-name']);
unset($item['author-avatar']);
unset($item['owner-link']);
unset($item['owner-name']);
unset($item['owner-avatar']);
if ($item['network'] == Protocol::PHANTOM) {
logger('Missing network. Called by: '.System::callstack(), LOGGER_DEBUG);
@ -1708,6 +1699,15 @@ class Item extends BaseObject
unset($item['postopts']);
unset($item['inform']);
// These fields aren't stored anymore in the item table, they are fetched upon request
unset($item['author-link']);
unset($item['author-name']);
unset($item['author-avatar']);
unset($item['owner-link']);
unset($item['owner-name']);
unset($item['owner-avatar']);
DBA::transaction();
$ret = DBA::insert('item', $item);

View file

@ -361,7 +361,7 @@ class Profile
if ($r) {
$remote_url = $r[0]['url'];
$message_path = preg_replace('=(.*)/profile/(.*)=ism', '$1/message/new/', $remote_url);
$wallmessage_link = $message_path . base64_encode($profile['addr']);
$wallmessage_link = $message_path . base64_encode(defaults($profile, 'addr', ''));
} else if (!empty($profile['nickname'])) {
$wallmessage_link = 'wallmessage/' . $profile['nickname'];
}
@ -492,7 +492,7 @@ class Profile
if (isset($p['address'])) {
$p['address'] = BBCode::convert($p['address']);
} else {
} elseif (isset($p['location'])) {
$p['address'] = BBCode::convert($p['location']);
}

View file

@ -730,7 +730,7 @@ class User
DBA::insert('userd', ['username' => $user['nickname']]);
// The user and related data will be deleted in "cron_expire_and_remove_users" (cronjobs.php)
DBA::update('user', ['account_removed' => true, 'account_expires_on' => DateTimeFormat::utc($t . " + 7 day")], ['uid' => $uid]);
DBA::update('user', ['account_removed' => true, 'account_expires_on' => DateTimeFormat::utc(DateTimeFormat::utcNow() . " + 7 day")], ['uid' => $uid]);
Worker::add(PRIORITY_HIGH, "Notifier", "removeme", $uid);
// Send an update to the directory