aboutsummaryrefslogtreecommitdiff
path: root/classes/Conversation.php
diff options
context:
space:
mode:
authorMikael Nordfeldth <mmn@hethane.se>2014-11-27 17:05:01 +0100
committerMikael Nordfeldth <mmn@hethane.se>2014-11-27 17:05:01 +0100
commit9f09b136b82911cb0c940bca1c0a6bb4e9665be8 (patch)
treed417340b4499b748613e42cbd310f98f40993f72 /classes/Conversation.php
parent72d1c3c73e47bb72e9e69e125ddd222abbee3296 (diff)
downloadgnu-social-9f09b136b82911cb0c940bca1c0a6bb4e9665be8.tar
gnu-social-9f09b136b82911cb0c940bca1c0a6bb4e9665be8.zip
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.
Diffstat (limited to 'classes/Conversation.php')
-rw-r--r--classes/Conversation.php5
1 files 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) {