Merge branch 'develop' into rewrites/dbm_is_result

This commit is contained in:
Roland Häder 2017-01-04 09:04:51 +01:00
commit 91d9ac0d1e
8 changed files with 6435 additions and 6396 deletions

View file

@ -69,6 +69,28 @@ function diaspora2bb($s) {
return $s;
}
/**
* @brief Callback function to replace a Friendica style mention in a mention for Diaspora
*
* @param array $match Matching values for the callback
* @return text Replaced mention
*/
function diaspora_mentions($match) {
$contact = get_contact_details_by_url($match[3]);
if (!isset($contact['addr'])) {
$contact = Probe::uri($match[3]);
}
if (!isset($contact['addr'])) {
return $match[0];
}
$mention = '@{'.$match[2].'; '.$contact['addr'].'}';
return $mention;
}
function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) {
$a = get_app();
@ -108,8 +130,8 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) {
} else
$Text = bbcode($Text, $preserve_nl, false, 4);
// mask some special HTML chars from conversation to markdown
$Text = str_replace(array('<','>','&'),array('&_lt_;','&_gt_;','&_amp_;'),$Text);
// mask some special HTML chars from conversation to markdown
$Text = str_replace(array('<','>','&'),array('&_lt_;','&_gt_;','&_amp_;'),$Text);
// If a link is followed by a quote then there should be a newline before it
// Maybe we should make this newline at every time before a quote.
@ -120,8 +142,8 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) {
// Now convert HTML to Markdown
$Text = new HTML_To_Markdown($Text);
// unmask the special chars back to HTML
$Text = str_replace(array('&_lt_;','&_gt_;','&_amp_;'),array('<','>','&'),$Text);
// unmask the special chars back to HTML
$Text = str_replace(array('&_lt_;','&_gt_;','&_amp_;'),array('<','>','&'),$Text);
$a->save_timestamp($stamp1, "parser");
@ -132,6 +154,11 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) {
// the Diaspora signature verification and cause the item to disappear
$Text = trim($Text);
if ($fordiaspora) {
$URLSearchString = "^\[\]";
$Text = preg_replace_callback("/([@]\[(.*?)\])\(([$URLSearchString]*?)\)/ism", 'diaspora_mentions', $Text);
}
call_hooks('bb2diaspora',$Text);
return $Text;

View file

@ -95,8 +95,7 @@ function item_post(App &$a) {
$r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
intval($parent)
);
}
elseif ($parent_uri && local_user()) {
} elseif ($parent_uri && local_user()) {
// This is coming from an API source, and we are logged in
$r = q("SELECT * FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($parent_uri),
@ -141,16 +140,7 @@ function item_post(App &$a) {
$thrparent = q("SELECT `author-link`, `network` FROM `item` WHERE `uri` = '%s' LIMIT 1", dbesc($thr_parent));
if (dbm::is_result($thrparent) AND ($thrparent[0]["network"] === NETWORK_OSTATUS)
AND (normalise_link($parent_contact["url"]) != normalise_link($thrparent[0]["author-link"]))) {
$parent_contact = null;
$r = q("SELECT * FROM `gcontact` WHERE `nurl` = '%s' LIMIT 1",
dbesc(normalise_link($thrparent[0]["author-link"])));
if (dbm::is_result($r)) {
$parent_contact = $r[0];
$parent_contact["thumb"] = $parent_contact["photo"];
$parent_contact["micro"] = $parent_contact["photo"];
unset($parent_contact["id"]);
}
$parent_contact = get_contact_details_by_url($thrparent[0]["author-link"]);
if (!isset($parent_contact["nick"])) {
require_once("include/Scrape.php");
@ -569,12 +559,8 @@ function item_post(App &$a) {
* add a statusnet style reply tag if the original post was from there
* and we are replying, and there isn't one already
*/
if($parent AND ($parent_contact['network'] === NETWORK_OSTATUS)) {
if ($parent_contact['id'] != "")
$contact = '@'.$parent_contact['nick'].'+'.$parent_contact['id'];
else
$contact = '@[url='.$parent_contact['url'].']'.$parent_contact['nick'].'[/url]';
if ($parent AND ($parent_contact['network'] == NETWORK_OSTATUS)) {
$contact = '@[url='.$parent_contact['url'].']'.$parent_contact['nick'].'[/url]';
if (!in_array($contact,$tags)) {
$body = $contact.' '.$body;

View file

@ -22,7 +22,7 @@
# Matthias Moritz <matthias@matthiasmoritz.de>, 2012
# Oliver <post@toktan.org>, 2015
# Oliver <post@toktan.org>, 2012
# rabuzarus <rabuzarus@t-online.de>, 2016
# rabuzarus <rabuzarus@t-online.de>, 2016-2017
# Sennewood <sebastian@sebsen.net>, 2013
# Sennewood <sebastian@sebsen.net>, 2012-2013
# silke m <silke@silkemeyer.net>, 2015
@ -36,8 +36,8 @@ msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-19 07:46+0100\n"
"PO-Revision-Date: 2016-12-19 11:19+0000\n"
"Last-Translator: Tobias Diekershoff <tobias.diekershoff@gmx.net>\n"
"PO-Revision-Date: 2017-01-02 17:16+0000\n"
"Last-Translator: rabuzarus <rabuzarus@t-online.de>\n"
"Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -5796,7 +5796,7 @@ msgstr "Browser alle xx Sekunden aktualisieren"
#: mod/settings.php:1003
msgid "Minimum of 10 seconds. Enter -1 to disable it."
msgstr "Minimum sind 10 Sekeunden. Gib -1 ein um abzuschalten."
msgstr "Minimum sind 10 Sekunden. Gib -1 ein um abzuschalten."
#: mod/settings.php:1004
msgid "Number of items to display per page:"
@ -7756,7 +7756,7 @@ msgstr "Beziehe Information und Schlüsselworte"
#: mod/contacts.php:575
msgid "Contact"
msgstr "Kontakt: "
msgstr "Kontakt"
#: mod/contacts.php:578
msgid "Profile Visibility"

View file

@ -1337,7 +1337,7 @@ $a->strings["Mobile Theme:"] = "Mobiles Theme";
$a->strings["Suppress warning of insecure networks"] = "Warnung wegen unsicheren Netzwerken unterdrücken";
$a->strings["Should the system suppress the warning that the current group contains members of networks that can't receive non public postings."] = "Soll das System Warnungen unterdrücken, die angezeigt werden weil von dir eingerichtete Kontakt-Gruppen Accounts aus Netzwerken beinhalten, die keine nicht öffentlichen Beiträge empfangen können.";
$a->strings["Update browser every xx seconds"] = "Browser alle xx Sekunden aktualisieren";
$a->strings["Minimum of 10 seconds. Enter -1 to disable it."] = "Minimum sind 10 Sekeunden. Gib -1 ein um abzuschalten.";
$a->strings["Minimum of 10 seconds. Enter -1 to disable it."] = "Minimum sind 10 Sekunden. Gib -1 ein um abzuschalten.";
$a->strings["Number of items to display per page:"] = "Zahl der Beiträge, die pro Netzwerkseite angezeigt werden sollen: ";
$a->strings["Maximum of 100 items"] = "Maximal 100 Beiträge";
$a->strings["Number of items to display per page when viewed from mobile device:"] = "Zahl der Beiträge, die pro Netzwerkseite auf mobilen Geräten angezeigt werden sollen:";
@ -1777,7 +1777,7 @@ $a->strings["Communications lost with this contact!"] = "Verbindungen mit diesem
$a->strings["Fetch further information for feeds"] = "Weitere Informationen zu Feeds holen";
$a->strings["Fetch information"] = "Beziehe Information";
$a->strings["Fetch information and keywords"] = "Beziehe Information und Schlüsselworte";
$a->strings["Contact"] = "Kontakt: ";
$a->strings["Contact"] = "Kontakt";
$a->strings["Profile Visibility"] = "Profil-Sichtbarkeit";
$a->strings["Please choose the profile you would like to display to %s when viewing your profile securely."] = "Bitte wähle eines Deiner Profile das angezeigt werden soll, wenn %s Dein Profil aufruft.";
$a->strings["Contact Information / Notes"] = "Kontakt Informationen / Notizen";

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -270,6 +270,7 @@ a#item-delete-selected {
vertical-align: baseline;
background-color: $link_color;
border-radius: 4px;
z-index: 1;
}
aside .badge {
opacity: 0.7;

View file

@ -6,10 +6,9 @@
<form id="poke-form" action="poke" method="get">
<div poke-content-wrapper
<div id="poke-content-wrapper">
{{* The input field with the recipient name*}}
<div id="poke-recip-wrapper" class="form-group">
<label for="poke-recip">{{$clabel}}</label>
<input id="poke-recip" class="form-control" type="text" size="64" maxlength="255" value="{{$name|escape:'html'}}" name="pokename" autocomplete="off" />
@ -17,6 +16,7 @@
<input id="poke-parent" type="hidden" value="{{$parent}}" name="parent" />
</div>
{{* The drop-down list with different actions *}}
<div id="poke-action-wrapper" class="form-group">
<label for="poke-verb-select">{{$choice}}</label>
<select name="verb" id="poke-verb-select" class="form-control">
@ -26,6 +26,7 @@
</select>
</div>
{{* The checkbox to select if the "poke message" should be private *}}
<div id="poke-private-desc" class="checkbox">
<input type="checkbox" id=poke-private-desc-checkbox" name="private" {{if $parent}}disabled="disabled"{{/if}} value="1" />
<label for="poke-private-desc-checkbox">{{$prv_desc}}</label>
@ -41,7 +42,7 @@
<div id="poke-submit-wrapper-end"></div>
</form>
<div id="poke-wrapper-end"></div>
</div>