diff options
Diffstat (limited to 'Zotlabs')
-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 |
5 files changed, 52 insertions, 11 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); |