]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Conversation.php
Merge branch 'fixes/private_scope_on_tags' into social-master
[quix0rs-gnu-social.git] / classes / Conversation.php
index fde9c07adb061b5e1ded2a45a759c63e3dc51b9c..56f61c63ab2c1453ebd8250c6c17b721bd358bcc 100644 (file)
@@ -63,7 +63,7 @@ class Conversation extends Managed_DataObject
      *
      * @return Conversation the new conversation DO
      */
-    static function create(Notice $notice)
+    static function create(Notice $notice, $uri=null)
     {
         if (empty($notice->id)) {
             throw new ServerException(_('Tried to create conversation for not yet inserted notice'));
@@ -71,10 +71,11 @@ class Conversation extends Managed_DataObject
         $conv = new Conversation();
         $conv->created = common_sql_now();
         $conv->id = $notice->id;
-        $conv->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) {