aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-20 15:36:04 -0800
committerfriendica <info@friendica.com>2013-01-20 15:36:04 -0800
commit127b605f32f8b01900d300cd869c3848e6bebb9b (patch)
treed7bd6c5360950bfbe96d28f94161e082573aae61 /include/zot.php
parent45be26dd81a1679853763bc79c387bf0c6fdfe57 (diff)
downloadvolse-hubzilla-127b605f32f8b01900d300cd869c3848e6bebb9b.tar.gz
volse-hubzilla-127b605f32f8b01900d300cd869c3848e6bebb9b.tar.bz2
volse-hubzilla-127b605f32f8b01900d300cd869c3848e6bebb9b.zip
preserve event item[uri] if present
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/zot.php b/include/zot.php
index 28ecdc4dc..0290d1d46 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -901,16 +901,18 @@ function process_delivery($sender,$arr,$deliveries,$relay) {
$ev['uid'] = $channel['channel_id'];
$ev['account'] = $channel['channel_account_id'];
$ev['edited'] = $arr['edited'];
+ $ev['uri'] = $arr['uri'];
+ $ev['private'] = $arr['item_private'];
// is this an edit?
- $r = q("SELECT * FROM event left join item on resource_id = event_hash WHERE resource_type = 'event' and
- `uri` = '%s' AND event.uid = %d LIMIT 1",
+ $r = q("SELECT resource_id FROM item where uri = '%s' and uid = %d and resource_type = 'event' limit 1",
dbesc($arr['uri']),
intval($channel['channel_id'])
);
- if($r)
- $ev['event_hash'] = $r[0]['event_hash'];
+ if($r) {
+ $ev['event_hash'] = $r[0]['resource_id'];
+ }
dbg(1);
$xyz = event_store($ev);
dbg(0);