aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Lib/Activity.php16
-rw-r--r--Zotlabs/Lib/Libzot.php41
-rw-r--r--Zotlabs/Module/Profiles.php4
-rw-r--r--include/text.php6
-rw-r--r--view/tpl/app_nav_pinned.tpl10
5 files changed, 55 insertions, 22 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 62a22f70e..a0a9a7c7f 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -3548,7 +3548,21 @@ class Activity {
}
static function get_cached_actor($id) {
- return (XConfig::Get($id,'system','actor_record'));
+ $actor = XConfig::Get($id,'system', 'actor_record');
+
+ if ($actor) {
+ return $actor;
+ }
+
+ // try other get_cached_actor providers (e.g. diaspora)
+ $hookdata = [
+ 'id' => $id,
+ 'actor' => false
+ ];
+
+ call_hooks('get_cached_actor_provider', $hookdata);
+
+ return $hookdata['actor'];
}
static function get_actor_hublocs($url, $options = 'all') {
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 9c232f34d..e03f0173d 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -1200,31 +1200,41 @@ class Libzot {
if (in_array($env['type'], ['activity', 'response'])) {
- $r = q("select hubloc_hash, hubloc_network from hubloc where hubloc_id_url = '%s' ",
+ if(!isset($AS->actor['id'])) {
+ logger('No actor id!');
+ return;
+ }
+
+ $r = q("select hubloc_hash, hubloc_network, hubloc_url from hubloc where hubloc_id_url = '%s'",
dbesc($AS->actor['id'])
);
if ($r) {
- // selects a zot6 hash if available, otherwise use whatever we have
- $r = self::zot_record_preferred($r);
+ $r = self::zot_record_preferred($r);
$arr['author_xchan'] = $r['hubloc_hash'];
}
- if (!$arr['author_xchan']) {
+ if (! $arr['author_xchan']) {
logger('No author!');
return;
}
- $s = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1",
- dbesc($env['sender'])
- );
+ $arr['owner_xchan'] = $env['sender'];
+
+ if(filter_var($env['sender'], FILTER_VALIDATE_URL)) {
+ // in individual delivery, change owner if needed
+ $s = q("select hubloc_hash, hubloc_url from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1",
+ dbesc($env['sender'])
+ );
- // in individual delivery, change owner if needed
- if ($s) {
- $arr['owner_xchan'] = $s[0]['hubloc_hash'];
+ if ($s) {
+ $arr['owner_xchan'] = $s[0]['hubloc_hash'];
+ }
}
- else {
- $arr['owner_xchan'] = $env['sender'];
+
+ if (! $arr['owner_xchan']) {
+ logger('No owner!');
+ return;
}
if ($private && (!intval($arr['item_private']))) {
@@ -1714,7 +1724,7 @@ class Libzot {
}
}
- $ab = q("select * from abook where abook_channel = %d and abook_xchan = '%s'",
+ $ab = q("select * from abook where abook_channel = %d and abook_xchan = '%s'",
intval($channel['channel_id']),
dbesc($arr['owner_xchan'])
);
@@ -2636,8 +2646,8 @@ class Libzot {
);
if ($r) {
- logger('found another site that is not dead: ' . $r[0]['hubloc_url'], LOGGER_DEBUG, LOG_INFO);
- $desturl = $r[0]['hubloc_url'];
+ logger('found another site that is not dead: ' . $r[0]['hubloc_id_url'], LOGGER_DEBUG, LOG_INFO);
+ $desturl = $r[0]['hubloc_id_url'];
}
else {
return $hash;
@@ -2745,7 +2755,6 @@ class Libzot {
}
$e = $r[0];
-
$id = $e['channel_id'];
$sys_channel = (intval($e['channel_system']) ? true : false);
diff --git a/Zotlabs/Module/Profiles.php b/Zotlabs/Module/Profiles.php
index 452af4d78..631a41ddc 100644
--- a/Zotlabs/Module/Profiles.php
+++ b/Zotlabs/Module/Profiles.php
@@ -606,10 +606,10 @@ class Profiles extends \Zotlabs\Web\Controller {
$channel = \App::get_channel();
if($namechanged && $is_default) {
- $r = q("UPDATE xchan SET xchan_name = '%s', xchan_name_date = '%s' WHERE xchan_url = '%s'",
+ $r = q("UPDATE xchan SET xchan_name = '%s', xchan_name_date = '%s' WHERE xchan_hash = '%s'",
dbesc($name),
dbesc(datetime_convert()),
- dbesc(z_root() . '/channel/' . $channel['channel_address'])
+ dbesc($channel['xchan_hash'])
);
$r = q("UPDATE channel SET channel_name = '%s' WHERE channel_hash = '%s'",
dbesc($name),
diff --git a/include/text.php b/include/text.php
index bd2df45aa..2d863c5ae 100644
--- a/include/text.php
+++ b/include/text.php
@@ -3547,6 +3547,7 @@ function cleanup_bbcode($body) {
*/
$body = preg_replace_callback('/\[code(.*?)\[\/(code)\]/ism','\red_escape_codeblock',$body);
+ $body = preg_replace_callback('/\[summary(.*?)\[\/(summary)\]/ism','\red_escape_codeblock',$body);
$body = preg_replace_callback('/\[url(.*?)\[\/(url)\]/ism','\red_escape_codeblock',$body);
$body = preg_replace_callback('/\[zrl(.*?)\[\/(zrl)\]/ism','\red_escape_codeblock',$body);
$body = preg_replace_callback('/\[svg(.*?)\[\/(svg)\]/ism','\red_escape_codeblock',$body);
@@ -3560,9 +3561,10 @@ function cleanup_bbcode($body) {
+\,\(\)]+)/ismu", '\red_zrl_callback', $body);
- $body = preg_replace_callback('/\[\$b64zrl(.*?)\[\/(zrl)\]/ism','\red_unescape_codeblock',$body);
- $body = preg_replace_callback('/\[\$b64url(.*?)\[\/(url)\]/ism','\red_unescape_codeblock',$body);
$body = preg_replace_callback('/\[\$b64code(.*?)\[\/(code)\]/ism','\red_unescape_codeblock',$body);
+ $body = preg_replace_callback('/\[\$b64summary(.*?)\[\/(summary)\]/ism','\red_unescape_codeblock',$body);
+ $body = preg_replace_callback('/\[\$b64url(.*?)\[\/(url)\]/ism','\red_unescape_codeblock',$body);
+ $body = preg_replace_callback('/\[\$b64zrl(.*?)\[\/(zrl)\]/ism','\red_unescape_codeblock',$body);
$body = preg_replace_callback('/\[\$b64svg(.*?)\[\/(svg)\]/ism','\red_unescape_codeblock',$body);
$body = preg_replace_callback('/\[\$b64img(.*?)\[\/(img)\]/ism','\red_unescape_codeblock',$body);
$body = preg_replace_callback('/\[\$b64zmg(.*?)\[\/(zmg)\]/ism','\red_unescape_codeblock',$body);
diff --git a/view/tpl/app_nav_pinned.tpl b/view/tpl/app_nav_pinned.tpl
index 817c74763..b114ed19e 100644
--- a/view/tpl/app_nav_pinned.tpl
+++ b/view/tpl/app_nav_pinned.tpl
@@ -1 +1,9 @@
-<a class="navbar-app nav-link{{if $app.active}} active{{/if}}" href="{{$app.url}}" title="{{$app.name}}" >{{if $icon}}<i class="fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" />{{/if}}<span class="d-lg-none">{{$app.name}}</span></a>
+<a class="navbar-app nav-link{{if $app.active}} active{{/if}}" href="{{$app.url}}" title="{{$app.name}}" >
+ {{if $icon}}
+ <i class="fa fa-fw fa-{{$icon}}"></i>
+ <span class="d-lg-none">{{$app.name}}</span>
+ {{else}}
+ <img src="{{$app.photo}}" width="16" height="16" />
+ <div class="d-lg-none d-inline-block" style="margin-left: 9px">{{$app.name}}</div>
+ {{/if}}
+</a>