Fix ability to change avatar

This commit is contained in:
Dmitriy Simushev 2012-10-02 09:54:09 +00:00
parent 1528c610d7
commit f1224a98ee

View File

@ -238,8 +238,32 @@ class ThreadProcessor extends RequestProcessor {
$messages = $thread->getMessages($is_user, $last_message_id);
if (! empty($messages)) {
foreach($messages as $key => $msg) {
// Check if message is avatar
if ($msg['ikind'] == Thread::KIND_AVATAR) {
// Update avatar
$this->responses[] = array(
'token' => md5(time() . rand()),
'functions' => array(
array(
'function' => 'setupAvatar',
'arguments' => array(
'threadId' => $thread->id,
'token' => $thread->lastToken,
'return' => array(),
'references' => array(),
'imageLink' => $msg['tmessage']
)
)
)
);
unset($messages[$key]);
continue;
}
// Theme message
$messages[$key] = Thread::themeMessage($msg);
}
// Send messages
$this->responses[] = array(
'token' => md5(time() . rand()),
'functions' => array(