diff options
author | zotlabs <mike@macgirvin.com> | 2018-11-15 16:34:09 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-11-15 16:34:09 -0800 |
commit | 39d914c9dfe87021351cb2aad9feedd381e791ec (patch) | |
tree | f13c34440bc702085f7d7031a7d14ebb5e006285 /Zotlabs/Lib | |
parent | 8d2f4d9dfd90d218a68e0e36ccf537d800b09755 (diff) | |
download | volse-hubzilla-39d914c9dfe87021351cb2aad9feedd381e791ec.tar.gz volse-hubzilla-39d914c9dfe87021351cb2aad9feedd381e791ec.tar.bz2 volse-hubzilla-39d914c9dfe87021351cb2aad9feedd381e791ec.zip |
add item.uuid to relevant places
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r-- | Zotlabs/Lib/NativeWiki.php | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/Zotlabs/Lib/NativeWiki.php b/Zotlabs/Lib/NativeWiki.php index cdabbc3e9..e2bd07c0d 100644 --- a/Zotlabs/Lib/NativeWiki.php +++ b/Zotlabs/Lib/NativeWiki.php @@ -40,26 +40,17 @@ class NativeWiki { function create_wiki($channel, $observer_hash, $wiki, $acl) { - // Generate unique resource_id using the same method as item_message_id() - do { - $dups = false; - $resource_id = random_string(); - $r = q("SELECT mid FROM item WHERE resource_id = '%s' AND resource_type = '%s' AND uid = %d LIMIT 1", - dbesc($resource_id), - dbesc(NWIKI_ITEM_RESOURCE_TYPE), - intval($channel['channel_id']) - ); - if($r) - $dups = true; - } while($dups == true); + $resource_id = new_uuid(); + $uuid = new_uuid(); $ac = $acl->get(); - $mid = item_message_id(); + $mid = z_root() . '/item/' . $uuid; $arr = array(); // Initialize the array of parameters for the post $item_hidden = ((intval($wiki['postVisible']) === 0) ? 1 : 0); $wiki_url = z_root() . '/wiki/' . $channel['channel_address'] . '/' . $wiki['urlName']; $arr['aid'] = $channel['channel_account_id']; + $arr['uuid'] = $uuid; $arr['uid'] = $channel['channel_id']; $arr['mid'] = $mid; $arr['parent_mid'] = $mid; |