diff --git a/file/js/TimWolla.WCF.Chat.coffee b/file/js/TimWolla.WCF.Chat.coffee index 8b81072..9a5f777 100644 --- a/file/js/TimWolla.WCF.Chat.coffee +++ b/file/js/TimWolla.WCF.Chat.coffee @@ -118,11 +118,11 @@ consoleMock ?= # Clears the stream $('#timsChatClear').click (event) -> - event.preventDefault() - $('.timsChatMessage').remove() - @oldScrollTop = $('.timsChatMessageContainer').scrollTop() - $('.timsChatMessageContainer').scrollTop $('.timsChatMessageContainer ul').height() - $('#timsChatInput').focus() + event.preventDefault() + $('.timsChatMessage').remove() + @oldScrollTop = $('.timsChatMessageContainer').scrollTop() + $('.timsChatMessageContainer').scrollTop $('.timsChatMessageContainer ul').height() + $('#timsChatInput').focus() # Toggle Buttons $('.timsChatToggle').click (event) -> @@ -252,10 +252,12 @@ consoleMock ?= # Insert the messages for message in messages + continue if $.wcfIsset 'timsChatMessage'+message.messageID # Prevent problems with race condition @events.newMessage.fire message output = @messageTemplate.fetch message li = $ '
' + li.attr 'id', 'timsChatMessage'+message.messageID li.addClass 'timsChatMessage timsChatMessage'+message.type li.addClass 'ownMessage' if message.sender is WCF.User.userID li.append output diff --git a/file/lib/data/chat/message/ChatMessage.class.php b/file/lib/data/chat/message/ChatMessage.class.php index 011596b..f300148 100755 --- a/file/lib/data/chat/message/ChatMessage.class.php +++ b/file/lib/data/chat/message/ChatMessage.class.php @@ -103,7 +103,8 @@ public function jsonify($raw = false) { 'time' => $this->time, 'receiver' => $this->receiver, 'type' => $this->type, - 'roomID' => $this->roomID + 'roomID' => $this->roomID, + 'messageID' => $this->messageID ); if ($raw) return $array;