X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FConversation.php;h=56f61c63ab2c1453ebd8250c6c17b721bd358bcc;hb=dd61ae8fbeee64c85f8186672292335592be1ff5;hp=fde9c07adb061b5e1ded2a45a759c63e3dc51b9c;hpb=8a4575ea769cb0349645f1ecfb4e7e66e4cf8d4b;p=quix0rs-gnu-social.git diff --git a/classes/Conversation.php b/classes/Conversation.php index fde9c07adb..56f61c63ab 100644 --- a/classes/Conversation.php +++ b/classes/Conversation.php @@ -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) {