Merge remote-tracking branch 'upstream/develop' into develop
This commit is contained in:
commit
db441ca1ce
42 changed files with 8608 additions and 7998 deletions
|
@ -89,6 +89,9 @@ php bin/composer.phar install
|
|||
#cp /vagrant/util/htconfig.vagrant.php /vagrant/.htconfig.php
|
||||
cp /vagrant/util/local.ini.vagrant.php /vagrant/config/local.ini.php
|
||||
|
||||
# copy the .htaccess-dist file to .htaccess so that rewrite rules work
|
||||
cp /vagrant/.htaccess-dist /vagrant/.htaccess
|
||||
|
||||
# create the friendica database
|
||||
echo "create database friendica DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" | $MYSQL -u root -proot
|
||||
# import test database
|
||||
|
|
14
database.sql
14
database.sql
|
@ -1,6 +1,6 @@
|
|||
-- ------------------------------------------
|
||||
-- Friendica 2018.12-dev (The Tazmans Flax-lily)
|
||||
-- DB_UPDATE_VERSION 1287
|
||||
-- DB_UPDATE_VERSION 1290
|
||||
-- ------------------------------------------
|
||||
|
||||
|
||||
|
@ -42,6 +42,7 @@ CREATE TABLE IF NOT EXISTS `apcontact` (
|
|||
`updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
|
||||
PRIMARY KEY(`url`),
|
||||
INDEX `addr` (`addr`(32)),
|
||||
INDEX `alias` (`alias`(190)),
|
||||
INDEX `url` (`followers`(190))
|
||||
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='ActivityPub compatible contacts - used in the ActivityPub implementation';
|
||||
|
||||
|
@ -598,7 +599,8 @@ CREATE TABLE IF NOT EXISTS `item-activity` (
|
|||
`activity` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
|
||||
PRIMARY KEY(`id`),
|
||||
UNIQUE INDEX `uri-hash` (`uri-hash`),
|
||||
INDEX `uri` (`uri`(191))
|
||||
INDEX `uri` (`uri`(191)),
|
||||
INDEX `uri-id` (`uri-id`)
|
||||
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Activities for items';
|
||||
|
||||
--
|
||||
|
@ -626,7 +628,8 @@ CREATE TABLE IF NOT EXISTS `item-content` (
|
|||
`verb` varchar(100) NOT NULL DEFAULT '' COMMENT 'ActivityStreams verb',
|
||||
PRIMARY KEY(`id`),
|
||||
UNIQUE INDEX `uri-plink-hash` (`uri-plink-hash`),
|
||||
INDEX `uri` (`uri`(191))
|
||||
INDEX `uri` (`uri`(191)),
|
||||
INDEX `uri-id` (`uri-id`)
|
||||
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Content for all posts';
|
||||
|
||||
--
|
||||
|
@ -1258,7 +1261,10 @@ CREATE TABLE IF NOT EXISTS `workerqueue` (
|
|||
INDEX `pid` (`pid`),
|
||||
INDEX `parameter` (`parameter`(64)),
|
||||
INDEX `priority_created_next_try` (`priority`,`created`,`next_try`),
|
||||
INDEX `done_executed_next_try` (`done`,`executed`,`next_try`)
|
||||
INDEX `done_priority_executed_next_try` (`done`,`priority`,`executed`,`next_try`),
|
||||
INDEX `done_executed_next_try` (`done`,`executed`,`next_try`),
|
||||
INDEX `done_priority_next_try` (`done`,`priority`,`next_try`),
|
||||
INDEX `done_next_try` (`done`,`next_try`)
|
||||
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Background tasks queue entries';
|
||||
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ General
|
|||
* i - Only show ignored contacts
|
||||
* y - Only show archived contacts
|
||||
* h - Only show hidden contacts
|
||||
* e - Edit contact groups
|
||||
|
||||
../contacts (single contact view)
|
||||
-------------------------------
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1649,6 +1649,7 @@ function api_statuses_home_timeline($type)
|
|||
$data = ['status' => $ret];
|
||||
switch ($type) {
|
||||
case "atom":
|
||||
break;
|
||||
case "rss":
|
||||
$data = api_rss_extra($a, $data, $user_info);
|
||||
break;
|
||||
|
@ -1731,6 +1732,7 @@ function api_statuses_public_timeline($type)
|
|||
$data = ['status' => $ret];
|
||||
switch ($type) {
|
||||
case "atom":
|
||||
break;
|
||||
case "rss":
|
||||
$data = api_rss_extra($a, $data, $user_info);
|
||||
break;
|
||||
|
@ -1787,6 +1789,7 @@ function api_statuses_networkpublic_timeline($type)
|
|||
$data = ['status' => $ret];
|
||||
switch ($type) {
|
||||
case "atom":
|
||||
break;
|
||||
case "rss":
|
||||
$data = api_rss_extra($a, $data, $user_info);
|
||||
break;
|
||||
|
@ -2108,6 +2111,7 @@ function api_statuses_mentions($type)
|
|||
$data = ['status' => $ret];
|
||||
switch ($type) {
|
||||
case "atom":
|
||||
break;
|
||||
case "rss":
|
||||
$data = api_rss_extra($a, $data, $user_info);
|
||||
break;
|
||||
|
@ -2188,6 +2192,7 @@ function api_statuses_user_timeline($type)
|
|||
$data = ['status' => $ret];
|
||||
switch ($type) {
|
||||
case "atom":
|
||||
break;
|
||||
case "rss":
|
||||
$data = api_rss_extra($a, $data, $user_info);
|
||||
break;
|
||||
|
@ -2263,8 +2268,10 @@ function api_favorites_create_destroy($type)
|
|||
$data = ['status' => $ret];
|
||||
switch ($type) {
|
||||
case "atom":
|
||||
break;
|
||||
case "rss":
|
||||
$data = api_rss_extra($a, $data, $user_info);
|
||||
break;
|
||||
}
|
||||
|
||||
return api_format_data("status", $type, $data);
|
||||
|
@ -2330,8 +2337,10 @@ function api_favorites($type)
|
|||
$data = ['status' => $ret];
|
||||
switch ($type) {
|
||||
case "atom":
|
||||
break;
|
||||
case "rss":
|
||||
$data = api_rss_extra($a, $data, $user_info);
|
||||
break;
|
||||
}
|
||||
|
||||
return api_format_data("statuses", $type, $data);
|
||||
|
@ -2923,6 +2932,7 @@ function api_format_items($r, $user_info, $filter_user = false, $type = "json")
|
|||
$retweeted_item = api_share_as_retweet($item);
|
||||
if ($retweeted_item !== false) {
|
||||
$retweeted_status = $status;
|
||||
$status['user'] = $status['friendica_owner'];
|
||||
try {
|
||||
$retweeted_status["user"] = api_get_user($a, $retweeted_item["author-id"]);
|
||||
} catch (BadRequestException $e) {
|
||||
|
@ -3144,6 +3154,7 @@ function api_lists_statuses($type)
|
|||
$data = ['status' => $items];
|
||||
switch ($type) {
|
||||
case "atom":
|
||||
break;
|
||||
case "rss":
|
||||
$data = api_rss_extra($a, $data, $user_info);
|
||||
break;
|
||||
|
@ -3540,8 +3551,10 @@ function api_direct_messages_new($type)
|
|||
|
||||
switch ($type) {
|
||||
case "atom":
|
||||
break;
|
||||
case "rss":
|
||||
$data = api_rss_extra($a, $data, $sender);
|
||||
break;
|
||||
}
|
||||
|
||||
return api_format_data("direct-messages", $type, $data);
|
||||
|
@ -3806,8 +3819,10 @@ function api_direct_messages_box($type, $box, $verbose)
|
|||
$data = ['direct_message' => $ret];
|
||||
switch ($type) {
|
||||
case "atom":
|
||||
break;
|
||||
case "rss":
|
||||
$data = api_rss_extra($a, $data, $user_info);
|
||||
break;
|
||||
}
|
||||
|
||||
return api_format_data("direct-messages", $type, $data);
|
||||
|
|
|
@ -352,7 +352,7 @@ function drop_item($id, $return = '')
|
|||
|
||||
// locate item to be deleted
|
||||
|
||||
$fields = ['id', 'uid', 'guid', 'contact-id', 'deleted'];
|
||||
$fields = ['id', 'uid', 'guid', 'contact-id', 'deleted', 'gravity'];
|
||||
$item = Item::selectFirstForUser(local_user(), $fields, ['id' => $id]);
|
||||
|
||||
if (!DBA::isResult($item)) {
|
||||
|
@ -407,6 +407,8 @@ function drop_item($id, $return = '')
|
|||
$a->internalRedirect('display/' . $item['guid']);
|
||||
}
|
||||
|
||||
$is_comment = ($item['gravity'] == GRAVITY_COMMENT) ? true : false;
|
||||
|
||||
// delete the item
|
||||
Item::deleteForUser(['id' => $item['id']], local_user());
|
||||
|
||||
|
@ -415,7 +417,8 @@ function drop_item($id, $return = '')
|
|||
// removes update_* from return_url to ignore Ajax refresh
|
||||
$return_url = str_replace("update_", "", $return_url);
|
||||
|
||||
if (empty($return_url) || strpos($return_url, 'display') !== false) {
|
||||
// if unknown location or top level post called from display
|
||||
if (empty($return_url) || ((strpos($return_url, 'display') !== false) AND (!$is_comment))) {
|
||||
$a->internalRedirect('network');
|
||||
//NOTREACHED
|
||||
}
|
||||
|
|
|
@ -651,6 +651,29 @@ function admin_page_federation(App $a)
|
|||
$v[$key] = ['total' => $v[$key]['total'], 'version' => L10n::t('unknown')];
|
||||
}
|
||||
}
|
||||
|
||||
// Reformat and compact version numbers
|
||||
if ($p == 'Pleroma') {
|
||||
$compacted = [];
|
||||
|
||||
foreach ($v as $key => $value) {
|
||||
$version = $v[$key]['version'];
|
||||
$parts = explode(' ', trim($version));
|
||||
do {
|
||||
$part = array_pop($parts);
|
||||
} while (!empty($parts) && ((strlen($part) >= 40) || (strlen($part) <= 3)));
|
||||
|
||||
if (!empty($part)) {
|
||||
$compacted[$part] += $v[$key]['total'];
|
||||
}
|
||||
}
|
||||
|
||||
$v = [];
|
||||
foreach ($compacted as $version => $total) {
|
||||
$v[] = ['version' => $version, 'total' => $total];
|
||||
}
|
||||
}
|
||||
|
||||
// in the DB the Diaspora versions have the format x.x.x.x-xx the last
|
||||
// part (-xx) should be removed to clean up the versions from the "head
|
||||
// commit" information and combined into a single entry for x.x.x.x
|
||||
|
|
|
@ -562,7 +562,11 @@ function dfrn_poll_content(App $a)
|
|||
break;
|
||||
default:
|
||||
$appendix = (strstr($destination_url, '?') ? '&f=&redir=1' : '?f=&redir=1');
|
||||
System::externalRedirect($destination_url . $appendix);
|
||||
if (filter_var($url, FILTER_VALIDATE_URL)) {
|
||||
System::externalRedirect($destination_url . $appendix);
|
||||
} else {
|
||||
$a->internalRedirect($destination_url . $appendix);
|
||||
}
|
||||
break;
|
||||
}
|
||||
// NOTREACHED
|
||||
|
|
|
@ -121,23 +121,23 @@ function dirfind_content(App $a, $prefix = "") {
|
|||
|
||||
/// @TODO These 2 SELECTs are not checked on validity with DBA::isResult()
|
||||
$count = q("SELECT count(*) AS `total` FROM `gcontact`
|
||||
WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s') AND
|
||||
WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s', '%s') AND
|
||||
((`last_contact` >= `last_failure`) OR (`updated` >= `last_failure`)) AND
|
||||
(`url` LIKE '%s' OR `name` LIKE '%s' OR `location` LIKE '%s' OR
|
||||
`addr` LIKE '%s' OR `about` LIKE '%s' OR `keywords` LIKE '%s') $extra_sql",
|
||||
DBA::escape(Protocol::DFRN), DBA::escape($ostatus), DBA::escape($diaspora),
|
||||
DBA::escape(Protocol::ACTIVITYPUB), DBA::escape(Protocol::DFRN), DBA::escape($ostatus), DBA::escape($diaspora),
|
||||
DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)),
|
||||
DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)));
|
||||
|
||||
$results = q("SELECT `nurl`
|
||||
FROM `gcontact`
|
||||
WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s') AND
|
||||
WHERE NOT `hide` AND `network` IN ('%s', '%s', '%s', '%s') AND
|
||||
((`last_contact` >= `last_failure`) OR (`updated` >= `last_failure`)) AND
|
||||
(`url` LIKE '%s' OR `name` LIKE '%s' OR `location` LIKE '%s' OR
|
||||
`addr` LIKE '%s' OR `about` LIKE '%s' OR `keywords` LIKE '%s') $extra_sql
|
||||
GROUP BY `nurl`
|
||||
ORDER BY `updated` DESC LIMIT %d, %d",
|
||||
DBA::escape(Protocol::DFRN), DBA::escape($ostatus), DBA::escape($diaspora),
|
||||
DBA::escape(Protocol::ACTIVITYPUB), DBA::escape(Protocol::DFRN), DBA::escape($ostatus), DBA::escape($diaspora),
|
||||
DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)),
|
||||
DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)), DBA::escape(Strings::escapeHtml($search2)),
|
||||
$pager->getStart(), $pager->getItemsPerPage());
|
||||
|
|
|
@ -14,7 +14,7 @@ function filerm_content(App $a)
|
|||
}
|
||||
|
||||
$term = XML::unescape(trim($_GET['term']));
|
||||
$cat = XML::unescape(trim($_GET['cat']));
|
||||
$cat = XML::unescape(trim(defaults($_GET, 'cat', '')));
|
||||
|
||||
$category = (($cat) ? true : false);
|
||||
|
||||
|
@ -25,12 +25,17 @@ function filerm_content(App $a)
|
|||
|
||||
$item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
|
||||
|
||||
Logger::log('filerm: tag ' . $term . ' item ' . $item_id);
|
||||
Logger::log('filerm: tag ' . $term . ' item ' . $item_id . ' category ' . ($category ? 'true' : 'false'));
|
||||
|
||||
if ($item_id && strlen($term))
|
||||
{
|
||||
FileTag::unsaveFile(local_user(), $item_id, $term, $category);
|
||||
if ($item_id && strlen($term)) {
|
||||
if (FileTag::unsaveFile(local_user(), $item_id, $term, $category)) {
|
||||
info('Item removed');
|
||||
}
|
||||
}
|
||||
else {
|
||||
info('Item was not deleted');
|
||||
}
|
||||
|
||||
$a->internalRedirect('/network?f=&file=' . $term);
|
||||
killme();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ function follow_post(App $a)
|
|||
}
|
||||
|
||||
if (isset($_REQUEST['cancel'])) {
|
||||
$a->internalRedirect('contacts');
|
||||
$a->internalRedirect('contact');
|
||||
}
|
||||
|
||||
$uid = local_user();
|
||||
|
@ -52,7 +52,7 @@ function follow_post(App $a)
|
|||
|
||||
function follow_content(App $a)
|
||||
{
|
||||
$return_path = 'contacts';
|
||||
$return_path = 'contact';
|
||||
|
||||
if (!local_user()) {
|
||||
notice(L10n::t('Permission denied.'));
|
||||
|
|
|
@ -468,7 +468,7 @@ function item_post(App $a) {
|
|||
|
||||
$fields = ['allow_cid' => $str_contact_allow, 'allow_gid' => $str_group_allow,
|
||||
'deny_cid' => $str_contact_deny, 'deny_gid' => $str_group_deny];
|
||||
$condition = ['resource-id' => $image_uri, 'uid' => $profile_uid, 'album' => L10n::t('Wall Photos')];
|
||||
$condition = ['resource-id' => $image_uri, 'uid' => $profile_uid];
|
||||
DBA::update('photo', $fields, $condition);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -346,6 +346,11 @@ function networkConversation(App $a, $items, Pager $pager, $mode, $update, $orde
|
|||
// Set this so that the conversation function can find out contact info for our wall-wall items
|
||||
$a->page_contact = $a->contact;
|
||||
|
||||
if (!is_array($items)) {
|
||||
Logger::log("Expecting items to be an array. Got " . print_r($items, true));
|
||||
$items = [];
|
||||
}
|
||||
|
||||
$o = conversation($a, $items, $pager, $mode, $update, false, $ordering, local_user());
|
||||
|
||||
if (!$update) {
|
||||
|
@ -389,6 +394,10 @@ function network_content(App $a, $update = 0, $parent = 0)
|
|||
$o = networkThreadedView($a, $update, $parent);
|
||||
}
|
||||
|
||||
if ($o === '') {
|
||||
info("No items found");
|
||||
}
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
@ -463,6 +472,9 @@ function networkFlatView(App $a, $update = 0)
|
|||
}
|
||||
DBA::close($result);
|
||||
|
||||
if (count($posts) == 0) {
|
||||
return '';
|
||||
}
|
||||
$condition = ['uid' => local_user(), 'id' => $posts];
|
||||
} else {
|
||||
$condition = ['uid' => local_user()];
|
||||
|
|
|
@ -36,6 +36,11 @@ function noscrape_init(App $a)
|
|||
'account-type' => $a->profile['account-type'],
|
||||
];
|
||||
|
||||
$dfrn_pages = ['request', 'confirm', 'notify', 'poll'];
|
||||
foreach ($dfrn_pages as $dfrn) {
|
||||
$json_info["dfrn-{$dfrn}"] = System::baseUrl()."/dfrn_{$dfrn}/{$which}";
|
||||
}
|
||||
|
||||
if (!$a->profile['net-publish'] || $a->profile['hidewall']) {
|
||||
header('Content-type: application/json; charset=utf-8');
|
||||
$json_info["hide"] = true;
|
||||
|
@ -99,11 +104,6 @@ function noscrape_init(App $a)
|
|||
}
|
||||
}
|
||||
|
||||
$dfrn_pages = ['request', 'confirm', 'notify', 'poll'];
|
||||
foreach ($dfrn_pages as $dfrn) {
|
||||
$json_info["dfrn-{$dfrn}"] = System::baseUrl()."/dfrn_{$dfrn}/{$which}";
|
||||
}
|
||||
|
||||
//Output all the JSON!
|
||||
header('Content-type: application/json; charset=utf-8');
|
||||
echo json_encode($json_info);
|
||||
|
|
|
@ -59,8 +59,8 @@ function profile_init(App $a)
|
|||
$user = DBA::selectFirst('user', ['uid'], ['nickname' => $which]);
|
||||
if (DBA::isResult($user)) {
|
||||
$data = ActivityPub\Transmitter::getProfile($user['uid']);
|
||||
echo json_encode($data);
|
||||
header('Content-Type: application/activity+json');
|
||||
echo json_encode($data);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ function profile_init(App $a)
|
|||
}
|
||||
|
||||
$a->page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . ($a->profile['net-publish'] ? 'true' : 'false') . '" />' . "\r\n";
|
||||
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/dfrn_poll/' . $which . '" title="' . L10n::t('%s\'s timeline', $a->profile['username']) . '"/>' . "\r\n";
|
||||
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/dfrn_poll/' . $which . '" title="DFRN: ' . L10n::t('%s\'s timeline', $a->profile['username']) . '"/>' . "\r\n";
|
||||
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/" title="' . L10n::t('%s\'s posts', $a->profile['username']) . '"/>' . "\r\n";
|
||||
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/comments" title="' . L10n::t('%s\'s comments', $a->profile['username']) . '"/>' . "\r\n";
|
||||
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . $which . '/activity" title="' . L10n::t('%s\'s timeline', $a->profile['username']) . '"/>' . "\r\n";
|
||||
|
@ -268,6 +268,8 @@ function profile_content(App $a, $update = 0)
|
|||
if (!DBA::isResult($items)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$pager = new Pager($a->query_string);
|
||||
} else {
|
||||
$sql_post_table = "";
|
||||
|
||||
|
|
|
@ -50,13 +50,15 @@ function pubsubhubbub_init(App $a) {
|
|||
|
||||
Logger::log("$hub_mode request from " . $_SERVER['REMOTE_ADDR']);
|
||||
|
||||
// get the nick name from the topic, a bit hacky but needed as a fallback
|
||||
$nick = substr(strrchr($hub_topic, "/"), 1);
|
||||
|
||||
// Normally the url should now contain the nick name as last part of the url
|
||||
if ($a->argc > 1) {
|
||||
// Normally the url should now contain the nick name as last part of the url
|
||||
$nick = $a->argv[1];
|
||||
} else {
|
||||
// Get the nick name from the topic as a fallback
|
||||
$nick = $hub_topic;
|
||||
}
|
||||
// Extract nick name and strip any .atom extension
|
||||
$nick = basename($nick, '.atom');
|
||||
|
||||
if (!$nick) {
|
||||
Logger::log('Bad hub_topic=$hub_topic, ignoring.');
|
||||
|
@ -65,7 +67,7 @@ function pubsubhubbub_init(App $a) {
|
|||
|
||||
// fetch user from database given the nickname
|
||||
$condition = ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false];
|
||||
$owner = DBA::selectFirst('user', ['uid', 'hidewall'], $condition);
|
||||
$owner = DBA::selectFirst('user', ['uid', 'hidewall', 'nickname'], $condition);
|
||||
if (!DBA::isResult($owner)) {
|
||||
Logger::log('Local account not found: ' . $nick . ' - topic: ' . $hub_topic . ' - callback: ' . $hub_callback);
|
||||
System::httpExit(404);
|
||||
|
@ -88,25 +90,32 @@ function pubsubhubbub_init(App $a) {
|
|||
|
||||
// sanity check that topic URLs are the same
|
||||
$hub_topic2 = str_replace('/feed/', '/dfrn_poll/', $hub_topic);
|
||||
if (!Strings::compareLink($hub_topic, $contact['poll']) && !Strings::compareLink($hub_topic2, $contact['poll'])) {
|
||||
$self = System::baseUrl() . '/api/statuses/user_timeline/' . $owner['nickname'] . '.atom';
|
||||
|
||||
if (!Strings::compareLink($hub_topic, $contact['poll']) && !Strings::compareLink($hub_topic2, $contact['poll']) && !Strings::compareLink($hub_topic, $self)) {
|
||||
Logger::log('Hub topic ' . $hub_topic . ' != ' . $contact['poll']);
|
||||
System::httpExit(404);
|
||||
}
|
||||
|
||||
// do subscriber verification according to the PuSH protocol
|
||||
$hub_challenge = Strings::getRandomHex(40);
|
||||
$params = 'hub.mode=' .
|
||||
($subscribe == 1 ? 'subscribe' : 'unsubscribe') .
|
||||
'&hub.topic=' . urlencode($hub_topic) .
|
||||
'&hub.challenge=' . $hub_challenge .
|
||||
'&hub.lease_seconds=604800' .
|
||||
'&hub.verify_token=' . $hub_verify_token;
|
||||
|
||||
// lease time is hard coded to one week (in seconds)
|
||||
// we don't actually enforce the lease time because GNU
|
||||
// Social/StatusNet doesn't honour it (yet)
|
||||
$params = http_build_query([
|
||||
'hub.mode' => $subscribe == 1 ? 'subscribe' : 'unsubscribe',
|
||||
'hub.topic' => $hub_topic,
|
||||
'hub.challenge' => $hub_challenge,
|
||||
'hub.verify_token' => $hub_verify_token,
|
||||
|
||||
$fetchResult = Network::fetchUrlFull($hub_callback . "?" . $params);
|
||||
// lease time is hard coded to one week (in seconds)
|
||||
// we don't actually enforce the lease time because GNU
|
||||
// Social/StatusNet doesn't honour it (yet)
|
||||
'hub.lease_seconds' => 604800,
|
||||
]);
|
||||
|
||||
$hub_callback = rtrim($hub_callback, ' ?&#');
|
||||
$separator = parse_url($hub_callback, PHP_URL_QUERY) === null ? '?' : '&';
|
||||
|
||||
$fetchResult = Network::fetchUrlFull($hub_callback . $separator . $params);
|
||||
$body = $fetchResult->getBody();
|
||||
$ret = $fetchResult->getReturnCode();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ use Friendica\Util\Strings;
|
|||
|
||||
function unfollow_post(App $a)
|
||||
{
|
||||
$return_path = 'contacts';
|
||||
$base_return_path = 'contact';
|
||||
|
||||
if (!local_user()) {
|
||||
notice(L10n::t('Permission denied.'));
|
||||
|
@ -34,17 +34,17 @@ function unfollow_post(App $a)
|
|||
|
||||
if (!DBA::isResult($contact)) {
|
||||
notice(L10n::t("You aren't following this contact."));
|
||||
$a->internalRedirect($return_path);
|
||||
$a->internalRedirect($base_return_path);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
||||
if (!empty($_REQUEST['cancel'])) {
|
||||
$a->internalRedirect($return_path . '/' . $contact['id']);
|
||||
$a->internalRedirect($base_return_path . '/' . $contact['id']);
|
||||
}
|
||||
|
||||
if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
|
||||
notice(L10n::t('Unfollowing is currently not supported by your network.'));
|
||||
$a->internalRedirect($return_path . '/' . $contact['id']);
|
||||
$a->internalRedirect($base_return_path . '/' . $contact['id']);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
||||
|
@ -58,10 +58,10 @@ function unfollow_post(App $a)
|
|||
// Sharing-only contacts get deleted as there no relationship any more
|
||||
if ($dissolve) {
|
||||
Contact::remove($contact['id']);
|
||||
$return_path = 'contacts';
|
||||
$return_path = $base_return_path;
|
||||
} else {
|
||||
DBA::update('contact', ['rel' => Contact::FOLLOWER], ['id' => $contact['id']]);
|
||||
$return_path = 'contact/' . $contact['id'];
|
||||
$return_path = $base_return_path . '/' . $contact['id'];
|
||||
}
|
||||
|
||||
info(L10n::t('Contact unfollowed'));
|
||||
|
@ -71,7 +71,7 @@ function unfollow_post(App $a)
|
|||
|
||||
function unfollow_content(App $a)
|
||||
{
|
||||
$return_path = 'contacts';
|
||||
$base_return_path = 'contact';
|
||||
|
||||
if (!local_user()) {
|
||||
notice(L10n::t('Permission denied.'));
|
||||
|
@ -90,13 +90,13 @@ function unfollow_content(App $a)
|
|||
|
||||
if (!DBA::isResult($contact)) {
|
||||
notice(L10n::t("You aren't following this contact."));
|
||||
$a->internalRedirect($return_path);
|
||||
$a->internalRedirect($base_return_path);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
||||
if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
|
||||
notice(L10n::t('Unfollowing is currently not supported by your network.'));
|
||||
$a->internalRedirect('contact/' . $contact['id']);
|
||||
$a->internalRedirect($base_return_path . '/' . $contact['id']);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ function unfollow_content(App $a)
|
|||
|
||||
if (!DBA::isResult($self)) {
|
||||
notice(L10n::t('Permission denied.'));
|
||||
$a->internalRedirect($return_path);
|
||||
$a->internalRedirect($base_return_path);
|
||||
// NOTREACHED
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace Friendica\Core\Console;
|
|||
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Update;
|
||||
|
||||
/**
|
||||
* Performs database post updates
|
||||
|
@ -54,6 +55,10 @@ HELP;
|
|||
throw new \RuntimeException('Database isn\'t ready or populated yet');
|
||||
}
|
||||
|
||||
echo L10n::t('Check for pending update actions.') . "\n";
|
||||
Update::run(true, true, false);
|
||||
echo L10n::t('Done.') . "\n";
|
||||
|
||||
echo L10n::t('Execute pending post updates.') . "\n";
|
||||
|
||||
while (!\Friendica\Database\PostUpdate::update()) {
|
||||
|
|
|
@ -7,6 +7,7 @@ namespace Friendica\Core;
|
|||
use Friendica\App;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Model\Photo;
|
||||
use Friendica\Object\Image;
|
||||
|
@ -129,6 +130,9 @@ class UserImport
|
|||
$old_handle = $account['user']['nickname'].$oldaddr;
|
||||
}
|
||||
|
||||
// Creating a new guid to avoid problems with Diaspora
|
||||
$account['user']['guid'] = System::createUUID();
|
||||
|
||||
$olduid = $account['user']['uid'];
|
||||
|
||||
unset($account['user']['uid']);
|
||||
|
|
|
@ -329,8 +329,9 @@ class DBStructure
|
|||
}
|
||||
|
||||
if (isset($database[$name]["table_status"]["Comment"])) {
|
||||
if ($database[$name]["table_status"]["Comment"] != $structure['comment']) {
|
||||
$sql2 = "COMMENT = '".DBA::escape($structure['comment'])."'";
|
||||
$structurecomment = defaults($structure, "comment", "");
|
||||
if ($database[$name]["table_status"]["Comment"] != $structurecomment) {
|
||||
$sql2 = "COMMENT = '".DBA::escape($structurecomment)."'";
|
||||
|
||||
if ($sql3 == "") {
|
||||
$sql3 = "ALTER" . $ignore . " TABLE `".$temp_name."` ".$sql2;
|
||||
|
|
|
@ -65,7 +65,8 @@ class LegacyModule extends BaseModule
|
|||
$function_name = static::$moduleName . '_' . $function_suffix;
|
||||
|
||||
if (\function_exists($function_name)) {
|
||||
return $function_name(self::getApp());
|
||||
$a = self::getApp();
|
||||
return $function_name($a);
|
||||
} else {
|
||||
return parent::{$function_suffix}();
|
||||
}
|
||||
|
|
|
@ -291,6 +291,7 @@ class FileTag
|
|||
}
|
||||
|
||||
$fields = ['file' => str_replace($pattern, '', $item['file'])];
|
||||
|
||||
Item::update($fields, ['id' => $item_id]);
|
||||
|
||||
$r = q("SELECT `oid` FROM `term` WHERE `term` = '%s' AND `otype` = %d AND `type` = %d AND `uid` = %d",
|
||||
|
|
|
@ -430,7 +430,7 @@ class GContact
|
|||
// return $list;
|
||||
//}
|
||||
|
||||
$network = [Protocol::DFRN];
|
||||
$network = [Protocol::DFRN, Protocol::ACTIVITYPUB];
|
||||
|
||||
if (Config::get('system', 'diaspora_enabled')) {
|
||||
$network[] = Protocol::DIASPORA;
|
||||
|
@ -451,7 +451,7 @@ class GContact
|
|||
where uid = %d and not gcontact.nurl in ( select nurl from contact where uid = %d )
|
||||
AND NOT `gcontact`.`name` IN (SELECT `name` FROM `contact` WHERE `uid` = %d)
|
||||
AND NOT `gcontact`.`id` IN (SELECT `gcid` FROM `gcign` WHERE `uid` = %d)
|
||||
AND `gcontact`.`updated` >= '%s'
|
||||
AND `gcontact`.`updated` >= '%s' AND NOT `gcontact`.`hide`
|
||||
AND `gcontact`.`last_contact` >= `gcontact`.`last_failure`
|
||||
AND `gcontact`.`network` IN (%s)
|
||||
GROUP BY `glink`.`gcid` ORDER BY `gcontact`.`updated` DESC,`total` DESC LIMIT %d, %d",
|
||||
|
|
|
@ -832,7 +832,7 @@ class Item extends BaseObject
|
|||
$files = $fields['file'];
|
||||
$fields['file'] = null;
|
||||
} else {
|
||||
$files = '';
|
||||
$files = null;
|
||||
}
|
||||
|
||||
$delivery_data = ['postopts' => defaults($fields, 'postopts', ''),
|
||||
|
@ -911,7 +911,7 @@ class Item extends BaseObject
|
|||
}
|
||||
}
|
||||
|
||||
if (!empty($files)) {
|
||||
if (!is_null($files)) {
|
||||
Term::insertFromFileFieldByItemId($item['id'], $files);
|
||||
if (!empty($item['file'])) {
|
||||
DBA::update('item', ['file' => ''], ['id' => $item['id']]);
|
||||
|
@ -1011,10 +1011,8 @@ class Item extends BaseObject
|
|||
$matches = false;
|
||||
$cnt = preg_match_all('/<(.*?)>/', $item['file'], $matches, PREG_SET_ORDER);
|
||||
|
||||
if ($cnt)
|
||||
{
|
||||
foreach ($matches as $mtch)
|
||||
{
|
||||
if ($cnt) {
|
||||
foreach ($matches as $mtch) {
|
||||
FileTag::unsaveFile($item['uid'], $item['id'], $mtch[1],true);
|
||||
}
|
||||
}
|
||||
|
@ -1023,10 +1021,8 @@ class Item extends BaseObject
|
|||
|
||||
$cnt = preg_match_all('/\[(.*?)\]/', $item['file'], $matches, PREG_SET_ORDER);
|
||||
|
||||
if ($cnt)
|
||||
{
|
||||
foreach ($matches as $mtch)
|
||||
{
|
||||
if ($cnt) {
|
||||
foreach ($matches as $mtch) {
|
||||
FileTag::unsaveFile($item['uid'], $item['id'], $mtch[1],false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -221,7 +221,7 @@ class Contact extends BaseModule
|
|||
$priority = 0;
|
||||
}
|
||||
|
||||
$info = Strings::escapeHtml(trim($_POST['info']));
|
||||
$info = Strings::escapeHtml(trim(defaults($_POST, 'info', '')));
|
||||
|
||||
$r = DBA::update('contact', [
|
||||
'profile-id' => $profile_id,
|
||||
|
@ -755,6 +755,14 @@ class Contact extends BaseModule
|
|||
'id' => 'showhidden-tab',
|
||||
'accesskey' => 'h',
|
||||
],
|
||||
[
|
||||
'label' => L10n::t('Groups'),
|
||||
'url' => 'group',
|
||||
'sel' => ($hidden) ? 'active' : '',
|
||||
'title' => L10n::t('Organize your contact groups'),
|
||||
'id' => 'contactgroups-tab',
|
||||
'accesskey' => 'e',
|
||||
],
|
||||
];
|
||||
|
||||
$tab_tpl = Renderer::getMarkupTemplate('common_tabs.tpl');
|
||||
|
|
|
@ -54,7 +54,7 @@ class Feed extends BaseModule
|
|||
|
||||
$nickname = $a->argv[1];
|
||||
header("Content-type: application/atom+xml");
|
||||
echo OStatus::feed($nickname, $last_update, 10, $type, $nocache);
|
||||
echo OStatus::feed($nickname, $last_update, 10, $type, $nocache, true);
|
||||
killme();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ class Login extends BaseModule
|
|||
$a->internalRedirect();
|
||||
}
|
||||
|
||||
return self::form($_SESSION['return_path'], intval(Config::get('config', 'register_policy')) !== REGISTER_CLOSED);
|
||||
return self::form(defaults($_SESSION, 'return_path', null), intval(Config::get('config', 'register_policy')) !== REGISTER_CLOSED);
|
||||
}
|
||||
|
||||
public static function post()
|
||||
|
|
|
@ -133,6 +133,11 @@ class CurlResult
|
|||
{
|
||||
$this->isSuccess = ($this->returnCode >= 200 && $this->returnCode <= 299) || $this->errorNumber == 0;
|
||||
|
||||
// Everything higher or equal 400 is not a success
|
||||
if ($this->returnCode >= 400) {
|
||||
$this->isSuccess = false;
|
||||
}
|
||||
|
||||
if (!$this->isSuccess) {
|
||||
Logger::log('error: ' . $this->url . ': ' . $this->returnCode . ' - ' . $this->error, Logger::INFO);
|
||||
Logger::log('debug: ' . print_r($this->info, true), Logger::DATA);
|
||||
|
|
|
@ -157,11 +157,13 @@ class Post extends BaseObject
|
|||
|
||||
$shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != 1;
|
||||
|
||||
if (local_user() && Strings::compareLink($a->contact['url'], $item['author-link'])) {
|
||||
if ($item["event-id"] != 0) {
|
||||
$edpost = ["events/event/" . $item['event-id'], L10n::t("Edit")];
|
||||
} else {
|
||||
$edpost = ["editpost/" . $item['id'], L10n::t("Edit")];
|
||||
if (local_user()) {
|
||||
if (Strings::compareLink($a->contact['url'], $item['author-link'])) {
|
||||
if ($item["event-id"] != 0) {
|
||||
$edpost = ["events/event/" . $item['event-id'], L10n::t("Edit")];
|
||||
} else {
|
||||
$edpost = ["editpost/" . $item['id'], L10n::t("Edit")];
|
||||
}
|
||||
}
|
||||
$dropping = in_array($item['uid'], [0, local_user()]);
|
||||
} else {
|
||||
|
@ -190,8 +192,13 @@ class Post extends BaseObject
|
|||
}
|
||||
}
|
||||
|
||||
// Showing the one or the other text, depending upon if we can only hide it or really delete it.
|
||||
$delete = $origin ? L10n::t('Delete globally') : L10n::t('Remove locally');
|
||||
if ($origin && ($item['id'] != $item['parent']) && ($item['network'] == Protocol::ACTIVITYPUB)) {
|
||||
// ActivityPub doesn't allow removal of remote comments
|
||||
$delete = L10n::t('Delete locally');
|
||||
} else {
|
||||
// Showing the one or the other text, depending upon if we can only hide it or really delete it.
|
||||
$delete = $origin ? L10n::t('Delete globally') : L10n::t('Remove locally');
|
||||
}
|
||||
|
||||
$drop = [
|
||||
'dropping' => $dropping,
|
||||
|
@ -200,7 +207,7 @@ class Post extends BaseObject
|
|||
'delete' => $delete,
|
||||
];
|
||||
|
||||
if (!local_user() || ($item['uid'] == 0)) {
|
||||
if (!local_user()) {
|
||||
$drop = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1320,7 +1320,7 @@ class OStatus
|
|||
$attributes = ["href" => System::baseUrl() . "/salmon/" . $owner["nick"], "rel" => "http://salmon-protocol.org/ns/salmon-mention"];
|
||||
XML::addElement($doc, $root, "link", "", $attributes);
|
||||
|
||||
$attributes = ["href" => System::baseUrl() . "/api/statuses/user_timeline/" . $owner["nick"] . ".atom",
|
||||
$attributes = ["href" => System::baseUrl() . "/dfrn_poll/" . $owner["nick"],
|
||||
"rel" => "self", "type" => "application/atom+xml"];
|
||||
XML::addElement($doc, $root, "link", "", $attributes);
|
||||
|
||||
|
@ -1538,14 +1538,15 @@ class OStatus
|
|||
/**
|
||||
* @brief Adds an entry element to the XML document
|
||||
*
|
||||
* @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 bool $toplevel optional default false
|
||||
* @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 bool $toplevel optional default false
|
||||
* @param bool $feed_mode Behave like a regular feed for users if true
|
||||
*
|
||||
* @return object Entry element
|
||||
*/
|
||||
private static function entry(DOMDocument $doc, array $item, array $owner, $toplevel = false)
|
||||
private static function entry(DOMDocument $doc, array $item, array $owner, $toplevel = false, $feed_mode = false)
|
||||
{
|
||||
$xml = null;
|
||||
|
||||
|
@ -1563,7 +1564,7 @@ class OStatus
|
|||
} elseif (in_array($item["verb"], [ACTIVITY_FOLLOW, NAMESPACE_OSTATUS."/unfollow"])) {
|
||||
return self::followEntry($doc, $item, $owner, $toplevel);
|
||||
} else {
|
||||
return self::noteEntry($doc, $item, $owner, $toplevel);
|
||||
return self::noteEntry($doc, $item, $owner, $toplevel, $feed_mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1853,14 +1854,15 @@ class OStatus
|
|||
/**
|
||||
* @brief Adds a regular entry element
|
||||
*
|
||||
* @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 bool $toplevel Is it for en entry element (false) or a feed entry (true)?
|
||||
* @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 bool $toplevel Is it for en entry element (false) or a feed entry (true)?
|
||||
* @param bool $feed_mode Behave like a regular feed for users if true
|
||||
*
|
||||
* @return object Entry element
|
||||
*/
|
||||
private static function noteEntry(DOMDocument $doc, array $item, array $owner, $toplevel)
|
||||
private static function noteEntry(DOMDocument $doc, array $item, array $owner, $toplevel, $feed_mode)
|
||||
{
|
||||
if (($item["id"] != $item["parent"]) && (Strings::normaliseLink($item["author-link"]) != Strings::normaliseLink($owner["url"]))) {
|
||||
Logger::log("OStatus entry is from author ".$owner["url"]." - not from ".$item["author-link"].". Quitting.", Logger::DEBUG);
|
||||
|
@ -1870,9 +1872,9 @@ class OStatus
|
|||
|
||||
XML::addElement($doc, $entry, "activity:object-type", ACTIVITY_OBJ_NOTE);
|
||||
|
||||
self::entryContent($doc, $entry, $item, $owner, $title);
|
||||
self::entryContent($doc, $entry, $item, $owner, $title, '', true, $feed_mode);
|
||||
|
||||
self::entryFooter($doc, $entry, $item, $owner);
|
||||
self::entryFooter($doc, $entry, $item, $owner, !$feed_mode, $feed_mode);
|
||||
|
||||
return $entry;
|
||||
}
|
||||
|
@ -1892,7 +1894,11 @@ class OStatus
|
|||
/// @todo Check if this title stuff is really needed (I guess not)
|
||||
if (!$toplevel) {
|
||||
$entry = $doc->createElement("entry");
|
||||
$title = sprintf("New note by %s", $owner["nick"]);
|
||||
if (!empty($item['title'])) {
|
||||
$title = BBCode::convert($item['title'], false, 7);
|
||||
} else {
|
||||
$title = sprintf("New note by %s", $owner["nick"]);
|
||||
}
|
||||
|
||||
if ($owner['account-type'] == Contact::ACCOUNT_TYPE_COMMUNITY) {
|
||||
$contact = self::contactEntry($item['author-link'], $owner);
|
||||
|
@ -1922,27 +1928,28 @@ class OStatus
|
|||
/**
|
||||
* @brief Adds elements to the XML document
|
||||
*
|
||||
* @param object $doc XML document
|
||||
* @param object $entry Entry element where the content is added
|
||||
* @param array $item Data of the item that is to be posted
|
||||
* @param array $owner Contact data of the poster
|
||||
* @param string $title Title for the post
|
||||
* @param string $verb The activity verb
|
||||
* @param bool $complete Add the "status_net" element?
|
||||
* @param object $doc XML document
|
||||
* @param object $entry Entry element where the content is added
|
||||
* @param array $item Data of the item that is to be posted
|
||||
* @param array $owner Contact data of the poster
|
||||
* @param string $title Title for the post
|
||||
* @param string $verb The activity verb
|
||||
* @param bool $complete Add the "status_net" element?
|
||||
* @param bool $feed_mode Behave like a regular feed for users if true
|
||||
* @return void
|
||||
*/
|
||||
private static function entryContent(DOMDocument $doc, $entry, array $item, array $owner, $title, $verb = "", $complete = true)
|
||||
private static function entryContent(DOMDocument $doc, $entry, array $item, array $owner, $title, $verb = "", $complete = true, $feed_mode = false)
|
||||
{
|
||||
if ($verb == "") {
|
||||
$verb = self::constructVerb($item);
|
||||
}
|
||||
|
||||
XML::addElement($doc, $entry, "id", $item["uri"]);
|
||||
XML::addElement($doc, $entry, "title", $title);
|
||||
XML::addElement($doc, $entry, "title", html_entity_decode($title, ENT_QUOTES, 'UTF-8'));
|
||||
|
||||
$body = self::formatPicturePost($item['body']);
|
||||
|
||||
if ($item['title'] != "") {
|
||||
if (!empty($item['title']) && !$feed_mode) {
|
||||
$body = "[b]".$item['title']."[/b]\n\n".$body;
|
||||
}
|
||||
|
||||
|
@ -1954,11 +1961,13 @@ class OStatus
|
|||
"href" => System::baseUrl()."/display/".$item["guid"]]
|
||||
);
|
||||
|
||||
if ($complete && ($item["id"] > 0)) {
|
||||
if (!$feed_mode && $complete && ($item["id"] > 0)) {
|
||||
XML::addElement($doc, $entry, "status_net", "", ["notice_id" => $item["id"]]);
|
||||
}
|
||||
|
||||
XML::addElement($doc, $entry, "activity:verb", $verb);
|
||||
if (!$feed_mode) {
|
||||
XML::addElement($doc, $entry, "activity:verb", $verb);
|
||||
}
|
||||
|
||||
XML::addElement($doc, $entry, "published", DateTimeFormat::utc($item["created"]."+00:00", DateTimeFormat::ATOM));
|
||||
XML::addElement($doc, $entry, "updated", DateTimeFormat::utc($item["edited"]."+00:00", DateTimeFormat::ATOM));
|
||||
|
@ -1967,14 +1976,15 @@ class OStatus
|
|||
/**
|
||||
* @brief Adds the elements at the foot of an entry to the XML document
|
||||
*
|
||||
* @param object $doc XML document
|
||||
* @param object $entry The entry element where the elements are added
|
||||
* @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
|
||||
* @param object $doc XML document
|
||||
* @param object $entry The entry element where the elements are added
|
||||
* @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
|
||||
* @param bool $feed_mode Behave like a regular feed for users if true
|
||||
* @return void
|
||||
*/
|
||||
private static function entryFooter(DOMDocument $doc, $entry, array $item, array $owner, $complete = true)
|
||||
private static function entryFooter(DOMDocument $doc, $entry, array $item, array $owner, $complete = true, $feed_mode = false)
|
||||
{
|
||||
$mentioned = [];
|
||||
|
||||
|
@ -2005,7 +2015,7 @@ class OStatus
|
|||
XML::addElement($doc, $entry, "link", "", $attributes);
|
||||
}
|
||||
|
||||
if (intval($item["parent"]) > 0) {
|
||||
if (!$feed_mode && (intval($item["parent"]) > 0)) {
|
||||
$conversation_href = $conversation_uri = str_replace('/objects/', '/context/', $item['parent-uri']);
|
||||
|
||||
if (isset($parent_item)) {
|
||||
|
@ -2077,7 +2087,7 @@ class OStatus
|
|||
]);
|
||||
}
|
||||
|
||||
if (!$item["private"]) {
|
||||
if (!$item["private"] && !$feed_mode) {
|
||||
XML::addElement($doc, $entry, "link", "", ["rel" => "ostatus:attention",
|
||||
"href" => "http://activityschema.org/collection/public"]);
|
||||
XML::addElement($doc, $entry, "link", "", ["rel" => "mentioned",
|
||||
|
@ -2134,10 +2144,11 @@ class OStatus
|
|||
* @param integer $max_items Number of maximum items to fetch
|
||||
* @param string $filter Feed items filter (activity, posts or comments)
|
||||
* @param boolean $nocache Wether to bypass caching
|
||||
* @param boolean $feed_mode Behave like a regular feed for users if true
|
||||
*
|
||||
* @return string XML feed
|
||||
*/
|
||||
public static function feed($owner_nick, &$last_update, $max_items = 300, $filter = 'activity', $nocache = false)
|
||||
public static function feed($owner_nick, &$last_update, $max_items = 300, $filter = 'activity', $nocache = false, $feed_mode = false)
|
||||
{
|
||||
$stamp = microtime(true);
|
||||
|
||||
|
@ -2201,7 +2212,8 @@ class OStatus
|
|||
if (Config::get('system', 'ostatus_debug')) {
|
||||
$item['body'] .= '🍼';
|
||||
}
|
||||
$entry = self::entry($doc, $item, $owner);
|
||||
|
||||
$entry = self::entry($doc, $item, $owner, false, $feed_mode);
|
||||
$root->appendChild($entry);
|
||||
|
||||
if ($last_update < $item['created']) {
|
||||
|
|
|
@ -1376,10 +1376,11 @@ class PortableContact
|
|||
}
|
||||
|
||||
$info = $data['info'];
|
||||
if (in_array($data['register_policy'], ['REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'])) {
|
||||
$register_policy = defaults($data, 'register_policy', REGISTER_CLOSED);
|
||||
if (in_array($register_policy, ['REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'])) {
|
||||
$register_policy = constant($data['register_policy']);
|
||||
} else {
|
||||
Logger::log("Register policy '{$data['register_policy']}' from $server_url is invalid.");
|
||||
Logger::log("Register policy '$register_policy' from $server_url is invalid.");
|
||||
$register_policy = REGISTER_CLOSED; // set a default value
|
||||
}
|
||||
$platform = $data['platform'];
|
||||
|
|
|
@ -214,7 +214,7 @@ class Delivery extends BaseObject
|
|||
*/
|
||||
private static function deliverDFRN($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup)
|
||||
{
|
||||
Logger::log('Deliver ' . $target_item["guid"] . ' via DFRN to ' . (empty($contact['addr']) ? $contact['url'] : $contact['addr']));
|
||||
Logger::log('Deliver ' . defaults($target_item, 'guid', $target_item['id']) . ' via DFRN to ' . (empty($contact['addr']) ? $contact['url'] : $contact['addr']));
|
||||
|
||||
if ($cmd == self::MAIL) {
|
||||
$item = $target_item;
|
||||
|
@ -242,7 +242,7 @@ class Delivery extends BaseObject
|
|||
$atom = DFRN::entries($msgitems, $owner);
|
||||
}
|
||||
|
||||
Logger::log('Notifier entry: ' . $contact["url"] . ' ' . $target_item["guid"] . ' entry: ' . $atom, Logger::DATA);
|
||||
Logger::log('Notifier entry: ' . $contact["url"] . ' ' . defaults($target_item, 'guid', $target_item['id']) . ' entry: ' . $atom, Logger::DATA);
|
||||
|
||||
$basepath = implode('/', array_slice(explode('/', $contact['url']), 0, 3));
|
||||
|
||||
|
@ -301,10 +301,10 @@ class Delivery extends BaseObject
|
|||
$deliver_status = DFRN::deliver($owner, $contact, $atom, false, true);
|
||||
}
|
||||
|
||||
Logger::log('Delivery to ' . $contact["url"] . ' with guid ' . $target_item["guid"] . ' returns ' . $deliver_status);
|
||||
Logger::log('Delivery to ' . $contact['url'] . ' with guid ' . defaults($target_item, 'guid', $target_item['id']) . ' returns ' . $deliver_status);
|
||||
|
||||
if ($deliver_status < 0) {
|
||||
Logger::log('Delivery failed: queuing message ' . $target_item["guid"] );
|
||||
Logger::log('Delivery failed: queuing message ' . defaults($target_item, 'guid', $target_item['id']));
|
||||
Queue::add($contact['id'], Protocol::DFRN, $atom, false, $target_item['guid']);
|
||||
}
|
||||
|
||||
|
@ -344,7 +344,7 @@ class Delivery extends BaseObject
|
|||
$loc = $contact['addr'];
|
||||
}
|
||||
|
||||
Logger::log('Deliver ' . $target_item["guid"] . ' via Diaspora to ' . $loc);
|
||||
Logger::log('Deliver ' . defaults($target_item, 'guid', $target_item['id']) . ' via Diaspora to ' . $loc);
|
||||
|
||||
if (Config::get('system', 'dfrn_only') || !Config::get('system', 'diaspora_enabled')) {
|
||||
return;
|
||||
|
@ -360,14 +360,14 @@ class Delivery extends BaseObject
|
|||
if (!$contact['pubkey'] && !$public_message) {
|
||||
return;
|
||||
}
|
||||
if (($target_item['deleted']) && (($target_item['uri'] === $target_item['parent-uri']) || $followup)) {
|
||||
if ($cmd == self::RELOCATION) {
|
||||
Diaspora::sendAccountMigration($owner, $contact, $owner['uid']);
|
||||
return;
|
||||
} elseif ($target_item['deleted'] && (($target_item['uri'] === $target_item['parent-uri']) || $followup)) {
|
||||
// top-level retraction
|
||||
Logger::log('diaspora retract: ' . $loc);
|
||||
Diaspora::sendRetraction($target_item, $owner, $contact, $public_message);
|
||||
return;
|
||||
} elseif ($cmd == self::RELOCATION) {
|
||||
Diaspora::sendAccountMigration($owner, $contact, $owner['uid']);
|
||||
return;
|
||||
} elseif ($followup) {
|
||||
// send comments and likes to owner to relay
|
||||
Logger::log('diaspora followup: ' . $loc);
|
||||
|
|
|
@ -24,7 +24,7 @@ class RemoveUser {
|
|||
do {
|
||||
$items = Item::select(['id'], $condition, ['limit' => 100]);
|
||||
while ($item = Item::fetch($items)) {
|
||||
Item::deleteById($item['id'], PRIORITY_LOW);
|
||||
Item::deleteById($item['id'], PRIORITY_NEGLIGIBLE);
|
||||
}
|
||||
DBA::close($items);
|
||||
} while (Item::exists($condition));
|
||||
|
|
|
@ -13,7 +13,7 @@ msgstr ""
|
|||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-10-31 09:45+0100\n"
|
||||
"PO-Revision-Date: 2018-10-31 19:03+0000\n"
|
||||
"PO-Revision-Date: 2018-11-01 17:16+0000\n"
|
||||
"Last-Translator: Aditoo\n"
|
||||
"Language-Team: Czech (http://www.transifex.com/Friendica/friendica/language/cs/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -3038,7 +3038,7 @@ msgstr "Nový uživatel"
|
|||
|
||||
#: mod/admin.php:1935
|
||||
msgid "Delete in"
|
||||
msgstr ""
|
||||
msgstr "Smazat v"
|
||||
|
||||
#: mod/admin.php:1940
|
||||
msgid ""
|
||||
|
@ -8931,7 +8931,7 @@ msgstr "Zadejte prosím požadované informace."
|
|||
msgid ""
|
||||
"system.username_min_length (%s) and system.username_max_length (%s) are "
|
||||
"excluding each other, swapping values."
|
||||
msgstr ""
|
||||
msgstr "system.username_min_length (%s) a system.username_max_length (%s) se vzájemně vylučují, čímž se vyměňují hodnoty."
|
||||
|
||||
#: src/Model/User.php:481
|
||||
#, php-format
|
||||
|
@ -9763,7 +9763,7 @@ msgstr "Formulářový bezpečnostní token nebyl správný. To pravděpodobně
|
|||
#: src/LegacyModule.php:29
|
||||
#, php-format
|
||||
msgid "Legacy module file not found: %s"
|
||||
msgstr ""
|
||||
msgstr "Soubor legacy modulu nenalezen: %s"
|
||||
|
||||
#: boot.php:549
|
||||
#, php-format
|
||||
|
|
|
@ -696,7 +696,7 @@ $a->strings["User blocked"] = "Uživatel zablokován";
|
|||
$a->strings["Site admin"] = "Administrátor webu";
|
||||
$a->strings["Account expired"] = "Účtu vypršela platnost";
|
||||
$a->strings["New User"] = "Nový uživatel";
|
||||
$a->strings["Delete in"] = "";
|
||||
$a->strings["Delete in"] = "Smazat v";
|
||||
$a->strings["Selected users will be deleted!\\n\\nEverything these users had posted on this site will be permanently deleted!\\n\\nAre you sure?"] = "Vybraní uživatelé budou smazáni!\\n\\n Vše, co tito uživatelé na těchto stránkách vytvořili, bude trvale odstraněno!\\n\\nOpravdu chcete pokračovat?";
|
||||
$a->strings["The user {0} will be deleted!\\n\\nEverything this user has posted on this site will be permanently deleted!\\n\\nAre you sure?"] = "Uživatel {0} bude smazán!\\n\\n Vše, co tento uživatel na těchto stránkách vytvořil, bude trvale odstraněno!\\n\\n Opravdu chcete pokračovat?";
|
||||
$a->strings["Name of the new user."] = "Jméno nového uživatele.";
|
||||
|
@ -2069,7 +2069,7 @@ $a->strings["Invalid OpenID url"] = "Neplatný odkaz OpenID";
|
|||
$a->strings["We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID."] = "Zaznamenali jsme problém s Vaším přihlášením prostřednictvím Vámi zadaným OpenID. Prosím ověřte si, že jste ID zadali správně. ";
|
||||
$a->strings["The error message was:"] = "Chybová zpráva byla:";
|
||||
$a->strings["Please enter the required information."] = "Zadejte prosím požadované informace.";
|
||||
$a->strings["system.username_min_length (%s) and system.username_max_length (%s) are excluding each other, swapping values."] = "";
|
||||
$a->strings["system.username_min_length (%s) and system.username_max_length (%s) are excluding each other, swapping values."] = "system.username_min_length (%s) a system.username_max_length (%s) se vzájemně vylučují, čímž se vyměňují hodnoty.";
|
||||
$a->strings["Username should be at least %s character."] = [
|
||||
0 => "Uživateleké jméno musí mít alespoň %s znak.",
|
||||
1 => "Uživateleké jméno musí mít alespoň %s znaky.",
|
||||
|
@ -2267,7 +2267,7 @@ $a->strings["show fewer"] = "zobrazit méně";
|
|||
$a->strings["toggle mobile"] = "přepínat mobilní zobrazení";
|
||||
$a->strings["No system theme config value set."] = "Není nastavena konfigurační hodnota systémového motivu.";
|
||||
$a->strings["The form security token was not correct. This probably happened because the form has been opened for too long (>3 hours) before submitting it."] = "Formulářový bezpečnostní token nebyl správný. To pravděpodobně nastalo kvůli tom, že formulář byl otevřen příliš dlouho (>3 hodiny) před jeho odesláním.";
|
||||
$a->strings["Legacy module file not found: %s"] = "";
|
||||
$a->strings["Legacy module file not found: %s"] = "Soubor legacy modulu nenalezen: %s";
|
||||
$a->strings["Update %s failed. See error logs."] = "Aktualizace %s selhala. Zkontrolujte protokol chyb.";
|
||||
$a->strings["%s: Updating author-id and owner-id in item and thread table. "] = "%s: Aktualizuji author-id a owner-id v tabulce položek a vláken.";
|
||||
$a->strings["%s: Updating post-type."] = "%s: Aktualizuji post-type.";
|
||||
|
|
12989
view/lang/fr/messages.po
12989
view/lang/fr/messages.po
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -57,7 +57,7 @@ msgstr ""
|
|||
"Project-Id-Version: friendica\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-10-31 09:45+0100\n"
|
||||
"PO-Revision-Date: 2018-10-31 15:07+0000\n"
|
||||
"PO-Revision-Date: 2018-11-06 19:33+0000\n"
|
||||
"Last-Translator: Waldemar Stoczkowski <waldemar.stoczkowski@gmail.com>\n"
|
||||
"Language-Team: Polish (http://www.transifex.com/Friendica/friendica/language/pl/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -8981,19 +8981,19 @@ msgstr "system.username_min_length (%s) i system.username_max_length (%s) wykluc
|
|||
#, php-format
|
||||
msgid "Username should be at least %s character."
|
||||
msgid_plural "Username should be at least %s characters."
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
msgstr[2] ""
|
||||
msgstr[3] ""
|
||||
msgstr[0] "Nazwa użytkownika powinna wynosić co najmniej %s znaków."
|
||||
msgstr[1] "Nazwa użytkownika powinna wynosić co najmniej %s znaków."
|
||||
msgstr[2] "Nazwa użytkownika powinna wynosić co najmniej %s znaków."
|
||||
msgstr[3] "Nazwa użytkownika powinna wynosić co najmniej %s znaków."
|
||||
|
||||
#: src/Model/User.php:485
|
||||
#, php-format
|
||||
msgid "Username should be at most %s character."
|
||||
msgid_plural "Username should be at most %s characters."
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
msgstr[2] ""
|
||||
msgstr[3] ""
|
||||
msgstr[0] "Nazwa użytkownika nie może mieć więcej niż %s znaków."
|
||||
msgstr[1] "Nazwa użytkownika nie może mieć więcej niż %s znaków."
|
||||
msgstr[2] "Nazwa użytkownika nie może mieć więcej niż %s znaków."
|
||||
msgstr[3] "Nazwa użytkownika nie może mieć więcej niż %s znaków."
|
||||
|
||||
#: src/Model/User.php:493
|
||||
msgid "That doesn't appear to be your full (First Last) name."
|
||||
|
|
|
@ -2071,16 +2071,16 @@ $a->strings["The error message was:"] = "Komunikat o błędzie:";
|
|||
$a->strings["Please enter the required information."] = "Wprowadź wymagane informacje.";
|
||||
$a->strings["system.username_min_length (%s) and system.username_max_length (%s) are excluding each other, swapping values."] = "system.username_min_length (%s) i system.username_max_length (%s) wykluczają się nawzajem, zamieniając wartości.";
|
||||
$a->strings["Username should be at least %s character."] = [
|
||||
0 => "",
|
||||
1 => "",
|
||||
2 => "",
|
||||
3 => "",
|
||||
0 => "Nazwa użytkownika powinna wynosić co najmniej %s znaków.",
|
||||
1 => "Nazwa użytkownika powinna wynosić co najmniej %s znaków.",
|
||||
2 => "Nazwa użytkownika powinna wynosić co najmniej %s znaków.",
|
||||
3 => "Nazwa użytkownika powinna wynosić co najmniej %s znaków.",
|
||||
];
|
||||
$a->strings["Username should be at most %s character."] = [
|
||||
0 => "",
|
||||
1 => "",
|
||||
2 => "",
|
||||
3 => "",
|
||||
0 => "Nazwa użytkownika nie może mieć więcej niż %s znaków.",
|
||||
1 => "Nazwa użytkownika nie może mieć więcej niż %s znaków.",
|
||||
2 => "Nazwa użytkownika nie może mieć więcej niż %s znaków.",
|
||||
3 => "Nazwa użytkownika nie może mieć więcej niż %s znaków.",
|
||||
];
|
||||
$a->strings["That doesn't appear to be your full (First Last) name."] = "Wydaje mi się, że to nie jest twoje pełne imię (pierwsze imię) i nazwisko.";
|
||||
$a->strings["Your email domain is not among those allowed on this site."] = "Twoja domena internetowa nie jest obsługiwana na tej stronie.";
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<link rel="stylesheet" href="view/asset/perfect-scrollbar/css/perfect-scrollbar.min.css" type="text/css" media="screen" />
|
||||
|
||||
{{foreach $stylesheets as $stylesheetUrl}}
|
||||
<link rel="stylesheet" href="{{$stylesheetUrl}}" type="text/css" media="screen" />
|
||||
<link rel="stylesheet" href="{{$stylesheetUrl|escape:"html":"UTF-8"}}" type="text/css" media="screen" />
|
||||
{{/foreach}}
|
||||
|
||||
<link rel="shortcut icon" href="{{$shortcut_icon}}" />
|
||||
|
|
|
@ -373,9 +373,15 @@ function openClose(theID) {
|
|||
|
||||
function showHide(theID) {
|
||||
var elem = document.getElementById(theID);
|
||||
var edit = document.getElementById("comment-edit-submit-wrapper-" + theID.match('[0-9$]+'));
|
||||
|
||||
if( $(elem).is(':visible') ) {
|
||||
elem.style.display = "none";
|
||||
if ($(elem).is(':visible')) {
|
||||
if (!$(edit).is(':visible')) {
|
||||
edit.style.display = "block";
|
||||
}
|
||||
else {
|
||||
elem.style.display = "none";
|
||||
}
|
||||
}
|
||||
else {
|
||||
elem.style.display = "block";
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<link rel="stylesheet" href="view/theme/frio/font/open_sans/open-sans.css" type="text/css" media="screen"/>
|
||||
|
||||
{{foreach $stylesheets as $stylesheetUrl}}
|
||||
<link rel="stylesheet" href="{{$stylesheetUrl}}" type="text/css" media="screen" />
|
||||
<link rel="stylesheet" href="{{$stylesheetUrl|escape:"html":"UTF-8"}}" type="text/css" media="screen" />
|
||||
{{/foreach}}
|
||||
|
||||
{{* own css files *}}
|
||||
|
|
Loading…
Reference in a new issue