Xmpp.Views.Chat ||= {}

class Xmpp.Views.Chat.MessageView extends Backbone.View
  template: JST["backbone/templates/chat/message"]
  className: 'message-box'

  initialize: (parts) ->
    _.bindAll(this)

    @user = parts.user
    @date = parts.date
    @message = parts.message

  render: ->
    $(@el).html(@template(username: @user.get('name'), avatar: @user.get('avatar'), date: @date, message: @message))
    return this