From 9d19afcdf27d27724619addab736f4a236e138e1 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Fri, 28 Sep 2012 12:18:10 +0000 Subject: [PATCH] Add auto token generate during Thread creation --- src/messenger/webim/libs/classes/thread.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/messenger/webim/libs/classes/thread.php b/src/messenger/webim/libs/classes/thread.php index 996b0b16..d0939a20 100644 --- a/src/messenger/webim/libs/classes/thread.php +++ b/src/messenger/webim/libs/classes/thread.php @@ -213,6 +213,7 @@ Class Thread { if (empty($thread->id)) { return false; } + $thread->lastToken = self::nextToken(); return $thread; } @@ -320,6 +321,15 @@ Class Thread { return $val; } + /** + * Create thread token + * + * @return int Thread token + */ + protected static function nextToken() { + return rand(99999, 99999999); + } + /** * Implementation of the magic __get method *