Merge remote-tracking branch 'upstream/2019.12-rc' into poco-cleanup

This commit is contained in:
Michael 2019-12-20 22:25:32 +00:00
commit 01205f7d41
10 changed files with 9274 additions and 9321 deletions

View file

@ -605,11 +605,6 @@ function api_get_user(App $a, $contact_id = null)
$contact = DBA::selectFirst('contact', [], ['uid' => 0, 'nurl' => Strings::normaliseLink($url)]);
if (DBA::isResult($contact)) {
// If no nick where given, extract it from the address
if (($contact['nick'] == "") || ($contact['name'] == $contact['nick'])) {
$contact['nick'] = api_get_nick($contact["url"]);
}
$ret = [
'id' => $contact["id"],
'id_str' => (string) $contact["id"],
@ -668,11 +663,6 @@ function api_get_user(App $a, $contact_id = null)
$countfollowers = 0;
$starred = 0;
// Add a nick if it isn't present there
if (($uinfo[0]['nick'] == "") || ($uinfo[0]['name'] == $uinfo[0]['nick'])) {
$uinfo[0]['nick'] = api_get_nick($uinfo[0]["url"]);
}
$pcontact_id = Contact::getIdForURL($uinfo[0]['url'], 0, true);
if (!empty($profile['about'])) {
@ -5240,91 +5230,6 @@ function api_share_as_retweet(&$item)
return $reshared_item;
}
/**
*
* @param string $profile
*
* @return string|false
* @throws InternalServerErrorException
* @todo remove trailing junk from profile url
* @todo pump.io check has to check the website
*/
function api_get_nick($profile)
{
$nick = "";
$r = q(
"SELECT `nick` FROM `contact` WHERE `uid` = 0 AND `nurl` = '%s'",
DBA::escape(Strings::normaliseLink($profile))
);
if (DBA::isResult($r)) {
$nick = $r[0]["nick"];
}
if (!$nick == "") {
$r = q(
"SELECT `nick` FROM `contact` WHERE `uid` = 0 AND `nurl` = '%s'",
DBA::escape(Strings::normaliseLink($profile))
);
if (DBA::isResult($r)) {
$nick = $r[0]["nick"];
}
}
if (!$nick == "") {
$friendica = preg_replace("=https?://(.*)/profile/(.*)=ism", "$2", $profile);
if ($friendica != $profile) {
$nick = $friendica;
}
}
if (!$nick == "") {
$diaspora = preg_replace("=https?://(.*)/u/(.*)=ism", "$2", $profile);
if ($diaspora != $profile) {
$nick = $diaspora;
}
}
if (!$nick == "") {
$twitter = preg_replace("=https?://twitter.com/(.*)=ism", "$1", $profile);
if ($twitter != $profile) {
$nick = $twitter;
}
}
if (!$nick == "") {
$StatusnetHost = preg_replace("=https?://(.*)/user/(.*)=ism", "$1", $profile);
if ($StatusnetHost != $profile) {
$StatusnetUser = preg_replace("=https?://(.*)/user/(.*)=ism", "$2", $profile);
if ($StatusnetUser != $profile) {
$UserData = Network::fetchUrl("http://".$StatusnetHost."/api/users/show.json?user_id=".$StatusnetUser);
$user = json_decode($UserData);
if ($user) {
$nick = $user->screen_name;
}
}
}
}
// To-Do: look at the page if its really a pumpio site
//if (!$nick == "") {
// $pumpio = preg_replace("=https?://(.*)/(.*)/=ism", "$2", $profile."/");
// if ($pumpio != $profile)
// $nick = $pumpio;
// <div class="media" id="profile-block" data-profile-id="acct:kabniel@microca.st">
//}
if ($nick != "") {
return $nick;
}
return false;
}
/**
*
* @param array $item
@ -5356,10 +5261,6 @@ function api_in_reply_to($item)
$parent = Item::selectFirst($fields, ['id' => $in_reply_to['status_id']]);
if (DBA::isResult($parent)) {
if ($parent['author-nick'] == "") {
$parent['author-nick'] = api_get_nick($parent['author-link']);
}
$in_reply_to['screen_name'] = (($parent['author-nick']) ? $parent['author-nick'] : $parent['author-name']);
$in_reply_to['user_id'] = intval($parent['author-id']);
$in_reply_to['user_id_str'] = (string) intval($parent['author-id']);

View file

@ -93,7 +93,8 @@ function display_init(App $a)
}
if ($item["id"] != $item["parent"]) {
$item = Item::selectFirstForUser($item_user, $fields, ['id' => $item["parent"]]);
$parent = Item::selectFirstForUser($item_user, $fields, ['id' => $item["parent"]]);
$item = $parent ?: $item;
}
$profiledata = display_fetchauthor($a, $item);
@ -242,16 +243,20 @@ function display_content(App $a, $update = false, $update_uid = 0)
$is_remote_contact = false;
$item_uid = local_user();
if (isset($item_parent_uri)) {
$parent = null;
if (!empty($item_parent_uri)) {
$parent = Item::selectFirst(['uid'], ['uri' => $item_parent_uri, 'wall' => true]);
if (DBA::isResult($parent)) {
$a->profile['uid'] = ($a->profile['uid'] ?? 0) ?: $parent['uid'];
$a->profile['profile_uid'] = ($a->profile['profile_uid'] ?? 0) ?: $parent['uid'];
$is_remote_contact = Session::getRemoteContactID($a->profile['profile_uid']);
if ($is_remote_contact) {
$item_uid = $parent['uid'];
}
}
if (DBA::isResult($parent)) {
$a->profile['uid'] = ($a->profile['uid'] ?? 0) ?: $parent['uid'];
$a->profile['profile_uid'] = ($a->profile['profile_uid'] ?? 0) ?: $parent['uid'];
$is_remote_contact = Session::getRemoteContactID($a->profile['profile_uid']);
if ($is_remote_contact) {
$item_uid = $parent['uid'];
}
} else {
$a->profile = ['uid' => intval($item['uid']), 'profile_uid' => intval($item['uid'])];
}
$page_contact = DBA::selectFirst('contact', [], ['self' => true, 'uid' => $a->profile['uid']]);

View file

@ -398,15 +398,15 @@ class BBCode extends BaseObject
*/
public static function removeAttachment($body, $no_link_desc = false)
{
return preg_replace_callback("/\[attachment (.*)\](.*?)\[\/attachment\]/ism",
return preg_replace_callback("/\s*\[attachment (.*)\](.*?)\[\/attachment\]\s*/ism",
function ($match) use ($no_link_desc) {
$attach_data = self::getAttachmentData($match[0]);
if (empty($attach_data['url'])) {
return $match[0];
} elseif (empty($attach_data['title']) || $no_link_desc) {
return '[url]' . $attach_data['url'] . "[/url]\n";
return "\n[url]" . $attach_data['url'] . "[/url]\n";
} else {
return '[url=' . $attach_data['url'] . ']' . $attach_data['title'] . "[/url]\n";
return "\n[url=" . $attach_data['url'] . ']' . $attach_data['title'] . "[/url]\n";
}
}, $body);
}

View file

@ -85,15 +85,20 @@ class Compose extends BaseModule
$type = 'post';
$doesFederate = true;
if ($_REQUEST['contact_allow']
. $_REQUEST['group_allow']
. $_REQUEST['contact_deny']
. $_REQUEST['group_deny'])
$contact_allow = $_REQUEST['contact_allow'] ?? '';
$group_allow = $_REQUEST['group_allow'] ?? '';
$contact_deny = $_REQUEST['contact_deny'] ?? '';
$group_deny = $_REQUEST['group_deny'] ?? '';
if ($contact_allow
. $group_allow
. $contact_deny
. $group_deny)
{
$contact_allow_list = $_REQUEST['contact_allow'] ? explode(',', $_REQUEST['contact_allow']) : [];
$group_allow_list = $_REQUEST['group_allow'] ? explode(',', $_REQUEST['group_allow']) : [];
$contact_deny_list = $_REQUEST['contact_deny'] ? explode(',', $_REQUEST['contact_deny']) : [];
$group_deny_list = $_REQUEST['group_deny'] ? explode(',', $_REQUEST['group_deny']) : [];
$contact_allow_list = $contact_allow ? explode(',', $contact_allow) : [];
$group_allow_list = $group_allow ? explode(',', $group_allow) : [];
$contact_deny_list = $contact_deny ? explode(',', $contact_deny) : [];
$group_deny_list = $group_deny ? explode(',', $group_deny) : [];
}
break;

View file

@ -562,7 +562,7 @@ class OnePoll
}
// Decoding the header
$subject = imap_mime_header_decode($meta->subject);
$subject = imap_mime_header_decode($meta->subject ?? '');
$datarray['title'] = "";
foreach ($subject as $subpart) {
if ($subpart->charset != "default") {

View file

@ -3717,28 +3717,6 @@ class ApiTest extends DatabaseTest
$this->markTestIncomplete();
}
/**
* Test the api_get_nick() function.
*
* @return void
*/
public function testApiGetNick()
{
$result = api_get_nick($this->otherUser['nurl']);
$this->assertEquals('othercontact', $result);
}
/**
* Test the api_get_nick() function with a wrong URL.
*
* @return void
*/
public function testApiGetNickWithWrongUrl()
{
$result = api_get_nick('wrong_url');
$this->assertFalse($result);
}
/**
* Test the api_in_reply_to() function.
*

View file

@ -11,8 +11,8 @@ msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-12-05 23:28+0100\n"
"PO-Revision-Date: 2019-12-15 01:10+0000\n"
"Last-Translator: fabrixxm <fabrix.xm@gmail.com>\n"
"PO-Revision-Date: 2019-12-20 02:40+0000\n"
"Last-Translator: ozero dien <rgfx0020+misc@gmail.com>\n"
"Language-Team: Japanese (http://www.transifex.com/Friendica/friendica/language/ja/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -1335,7 +1335,7 @@ msgstr "編集"
#: src/Object/Post.php:197
msgid "pinned item"
msgstr ""
msgstr "ピン留め項目"
#: src/Object/Post.php:202
msgid "Delete locally"
@ -1383,19 +1383,19 @@ msgstr "無視"
#: src/Object/Post.php:296
msgid "pin"
msgstr ""
msgstr "ピン留め"
#: src/Object/Post.php:297
msgid "unpin"
msgstr ""
msgstr "ピン留めを解除"
#: src/Object/Post.php:298
msgid "toggle pin status"
msgstr ""
msgstr "ピン留めを切り替え"
#: src/Object/Post.php:301
msgid "pinned"
msgstr ""
msgstr "ピン留めされました"
#: src/Object/Post.php:308
msgid "add star"
@ -1444,7 +1444,7 @@ msgstr "共有"
#: src/Object/Post.php:384
#, php-format
msgid "%s (Received %s)"
msgstr ""
msgstr "%s (%s を受け取りました)"
#: src/Object/Post.php:409
msgid "to"
@ -1667,7 +1667,7 @@ msgstr "Twitter"
#: src/Content/ContactSelector.php:128
msgid "Discourse"
msgstr ""
msgstr "Discourse"
#: src/Content/ContactSelector.php:129
msgid "Diaspora Connector"
@ -3469,7 +3469,7 @@ msgstr "ログインに失敗しました。"
#: src/Core/Authentication.php:239
msgid "Login failed. Please check your credentials."
msgstr ""
msgstr "ログインに失敗しました。認証情報を確かめてください。"
#: src/Core/Authentication.php:355
#, php-format
@ -3501,7 +3501,7 @@ msgstr "一般公開"
msgid ""
"This content will be shown to all your followers and can be seen in the "
"community pages and by anyone with its link."
msgstr ""
msgstr "このコンテンツはすべてのフォロワーに表示され、コミュニティページやリンクを知っている人なら誰でも見ることができます。"
#: src/Core/ACL.php:396
msgid "Limited/Private"
@ -3512,15 +3512,15 @@ msgid ""
"This content will be shown only to the people in the first box, to the "
"exception of the people mentioned in the second box. It won't appear "
"anywhere public."
msgstr ""
msgstr "このコンテンツは、最初のボックスに記載されたメンバーから、2番目のボックスに記載されている人を除いた範囲に対して表示されます。 一般公開はされません。"
#: src/Core/ACL.php:398
msgid "Show to:"
msgstr ""
msgstr "限定公開先:"
#: src/Core/ACL.php:399
msgid "Except to:"
msgstr ""
msgstr "この連絡先を除く:"
#: src/Core/ACL.php:400 mod/editpost.php:96
msgid "CC: email addresses"
@ -7753,7 +7753,7 @@ msgstr "新しい投稿を作成"
#: src/Module/Item/Compose.php:119
msgid "Visibility"
msgstr ""
msgstr "公開範囲"
#: src/Module/Item/Compose.php:140
msgid "Clear the location"
@ -7934,7 +7934,7 @@ msgstr "管理者へリクエストする内容を書く必要があります。
#: src/Module/Register.php:266
msgid "You have entered too much information."
msgstr ""
msgstr "入力件数が多すぎます"
#: src/Module/Register.php:312
msgid "Your registration is pending approval by the site owner."
@ -9884,14 +9884,14 @@ msgstr "通常、システムは短縮された投稿に追加するのに最適
#: mod/settings.php:852
msgid "Attach the link title"
msgstr ""
msgstr "リンクの件名を添付します"
#: mod/settings.php:852
msgid ""
"When activated, the title of the attached link will be added as a title on "
"posts to Diaspora. This is mostly helpful with \"remote-self\" contacts that"
" share feed content."
msgstr ""
msgstr "有効にすると、添付されたリンクのタイトルがDiasporaへの投稿のタイトルとして追加されます。 これは主に、フィードコンテンツを共有する「リモート セルフ」コンタクトで役立ちます。"
#: mod/settings.php:853
msgid "Automatically follow any GNU Social (OStatus) followers/mentioners"
@ -10066,11 +10066,11 @@ msgstr "有効にすると、埋め込みコンテンツは自動更新では表
#: mod/settings.php:971
msgid "Disable Smart Threading"
msgstr ""
msgstr "スマートスレッドを無効にする"
#: mod/settings.php:971
msgid "Disable the automatic suppression of extraneous thread indentation."
msgstr ""
msgstr "外部スレッドのインデントについて、自動抑制を無効にします。"
#: mod/settings.php:973
msgid "General Theme Settings"

View file

@ -289,7 +289,7 @@ $a->strings["%s: updating %s table."] = "%s %sテーブルを更新してい
$a->strings["This entry was edited"] = "このエントリは編集されました";
$a->strings["Private Message"] = "自分のみ";
$a->strings["Edit"] = "編集";
$a->strings["pinned item"] = "";
$a->strings["pinned item"] = "ピン留め項目";
$a->strings["Delete locally"] = "ローカルで削除";
$a->strings["Delete globally"] = "グローバルに削除";
$a->strings["Remove locally"] = "ローカルで削除";
@ -301,10 +301,10 @@ $a->strings["ignore thread"] = "スレッドを無視";
$a->strings["unignore thread"] = "無視しないスレッド";
$a->strings["toggle ignore status"] = "トグル無視ステータス";
$a->strings["ignored"] = "無視";
$a->strings["pin"] = "";
$a->strings["unpin"] = "";
$a->strings["toggle pin status"] = "";
$a->strings["pinned"] = "";
$a->strings["pin"] = "ピン留め";
$a->strings["unpin"] = "ピン留めを解除";
$a->strings["toggle pin status"] = "ピン留めを切り替え";
$a->strings["pinned"] = "ピン留めされました";
$a->strings["add star"] = "スターを追加";
$a->strings["remove star"] = "スターを削除";
$a->strings["toggle star status"] = "スターの状態を切り替える";
@ -316,7 +316,7 @@ $a->strings["I don't like this (toggle)"] = "気に入らない(トグル)";
$a->strings["dislike"] = "嫌い";
$a->strings["Share this"] = "これを共有";
$a->strings["share"] = "共有";
$a->strings["%s (Received %s)"] = "";
$a->strings["%s (Received %s)"] = "%s (%s を受け取りました)";
$a->strings["to"] = "";
$a->strings["via"] = "経由で";
$a->strings["Wall-to-Wall"] = "壁間";
@ -372,7 +372,7 @@ $a->strings["MySpace"] = "MySpace";
$a->strings["Google+"] = "Google+";
$a->strings["pump.io"] = "pump.io";
$a->strings["Twitter"] = "Twitter";
$a->strings["Discourse"] = "";
$a->strings["Discourse"] = "Discourse";
$a->strings["Diaspora Connector"] = "Diaspora コネクタ";
$a->strings["GNU Social Connector"] = "GNU Social Connector";
$a->strings["ActivityPub"] = "ActivityPub";
@ -793,18 +793,18 @@ $a->strings["fingered"] = "フィンガーされました";
$a->strings["rebuff"] = "拒絶";
$a->strings["rebuffed"] = "拒否された";
$a->strings["Login failed."] = "ログインに失敗しました。";
$a->strings["Login failed. Please check your credentials."] = "";
$a->strings["Login failed. Please check your credentials."] = "ログインに失敗しました。認証情報を確かめてください。";
$a->strings["Welcome %s"] = "ようこそ%s";
$a->strings["Please upload a profile photo."] = "プロフィール写真をアップロードしてください。";
$a->strings["Welcome back %s"] = "おかえりなさい%s";
$a->strings["Mutuals"] = "相互";
$a->strings["Post to Email"] = "メールに投稿";
$a->strings["Public"] = "一般公開";
$a->strings["This content will be shown to all your followers and can be seen in the community pages and by anyone with its link."] = "";
$a->strings["This content will be shown to all your followers and can be seen in the community pages and by anyone with its link."] = "このコンテンツはすべてのフォロワーに表示され、コミュニティページやリンクを知っている人なら誰でも見ることができます。";
$a->strings["Limited/Private"] = "限定/プライベート";
$a->strings["This content will be shown only to the people in the first box, to the exception of the people mentioned in the second box. It won't appear anywhere public."] = "";
$a->strings["Show to:"] = "";
$a->strings["Except to:"] = "";
$a->strings["This content will be shown only to the people in the first box, to the exception of the people mentioned in the second box. It won't appear anywhere public."] = "このコンテンツは、最初のボックスに記載されたメンバーから、2番目のボックスに記載されている人を除いた範囲に対して表示されます。 一般公開はされません。";
$a->strings["Show to:"] = "限定公開先:";
$a->strings["Except to:"] = "この連絡先を除く:";
$a->strings["CC: email addresses"] = "CCメールアドレス";
$a->strings["Example: bob@example.com, mary@example.com"] = "bob @ example.com、mary @ example.com";
$a->strings["Connectors"] = "コネクター";
@ -1724,7 +1724,7 @@ $a->strings["Please enter a post body."] = "投稿本文を入力してくださ
$a->strings["This feature is only available with the frio theme."] = "この機能は、frioテーマでのみ使用可能です。";
$a->strings["Compose new personal note"] = "新しい個人メモを作成する";
$a->strings["Compose new post"] = "新しい投稿を作成";
$a->strings["Visibility"] = "";
$a->strings["Visibility"] = "公開範囲";
$a->strings["Clear the location"] = "場所をクリアする";
$a->strings["Location services are unavailable on your device"] = "デバイスで位置情報サービスを利用できません";
$a->strings["Location services are disabled. Please check the website's permissions on your device"] = "位置情報サービスは無効になっています。お使いのデバイスでウェブサイトの権限を確認してください";
@ -1762,7 +1762,7 @@ $a->strings["Failed to send email message. Here your accout details:<br> login:
$a->strings["Registration successful."] = "登録に成功。";
$a->strings["Your registration can not be processed."] = "登録を処理できません。";
$a->strings["You have to leave a request note for the admin."] = "管理者へリクエストする内容を書く必要があります。";
$a->strings["You have entered too much information."] = "";
$a->strings["You have entered too much information."] = "入力件数が多すぎます";
$a->strings["Your registration is pending approval by the site owner."] = "登録はサイト所有者による承認待ちです。";
$a->strings["Search term successfully saved."] = "検索キーワードを保存しました。";
$a->strings["Search term already saved."] = "すでに保存された検索キーワードです。";
@ -2212,8 +2212,8 @@ $a->strings["Disable Content Warning"] = "コンテンツ警告を無効にす
$a->strings["Users on networks like Mastodon or Pleroma are able to set a content warning field which collapse their post by default. This disables the automatic collapsing and sets the content warning as the post title. Doesn't affect any other content filtering you eventually set up."] = "MastodonやPleromaなどのネットワーク上のユーザーは、デフォルトで投稿を折りたたむコンテンツ警告フィールドを設定できます。これにより、自動折りたたみが無効になり、コンテンツの警告が投稿タイトルとして設定されます。最終的に設定する他のコンテンツフィルタリングには影響しません。";
$a->strings["Disable intelligent shortening"] = "インテリジェントな短縮を無効にする";
$a->strings["Normally the system tries to find the best link to add to shortened posts. If this option is enabled then every shortened post will always point to the original friendica post."] = "通常、システムは短縮された投稿に追加するのに最適なリンクを見つけようとします。このオプションを有効にすると、すべての短縮された投稿は常に元のfriendica投稿を指すようになります。";
$a->strings["Attach the link title"] = "";
$a->strings["When activated, the title of the attached link will be added as a title on posts to Diaspora. This is mostly helpful with \"remote-self\" contacts that share feed content."] = "";
$a->strings["Attach the link title"] = "リンクの件名を添付します";
$a->strings["When activated, the title of the attached link will be added as a title on posts to Diaspora. This is mostly helpful with \"remote-self\" contacts that share feed content."] = "有効にすると、添付されたリンクのタイトルがDiasporaへの投稿のタイトルとして追加されます。 これは主に、フィードコンテンツを共有する「リモート セルフ」コンタクトで役立ちます。";
$a->strings["Automatically follow any GNU Social (OStatus) followers/mentioners"] = "GNU SocialOStatusのフォロワー/メンショナーを自動的にフォローする";
$a->strings["If you receive a message from an unknown OStatus user, this option decides what to do. If it is checked, a new contact will be created for every unknown user."] = "不明なOStatusユーザーからメッセージを受信した場合、このオプションは何をするかを決定します。チェックされている場合、未知のユーザーごとに新しいコンタクトが作成されます。";
$a->strings["Default group for OStatus contacts"] = "OStatusコンタクトのデフォルトグループ";
@ -2253,8 +2253,8 @@ $a->strings["Automatic updates only at the top of the network page"] = "ネッ
$a->strings["When disabled, the network page is updated all the time, which could be confusing while reading."] = "無効にすると、ネットワークページが常に更新され、読み取り中に混乱する可能性があります。";
$a->strings["Bandwidth Saver Mode"] = "帯域幅節約モード";
$a->strings["When enabled, embedded content is not displayed on automatic updates, they only show on page reload."] = "有効にすると、埋め込みコンテンツは自動更新では表示されず、ページの再読み込みでのみ表示されます。";
$a->strings["Disable Smart Threading"] = "";
$a->strings["Disable the automatic suppression of extraneous thread indentation."] = "";
$a->strings["Disable Smart Threading"] = "スマートスレッドを無効にする";
$a->strings["Disable the automatic suppression of extraneous thread indentation."] = "外部スレッドのインデントについて、自動抑制を無効にします。";
$a->strings["General Theme Settings"] = "一般的なテーマ設定";
$a->strings["Custom Theme Settings"] = "カスタムテーマ設定";
$a->strings["Content Settings"] = "コンテンツ設定";

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff