From: Mikael Nordfeldth Date: Thu, 27 Nov 2014 16:05:01 +0000 (+0100) Subject: Adding crc32 to uniqueify conversation URIs X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9f09b136b82911cb0c940bca1c0a6bb4e9665be8;p=quix0rs-gnu-social.git Adding crc32 to uniqueify conversation URIs This really should be a UUID or something else totally unexpected but I figure that crc32 is good enough for now. The reason we keep the main structure is because some third party scripts have begun relying upon the tag URI format to parse out domain name, type etc. --- diff --git a/classes/Conversation.php b/classes/Conversation.php index 67ac89cf1c..56f61c63ab 100644 --- a/classes/Conversation.php +++ b/classes/Conversation.php @@ -71,10 +71,11 @@ class Conversation extends Managed_DataObject $conv = new Conversation(); $conv->created = common_sql_now(); $conv->id = $notice->id; - $conv->uri = $uri ?: sprintf('%s%s=%d:%s=%s', + $conv->uri = $uri ?: sprintf('%s%s=%d:%s=%s:%s=%x', TagURI::mint(), 'noticeId', $notice->id, - 'objectType', 'thread'); + 'objectType', 'thread', + 'crc32', crc32($notice->content)); $result = $conv->insert(); if ($result === false) {