Merge remote-tracking branch 'upstream/master'

This commit is contained in:
zottel 2015-09-16 09:56:11 +02:00
commit c2dac55edb
33 changed files with 314 additions and 247 deletions

View File

@ -7,6 +7,7 @@ We need much more than this, but here are areas where developers can help. Pleas
[li]Auto preview posts/comments (configurable timer kicks in the preview if not 0)[/li]
[li]Create bug tracker module[/li]
[li]Filing posts - provide a dropdown menu integrated with the 'post actions menu'[/li]
[li]integrate Mozilla Persona (possibly via plugin) https://github.com/mozilla/id-specs/blob/prod/browserid/index.md and become an idP[/li]
[li]translation plugins - moses or apertium[/li]
[li]plugins - provide 'disable' which is softer than 'uninstall' for those plugins which create additional DB tables[/li]
[li]Infinite scroll improvements (i.e. embedded page links) see http://scrollsample.appspot.com/items [/li]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -437,7 +437,7 @@ function bb_observer($Text) {
// BBcode 2 HTML was written by WAY2WEB.net
// extended to work with Mistpark/Friendica/Red - Mike Macgirvin
// extended to work with Mistpark/Friendica/Redmatrix/Hubzilla - Mike Macgirvin
function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) {

61
include/checksites.php Normal file
View File

@ -0,0 +1,61 @@
<?php /** @file */
require_once('boot.php');
require_once('include/cli_startup.php');
require_once('include/zot.php');
require_once('include/hubloc.php');
function checksites_run($argv, $argc){
cli_startup();
$a = get_app();
logger('checksites: start');
if(($argc > 1) && ($argv[1]))
$site_id = $argv[1];
if($site_id)
$sql_options = " and site_url = '" . dbesc($argv[1]) . "' ";
$days = intval(get_config('system','sitecheckdays'));
if($days < 1)
$days = 30;
$r = q("select * from site where site_dead = 0 and site_update < %s - INTERVAL %s $sql_options ",
db_utcnow(), db_quoteinterval($days . ' DAY')
);
if(! $r)
return;
foreach($r as $rr) {
if(! strcasecmp($rr['site_url'],z_root()))
continue;
$x = ping_site($rr['site_url']);
if($x['success']) {
logger('checksites: ' . $rr['site_url']);
q("update site set site_update = '%s' where site_url = '%s' ",
dbesc(datetime_convert()),
dbesc($rr['site_url'])
);
}
else {
logger('marking dead site: ' . $x['message']);
q("update site set site_dead = 1 where site_url = '%s' ",
dbesc($rr['site_url'])
);
}
}
return;
}
if (array_search(__file__,get_included_files())===0){
checksites_run($argv,$argc);
killme();
}

View File

@ -291,13 +291,18 @@ function ping_site($url) {
$ret['message'] = 'no answer from ' . $url;
return $ret;
}
$packet_result = $r['body'];
$packet_result = json_decode($r['body'],true);
if(! $packet_result['success']) {
$ret['message'] = 'packet failure from ' . $url;
return $ret;
}
$ret['success'] = true;
return $ret;
if($packet_result['success']) {
$ret['success'] = true;
}
else {
$ret['message'] = 'unknown error from ' . $url;
}
return $ret;
}

View File

@ -486,20 +486,6 @@ function notifier_run($argv, $argc){
if($details) {
foreach($details as $d) {
// If the recipient is federated from a traditional network they won't be able to
// handle nomadic identity. If we're publishing from a site that they aren't
// directly connected with, ignore them.
// FIXME: make sure we run through a notifier loop on the hub they're connected
// with if this post comes in from a different hub - so that we will deliver to them.
// On the down side, these channels will stop working if the hub they connected with
// goes down permanently, as they are (doh) not nomadic.
if(($d['xchan_instance_url']) && ($d['xchan_instance_url'] != z_root()))
continue;
$recip_list[] = $d['xchan_addr'] . ' (' . $d['xchan_hash'] . ')';
if($private)
$env_recips[] = array('guid' => $d['xchan_guid'],'guid_sig' => $d['xchan_guid_sig'],'hash' => $d['xchan_hash']);
@ -526,31 +512,10 @@ function notifier_run($argv, $argc){
// Now we have collected recipients (except for external mentions, FIXME)
// Let's reduce this to a set of hubs.
logger('notifier: hub choice: ' . intval($relay_to_owner) . ' ' . intval($private) . ' ' . $cmd, LOGGER_DEBUG);
// FIXME: I think we need to remove the private bit or this clause will never execute. Needs more coffee to think it through.
// We may in fact have to send it to clones in case the one we pick recently died.
if($relay_to_owner && (! $private) && ($cmd !== 'relay')) {
// If sending a followup to the post owner, only send it to one channel clone - to avoid race conditions.
// In this case we'll pick the most recently contacted hub, as their primary might be down and the most
// recently contacted has the best chance of being alive.
// For private posts or uplinks we have to do things differently as only the sending clone will have the recipient list.
// We have to send to all clone channels of the owner to find out who has the definitive list. Posts with
// item_private set (but no ACL list) will return empty recipients (except for the sender and owner) in
// collect_recipients() above. The end result is we should get only one delivery per delivery chain if we
// aren't the owner or author.
$r = q("select * from hubloc
where hubloc_hash in (" . implode(',',$recipients) . ") order by hubloc_connected desc limit 1");
}
else {
$r = q("select * from hubloc where hubloc_hash in (" . implode(',',$recipients) . ")
and hubloc_error = 0 and hubloc_deleted = 0");
}
$r = q("select * from hubloc where hubloc_hash in (" . implode(',',$recipients) . ")
and hubloc_error = 0 and hubloc_deleted = 0"
);
if(! $r) {
logger('notifier: no hubs');
@ -559,6 +524,15 @@ function notifier_run($argv, $argc){
$hubs = $r;
$dead_hubs = array();
$dh = q("select site_url from site where site_dead = 1");
if(dh) {
foreach($dh as $dead) {
$dead_hubs[] = $dead['site_url'];
}
}
/**
* Reduce the hubs to those that are unique. For zot hubs, we need to verify uniqueness by the sitekey, since it may have been
@ -574,6 +548,11 @@ function notifier_run($argv, $argc){
foreach($hubs as $hub) {
if(in_array($hub['hubloc_url'],$dead_hubs)) {
logger('skipping dead hub: ' . $hub['hubloc_url'], LOGGER_DEBUG);
continue;
}
if($hub['hubloc_network'] == 'zot') {
if(! in_array($hub['hubloc_sitekey'],$keys)) {
$hublist[] = $hub['hubloc_host'];

View File

@ -175,7 +175,10 @@ function poller_run($argv, $argc){
logger('regdir: ' . print_r(z_fetch_url(get_directory_primary() . '/regdir?f=&url=' . urlencode(z_root()) . '&realm=' . urlencode(get_directory_realm())),true));
}
// Check for dead sites
proc_run('php', 'include/checksites.php');
// update searchable doc indexes
proc_run('php', 'include/importdoc.php');
/**

View File

@ -2,7 +2,8 @@
function hostxrd_init(&$a) {
header('Access-Control-Allow-Origin: *');
header("Content-type: text/xml");
header("Content-type: application/xrd+xml");
logger('hostxrd',LOGGER_DEBUG);
$tpl = get_markup_template('xrd_host.tpl');
$x = replace_macros(get_markup_template('xrd_host.tpl'), array(

View File

@ -150,6 +150,9 @@ function siteinfo_content(&$a) {
if(file_exists('doc/site_donate.html'))
$donate .= file_get_contents('doc/site_donate.html');
if(function_exists('sys_getloadavg'))
$loadavg = sys_getloadavg();
$o = replace_macros(get_markup_template('siteinfo.tpl'), array(
'$title' => t('$Projectname'),
'$description' => t('This is a hub of $Projectname - a global cooperative network of decentralized privacy enhanced websites.'),
@ -158,6 +161,8 @@ function siteinfo_content(&$a) {
'$tag' => $tag,
'$polled' => t('Last background fetch: '),
'$lastpoll' => get_poller_runtime(),
'$load_average' => t('Current load average: '),
'$loadavg_all' => $loadavg[0] . ', ' . $loadavg[1] . ', ' . $loadavg[2],
'$commit' => $commit,
'$web_location' => t('Running at web location') . ' ' . z_root(),
'$visit' => t('Please visit <a href="https://redmatrix.me">redmatrix.me</a> to learn more about $Projectname.'),

View File

@ -234,9 +234,17 @@ function thing_init(&$a) {
function thing_content(&$a) {
// @FIXME one problem with things is we can't share them unless we provide the channel in the url
// so we can definitively lookup the owner.
if(argc() == 2) {
$sql_extra = permissions_sql();
$r = q("select obj_channel from obj where obj_type = %d and obj_obj = '%s' limit 1",
intval(TERM_OBJ_THING),
dbesc(argv(1))
);
if($r)
$sql_extra = permissions_sql($r[0]['obj_channel']);
$r = q("select * from obj where obj_type = %d and obj_obj = '%s' $sql_extra limit 1",
intval(TERM_OBJ_THING),

View File

@ -19,7 +19,7 @@ function wfinger_init(&$a) {
}
$resource = $_REQUEST['resource'];
logger('webfinger: ' . $resource,LOGGER_DEBUG);
$r = null;

View File

@ -5,6 +5,7 @@ require_once('include/crypto.php');
function xrd_init(&$a) {
$uri = urldecode(notags(trim($_GET['uri'])));
logger('xrd: ' . $uri,LOGGER_DEBUG);
if(substr($uri,0,4) === 'http')
$name = basename($uri);
@ -31,7 +32,7 @@ function xrd_init(&$a) {
$salmon_key = salmon_key($r[0]['channel_pubkey']);
header('Access-Control-Allow-Origin: *');
header("Content-type: text/xml");
header("Content-type: application/xrd+xml");
$tpl = get_markup_template('view/xrd_person.tpl');

View File

@ -34,11 +34,12 @@ nav.navbar {
}
aside#region_1 {
min-width: 231px;
max-width: 231px;
min-width: 285px;
max-width: 285px;
display: table-cell;
width: 231px;
width: 285px;
margin-left: 10px;
vertical-align: top;
}
aside input[type='text'] {
@ -52,6 +53,7 @@ section {
width: 100%;
display: table-cell;
padding: 0 10px 200px 10px;
vertical-align: top;
}
#region_3 {

File diff suppressed because it is too large Load Diff

View File

@ -284,7 +284,7 @@ $a->strings["Search by Date"] = "Buscar por fecha";
$a->strings["Ability to select posts by date ranges"] = "Capacidad de seleccionar entradas por rango de fechas";
$a->strings["Collections Filter"] = "Filtrado de colecciones";
$a->strings["Enable widget to display Network posts only from selected collections"] = "Habilitar la muestra de entradas eligiendo colecciones";
$a->strings["Saved Searches"] = "Búsquedas Guardadas";
$a->strings["Saved Searches"] = "Búsquedas guardadas";
$a->strings["Save search terms for re-use"] = "Guardar términos de búsqueda para su reutilización";
$a->strings["Network Personal Tab"] = "Pestaña de red personal";
$a->strings["Enable tab to display only Network posts that you've interacted on"] = "Habilitar una pestaña en la cual se muestren solo las entradas en las que ha participado.";
@ -376,7 +376,7 @@ $a->strings["%1\$s, %2\$s posted to [zrl=%3\$s]your wall[/zrl]"] = "%1\$s, %2\$s
$a->strings["[Red:Notify] %s tagged you"] = "[Red:Aviso] %s le etiquetó";
$a->strings["%1\$s, %2\$s tagged you at %3\$s"] = "%1\$s, %2\$s le etiquetó en %3\$s";
$a->strings["%1\$s, %2\$s [zrl=%3\$s]tagged you[/zrl]."] = "%1\$s, %2\$s [zrl=%3\$s]le etiquetó[/zrl].";
$a->strings["[Red:Notify] %1\$s poked you"] = "[Red:Aviso] %1\$s ha recibido un toque";
$a->strings["[Red:Notify] %1\$s poked you"] = "[Red:Aviso] %1\$s le ha dado un toque";
$a->strings["%1\$s, %2\$s poked you at %3\$s"] = "%1\$s, %2\$s le dio un toque en %3\$s";
$a->strings["%1\$s, %2\$s [zrl=%2\$s]poked you[/zrl]."] = "%1\$s, %2\$s [zrl=%2\$s]le dio un toque[/zrl].";
$a->strings["[Red:Notify] %s tagged your post"] = "[Red:Aviso] %s etiquetó su entrada";
@ -1052,9 +1052,9 @@ $a->strings["Failed to remove event"] = "Error al borrar el evento";
$a->strings["Event details"] = "Detalles del evento";
$a->strings["Starting date and Title are required."] = "Se requieren fecha y título.";
$a->strings["Categories (comma-separated list)"] = "Categorías (lista separada por comas)";
$a->strings["Event Starts:"] = "Inicios de eventos:";
$a->strings["Event Starts:"] = "Inicio del evento:";
$a->strings["Finish date/time is not known or not relevant"] = "La fecha / hora de finalización no se conocen o no son relevantes";
$a->strings["Event Finishes:"] = "Eventos Terminados:";
$a->strings["Event Finishes:"] = "Finalización del evento:";
$a->strings["Adjust for viewer timezone"] = "Ajustar para obtener el visor de zona horaria";
$a->strings["Important for events that happen in a particular place. Not practical for global holidays."] = "Importante para los eventos que suceden en un lugar determinado. No es práctico para los globales.";
$a->strings["Title:"] = "Título:";
@ -1888,7 +1888,7 @@ $a->strings["Someone writes a followup comment"] = "Alguien escriba un comentari
$a->strings["You receive a private message"] = "Reciba un mensaje privado";
$a->strings["You receive a friend suggestion"] = "Reciba una sugerencia de amistad";
$a->strings["You are tagged in a post"] = "Usted sea etiquetado en una publicación";
$a->strings["You are poked/prodded/etc. in a post"] = "Haya recibido un toque o haya sido incitado, etc. en una publicación";
$a->strings["You are poked/prodded/etc. in a post"] = "Recibir un toque o incitación en una publicación";
$a->strings["Show visual notifications including:"] = "Mostrar notificaciones visuales que incluyan:";
$a->strings["Unseen matrix activity"] = "Actividad no vista en la red";
$a->strings["Unseen channel activity"] = "Actividad no vista en el canal";

View File

@ -4672,7 +4672,7 @@ msgstr "Il ridimensionamento dell'immagine è fallito."
msgid ""
"Shift-reload the page or clear browser cache if the new photo does not "
"display immediately."
msgstr "Ricarica la pagina con shift+F5 o cancella la cache del browser se la nuova foto non viene mostrata immediatamente."
msgstr "Ricarica la pagina con shift+control+r o cancella la cache del browser se la nuova foto non viene mostrata immediatamente."
#: ../../mod/profile_photo.php:233
#, php-format

View File

@ -17,8 +17,8 @@
<div id="page-footer"></div>
<div id="pause"></div>
</section>
</main>
<aside id="region_3"><?php if(x($page,'right_aside')) echo $page['right_aside']; ?></aside>
</main>
<div class="clear"></div>
<footer><?php if(x($page,'footer')) echo $page['footer']; ?></footer>
</div>

View File

@ -10,6 +10,7 @@
{{if $polled}}
<p>{{$polled}} {{$lastpoll}}</p>
{{/if}}
<p>{{$load_average}} {{$loadavg_all}}</p>
<p>{{$web_location}}</p>
<p>{{$visit}}</p>
<p>{{$bug_text}} <a href="{{$bug_link_url}}">{{$bug_link_text}}</a></p>

View File

@ -4,7 +4,7 @@
<hm:Host>{{$zhost}}</hm:Host>
<Link rel='lrdd' template='{{$zroot}}/xrd/?uri={uri}' />
<Link rel='lrdd' type="application/xrd+xml" template='{{$zroot}}/xrd/?uri={uri}' />
<Link rel="http://oexchange.org/spec/0.8/rel/resident-target" type="application/xrd+xml"
href="{{$zroot}}/oexchange/xrd" />