From 9f09b136b82911cb0c940bca1c0a6bb4e9665be8 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Thu, 27 Nov 2014 17:05:01 +0100 Subject: [PATCH] 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. --- classes/Conversation.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) {