From e466d72058b2543bec69c77d2730828acada38a1 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 26 May 2019 18:05:11 +0200 Subject: adjust birthday handling according to community decision and slightly change display of allday event items --- Zotlabs/Lib/Libzot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Lib/Libzot.php') diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 9bf987027..976ed22fa 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -2766,7 +2766,7 @@ class Libzot { $profile['description'] = $p[0]['pdesc']; $profile['birthday'] = $p[0]['dob']; - if(($profile['birthday'] != '0000-00-00') && (($bd = z_birthday($p[0]['dob'],$e['channel_timezone'])) !== '')) + if(($profile['birthday'] != '0000-00-00') && (($bd = z_birthday($p[0]['dob'],'UTC')) !== '')) $profile['next_birthday'] = $bd; if($age = age($p[0]['dob'],$e['channel_timezone'],'')) -- cgit v1.2.3 From decd0dc035cce0918519bef77742ff87db23e3f3 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 12 Jun 2019 11:27:39 +0200 Subject: more work on event item deletion --- Zotlabs/Lib/Libzot.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Zotlabs/Lib/Libzot.php') diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 976ed22fa..ba9ffbead 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -2074,6 +2074,25 @@ class Libzot { return false; } + if ($item['obj_type'] == ACTIVITY_OBJ_EVENT) { + $i = q("SELECT * FROM event WHERE event_hash = '%s' AND uid = %d LIMIT 1", + dbesc($item['uuid']), + intval($uid) + ); + if ($i) { + if ($i[0]['event_xchan'] === $sender) { + q("delete from event where event_hash = '%s' and uid = %d", + dbesc($item['uuid']), + intval($uid) + ); + } + else { + logger('delete linked event: not owner'); + return; + } + } + } + if($item_found) { if(intval($r[0]['item_deleted'])) { logger('delete_imported_item: item was already deleted'); -- cgit v1.2.3 From bc34167c8490c2dad5fcd6553b27b5df54449c39 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 12 Jun 2019 12:46:29 +0200 Subject: port delete fixes from zap --- Zotlabs/Lib/Libzot.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'Zotlabs/Lib/Libzot.php') diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index ba9ffbead..0ad8afc94 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -2037,7 +2037,7 @@ class Libzot { $item_found = false; $post_id = 0; - $r = q("select id, author_xchan, owner_xchan, source_xchan, item_deleted from item where ( author_xchan = '%s' or owner_xchan = '%s' or source_xchan = '%s' ) + $r = q("select * from item where ( author_xchan = '%s' or owner_xchan = '%s' or source_xchan = '%s' ) and mid = '%s' and uid = %d limit 1", dbesc($sender), dbesc($sender), @@ -2047,10 +2047,12 @@ class Libzot { ); if($r) { - if($r[0]['author_xchan'] === $sender || $r[0]['owner_xchan'] === $sender || $r[0]['source_xchan'] === $sender) + $stored = $r[0]; + + if($stored['author_xchan'] === $sender || $stored['owner_xchan'] === $sender || $stored['source_xchan'] === $sender) $ownership_valid = true; - $post_id = $r[0]['id']; + $post_id = $stored['id']; $item_found = true; } else { @@ -2074,15 +2076,15 @@ class Libzot { return false; } - if ($item['obj_type'] == ACTIVITY_OBJ_EVENT) { + if ($stored['resource_type'] === 'event') { $i = q("SELECT * FROM event WHERE event_hash = '%s' AND uid = %d LIMIT 1", - dbesc($item['uuid']), + dbesc($stored['resource_id']), intval($uid) ); if ($i) { if ($i[0]['event_xchan'] === $sender) { q("delete from event where event_hash = '%s' and uid = %d", - dbesc($item['uuid']), + dbesc($stored['resource_id']), intval($uid) ); } @@ -2094,7 +2096,7 @@ class Libzot { } if($item_found) { - if(intval($r[0]['item_deleted'])) { + if(intval($stored['item_deleted'])) { logger('delete_imported_item: item was already deleted'); if(! $relay) return false; @@ -2106,10 +2108,10 @@ class Libzot { // back, and we aren't going to (or shouldn't at any rate) delete it again in the future - so losing // this information from the metadata should have no other discernible impact. - if (($r[0]['id'] != $r[0]['parent']) && intval($r[0]['item_origin'])) { + if (($stored['id'] != $stored['parent']) && intval($stored['item_origin'])) { q("update item set item_origin = 0 where id = %d and uid = %d", - intval($r[0]['id']), - intval($r[0]['uid']) + intval($stored['id']), + intval($stored['uid']) ); } } -- cgit v1.2.3 From cf844cb27c02c3aae636eb1aa1587b1d5e3e81a0 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 26 Jun 2019 21:45:21 -0700 Subject: http signature consolidation --- Zotlabs/Lib/Libzot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Lib/Libzot.php') diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 976ed22fa..de041bd6b 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -2,7 +2,7 @@ namespace Zotlabs\Lib; -use Zotlabs\Zot6\HTTPSig; +use Zotlabs\Web\HTTPSig; use Zotlabs\Access\Permissions; use Zotlabs\Access\PermissionLimits; use Zotlabs\Daemon\Master; -- cgit v1.2.3