item uuid changes

This commit is contained in:
zotlabs
2018-11-12 18:25:55 -08:00
parent 770fdb2b7d
commit 1a2df9c51c
3 changed files with 14 additions and 21 deletions

View File

@@ -574,18 +574,9 @@ function alt_pager($i, $more = '', $less = '') {
* @return string a unique id
*/
function item_message_id() {
do {
$dups = false;
$hash = random_string();
$mid = $hash . '@' . App::get_hostname();
$r = q("SELECT id FROM item WHERE mid = '%s' LIMIT 1",
dbesc($mid));
if($r)
$dups = true;
} while($dups == true);
return new_uuid();
return $mid;
}
/**
@@ -596,17 +587,9 @@ function item_message_id() {
* @return string a uniqe hash
*/
function photo_new_resource() {
do {
$found = false;
$resource = hash('md5', uniqid(mt_rand(), true));
$r = q("SELECT id FROM photo WHERE resource_id = '%s' LIMIT 1",
dbesc($resource));
if($r)
$found = true;
} while($found === true);
return new_uuid();
return $resource;
}
/**