diff options
-rw-r--r-- | Zotlabs/Lib/Activity.php | 45 | ||||
-rw-r--r-- | Zotlabs/Lib/Queue.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Directory.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Well_known.php | 12 | ||||
-rw-r--r-- | Zotlabs/Module/Zotfeed.php | 2 | ||||
-rw-r--r-- | include/channel.php | 4 | ||||
-rw-r--r-- | include/connections.php | 5 | ||||
-rw-r--r-- | include/import.php | 4 | ||||
-rw-r--r-- | include/markdown.php | 3 | ||||
-rw-r--r-- | include/queue_fn.php | 2 | ||||
-rw-r--r-- | include/zot.php | 1 | ||||
-rwxr-xr-x | view/tpl/conv_item.tpl | 2 | ||||
-rwxr-xr-x | view/tpl/conv_list.tpl | 2 | ||||
-rw-r--r-- | view/tpl/usermenu.tpl | 2 | ||||
-rwxr-xr-x | view/tpl/xchan_vcard.tpl | 2 |
15 files changed, 69 insertions, 21 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 0757eec37..f9ec3a677 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -293,8 +293,14 @@ class Activity { $ret = []; - $objtype = self::activity_obj_mapper($i['obj_type']); - + if($i['verb'] === ACTIVITY_FRIEND) { + // Hubzilla 'make-friend' activity, no direct mapping from AS1 to AS2 - make it a note + $objtype = 'Note'; + } + else { + $objtype = self::activity_obj_mapper($i['obj_type']); + } + if(intval($i['item_deleted'])) { $ret['type'] = 'Tombstone'; $ret['formerType'] = $objtype; @@ -486,6 +492,12 @@ class Activity { $ret = []; $reply = false; + + if($i['verb'] === ACTIVITY_FRIEND) { + // Hubzilla 'make-friend' activity, no direct mapping from AS1 to AS2 - make it a note + $ret['obj'] = []; + } + if(intval($i['item_deleted'])) { $ret['type'] = 'Tombstone'; $ret['formerType'] = self::activity_obj_mapper($i['obj_type']); @@ -498,11 +510,6 @@ class Activity { return $ret; } - if($i['verb'] === ACTIVITY_FRIEND) { - // Hubzilla 'make-friend' activity, no direct mapping from AS1 to AS2 - make it a note - $ret['obj_type'] = ACTIVITY_OBJ_NOTE; - $ret['obj'] = []; - } $ret['type'] = self::activity_mapper($i['verb']); @@ -516,6 +523,25 @@ class Activity { xchan_query($p,true); $p = fetch_post_tags($p,true); $i['obj'] = self::encode_item($p[0]); + + // convert to zot6 emoji reaction encoding which uses the target object to indicate the + // specific emoji instead of overloading the verb or type. + + $im = explode('#',$i['verb']); + if($im && count($im) > 1) + $emoji = $im[1]; + if(preg_match("/\[img(.*?)\](.*?)\[\/img\]/ism", $i['body'], $match)) { + $ln = $match[2]; + } + + $i['tgt_type'] = 'Image'; + + $i['target'] = [ + 'type' => 'Image', + 'name' => $emoji, + 'url' => (($ln) ? $ln : z_root() . '/images/emoji/' . $emoji . '.png') + ]; + } } @@ -596,7 +622,7 @@ class Activity { $i['obj'] = json_decode($i['obj'],true); } if($i['obj']['type'] === ACTIVITY_OBJ_PHOTO) { - $i['obj']['id'] = $i['id']; + $i['obj']['id'] = $i['mid']; } $obj = self::encode_object($i['obj']); @@ -778,6 +804,9 @@ class Activity { if(strpos($verb,ACTIVITY_MOOD) !== false) return 'Create'; + if(strpos($verb,ACTIVITY_FRIEND) !== false) + return 'Create'; + if(strpos($verb,ACTIVITY_POKE) !== false) return 'Activity'; diff --git a/Zotlabs/Lib/Queue.php b/Zotlabs/Lib/Queue.php index baa1da70d..49891a55b 100644 --- a/Zotlabs/Lib/Queue.php +++ b/Zotlabs/Lib/Queue.php @@ -250,7 +250,7 @@ class Queue { $host_crypto = null; if($channel && $base) { - $h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' order by hubloc_id desc limit 1", + $h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' and hubloc_sitekey != '' order by hubloc_id desc limit 1", dbesc($base) ); if($h) { diff --git a/Zotlabs/Module/Directory.php b/Zotlabs/Module/Directory.php index 8f5db6635..dee22721d 100644 --- a/Zotlabs/Module/Directory.php +++ b/Zotlabs/Module/Directory.php @@ -345,7 +345,7 @@ class Directory extends \Zotlabs\Web\Controller { 'pdesc_label' => t('Description:'), 'marital' => $marital, 'homepage' => $homepage, - 'homepageurl' => linkify($homepageurl), + 'homepageurl' => linkify($homepageurl, true), 'hometown' => $hometown, 'hometown_label' => t('Hometown:'), 'about' => $about, diff --git a/Zotlabs/Module/Well_known.php b/Zotlabs/Module/Well_known.php index 09e743788..140ab260d 100644 --- a/Zotlabs/Module/Well_known.php +++ b/Zotlabs/Module/Well_known.php @@ -63,6 +63,18 @@ class Well_known extends \Zotlabs\Web\Controller { case 'dnt-policy.txt': echo file_get_contents('doc/dnt-policy.txt'); killme(); + + case 'caldav': + if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') { + http_status('301', 'moved permanently'); + goaway(z_root() . '/cdav'); + }; + + case 'carddav': + if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') { + http_status('301', 'moved permanently'); + goaway(z_root() . '/cdav'); + }; default: if(file_exists(\App::$cmd)) { diff --git a/Zotlabs/Module/Zotfeed.php b/Zotlabs/Module/Zotfeed.php index 381e3acb2..8c13682b4 100644 --- a/Zotlabs/Module/Zotfeed.php +++ b/Zotlabs/Module/Zotfeed.php @@ -42,7 +42,7 @@ class Zotfeed extends \Zotlabs\Web\Controller { } logger('zotfeed request: ' . $r[0]['channel_name'], LOGGER_DEBUG); - + $result['project'] = 'Hubzilla'; $result['messages'] = zot_feed($r[0]['channel_id'],$observer['xchan_hash'],array('mindate' => $mindate)); $result['success'] = true; json_return_and_die($result); diff --git a/include/channel.php b/include/channel.php index 7c0397e11..5d583e4f1 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1718,9 +1718,9 @@ function advanced_profile() { if(App::$profile['sexual']) $profile['sexual'] = array( t('Sexual Preference:'), App::$profile['sexual'] ); - if(App::$profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify(App::$profile['homepage']) ); + if(App::$profile['homepage']) $profile['homepage'] = array( t('Homepage:'), linkify(App::$profile['homepage'], true) ); - if(App::$profile['hometown']) $profile['hometown'] = array( t('Hometown:'), linkify(App::$profile['hometown']) ); + if(App::$profile['hometown']) $profile['hometown'] = array( t('Hometown:'), linkify(App::$profile['hometown'], true) ); if(App::$profile['politic']) $profile['politic'] = array( t('Political Views:'), App::$profile['politic']); diff --git a/include/connections.php b/include/connections.php index e942503f0..51df18b70 100644 --- a/include/connections.php +++ b/include/connections.php @@ -299,6 +299,11 @@ function remove_all_xchan_resources($xchan, $channel_id = 0) { $r = q("delete from pgrp_member where xchan = '%s'", dbesc($xchan) ); + + // Cannot delete just one side of the conversation since we do not allow + // you to block private mail replies. This would leave open a gateway for abuse. + // Both participants are owners of the conversation and both can remove it. + $r = q("delete from mail where ( from_xchan = '%s' or to_xchan = '%s' )", dbesc($xchan), dbesc($xchan) diff --git a/include/import.php b/include/import.php index 1d3b7c035..d3e8f7091 100644 --- a/include/import.php +++ b/include/import.php @@ -1190,9 +1190,9 @@ function sync_files($channel, $files) { logger('sync_files duplicate check: attach_by_hash() returned ' . print_r($x,true), LOGGER_DEBUG); if($x['success']) { - $orig_attach = $x[0]; + $orig_attach = $x['data']; $attach_exists = true; - $attach_id = $x[0]['id']; + $attach_id = $orig_attach['id']; } $newfname = 'store/' . $channel['channel_address'] . '/' . get_attach_binname($att['content']); diff --git a/include/markdown.php b/include/markdown.php index 7d1f16958..213986867 100644 --- a/include/markdown.php +++ b/include/markdown.php @@ -264,6 +264,9 @@ function bb_to_markdown($Text, $options = []) { // Remove empty zrl links $Text = preg_replace("/\[zrl\=\].*?\[\/zrl\]/is", "", $Text); + + // Remove unprocessed spoiler HTML tags + $Text = preg_replace("/<div.+>([^<]+)<.+>(>.+)$/im", "$1\n$2", $Text); $Text = trim($Text); diff --git a/include/queue_fn.php b/include/queue_fn.php index 85f98aaf9..865228041 100644 --- a/include/queue_fn.php +++ b/include/queue_fn.php @@ -286,7 +286,7 @@ function queue_deliver($outq, $immediate = false) { $host_crypto = null; if($channel && $base) { - $h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' order by hubloc_id desc limit 1", + $h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' and hubloc_sitekey != '' order by hubloc_id desc limit 1", dbesc($base) ); if($h) { diff --git a/include/zot.php b/include/zot.php index 60bada1d6..bd85dd755 100644 --- a/include/zot.php +++ b/include/zot.php @@ -2392,7 +2392,6 @@ function process_mail_delivery($sender, $arr, $deliveries) { } } - $r = q("select id, conv_guid from mail where mid = '%s' and channel_id = %d limit 1", dbesc($arr['mid']), intval($channel['channel_id']) diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index 09a2e05e0..186551e2d 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -20,7 +20,7 @@ {{/if}} {{if $item.title && !$item.event}} <div class="p-2{{if $item.is_new}} bg-primary text-white{{/if}} wall-item-title h3{{if !$item.photo}} rounded-top{{/if}}" id="wall-item-title-{{$item.id}}"> - {{if $item.title_tosource}}{{if $item.plink}}<a href="{{$item.plink.href}}" title="{{$item.title}} ({{$item.plink.title}})">{{/if}}{{/if}}{{$item.title}}{{if $item.title_tosource}}{{if $item.plink}}</a>{{/if}}{{/if}} + {{if $item.title_tosource}}{{if $item.plink}}<a href="{{$item.plink.href}}" title="{{$item.title}} ({{$item.plink.title}})" rel="nofollow">{{/if}}{{/if}}{{$item.title}}{{if $item.title_tosource}}{{if $item.plink}}</a>{{/if}}{{/if}} </div> {{if ! $item.is_new}} <hr class="m-0"> diff --git a/view/tpl/conv_list.tpl b/view/tpl/conv_list.tpl index a0c2cf827..8c5b47bf3 100755 --- a/view/tpl/conv_list.tpl +++ b/view/tpl/conv_list.tpl @@ -20,7 +20,7 @@ {{/if}} {{if $item.title && !$item.event}} <div class="p-2{{if $item.is_new}} bg-primary text-white{{/if}} wall-item-title h3{{if !$item.photo}} rounded-top{{/if}}" id="wall-item-title-{{$item.id}}"> - {{if $item.title_tosource}}{{if $item.plink}}<a href="{{$item.plink.href}}" title="{{$item.title}} ({{$item.plink.title}})">{{/if}}{{/if}}{{$item.title}}{{if $item.title_tosource}}{{if $item.plink}}</a>{{/if}}{{/if}} + {{if $item.title_tosource}}{{if $item.plink}}<a href="{{$item.plink.href}}" title="{{$item.title}} ({{$item.plink.title}})" rel="nofollow">{{/if}}{{/if}}{{$item.title}}{{if $item.title_tosource}}{{if $item.plink}}</a>{{/if}}{{/if}} </div> {{if ! $item.is_new}} <hr class="m-0"> diff --git a/view/tpl/usermenu.tpl b/view/tpl/usermenu.tpl index 8bbfedd07..535d5b5a8 100644 --- a/view/tpl/usermenu.tpl +++ b/view/tpl/usermenu.tpl @@ -8,7 +8,7 @@ <ul class="pmenu-body{{if $wrap || !$class}} nav nav-pills flex-column{{elseif !$wrap || $class}} {{$class}}{{/if}}"> {{foreach $items as $mitem }} <li id="pmenu-item-{{$mitem.mitem_id}}" class="nav-item pmenu-item{{if $mitem.submenu}} dropdown{{/if}}"> - <a href="{{if $mitem.submenu}}#{{else}}{{$mitem.mitem_link}}{{/if}}" class="nav-link {{if $mitem.submenu}} dropdown-toggle{{/if}}"{{if $mitem.submenu}} data-toggle="dropdown"{{/if}}{{if $mitem.newwin}}target="_blank"{{/if}}>{{$mitem.mitem_desc}}{{if $mitem.submenu}}<span class="caret"></span>{{/if}}</a> + <a href="{{if $mitem.submenu}}#{{else}}{{$mitem.mitem_link}}{{/if}}" class="nav-link {{if $mitem.submenu}} dropdown-toggle{{/if}}"{{if $mitem.submenu}} data-toggle="dropdown"{{/if}}{{if $mitem.newwin}}target="_blank"{{/if}} rel="nofollow noopener">{{$mitem.mitem_desc}}{{if $mitem.submenu}}<span class="caret"></span>{{/if}}</a> {{if $mitem.submenu}}{{$mitem.submenu}}{{/if}} </li> {{/foreach }} diff --git a/view/tpl/xchan_vcard.tpl b/view/tpl/xchan_vcard.tpl index ac796cd47..9c357bba8 100755 --- a/view/tpl/xchan_vcard.tpl +++ b/view/tpl/xchan_vcard.tpl @@ -1,7 +1,7 @@ <div id="vcard" class="vcard h-card"> <div id="profile-photo-wrapper"><a href="{{$link}}"><img class="vcard-photo photo u-photo" src="{{$photo}}" alt="{{$name}}" /></a></div> {{if $connect}} -<div class="connect-btn-wrapper"><a href="follow?f=&url={{$follow}}" class="btn btn-block btn-success btn-sm"><i class="fa fa-plus"></i> {{$connect}}</a></div> +<div class="connect-btn-wrapper"><a href="follow?f=&url={{$follow}}" class="btn btn-block btn-success btn-sm" rel="nofollow"><i class="fa fa-plus"></i> {{$connect}}</a></div> {{/if}} <div class="fn p-name">{{$name}}</div> </div> |