1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Added possibility for user transmission

This commit is contained in:
Tim Düsterhus 2011-12-27 12:44:36 +01:00
parent 530c2ab788
commit 22c2f481d5
2 changed files with 5 additions and 4 deletions

View File

@ -137,7 +137,7 @@ TimWolla.WCF ?= {}
dataType: 'json'
type: 'POST'
success: $.proxy((data, textStatus, jqXHR) ->
@handleMessages(data)
@handleMessages(data.messages)
, this)
###
# Inserts the new messages.

View File

@ -50,11 +50,12 @@ public function show() {
parent::show();
@header('Content-type: application/json');
$result = '[';
$json = array('users' => array(), 'messages' => array());
foreach ($this->messages as $message) {
$result .= $message->jsonify().',';
$json['messages'][] = $message->jsonify(true);
}
echo rtrim($result, ',').']';
echo \wcf\util\JSON::encode($json);
exit;
}
}