 		this.clearMessageDraft this.editing.id
 
 	resetToDraft: (id) ->
-		this.input.value = this.records[id].original
-
-
-	getMessageOfElement: (element) -> return ChatMessage.findOne( { _id: element.getAttribute("id") } )
-
+		message = this.getMessageById id
+
+		old_value = this.input.value
+		this.input.value = message.msg
+
+		return old_value isnt message.msg
+
+	getMessageById: (id) ->
+		return ChatMessage.findOne(id)
 
 	toPrevMessage: ->
 		index = this.editing.index


	recordInputAsDraft: () ->
		id = this.editing.id
		record = this.records[id] || {}
		draft = this.input.value

		if(draft is record.original)
			this.clearCurrentDraft()
		else
			record.draft = draft
			this.records[id] = record

	recordOriginalMessage: (message) ->
		record = this.records[message._id] || {}
		record.original = message.msg
		this.records[message._id] = record

	getMessageDraft: (id) ->
		return this.records[id]



		msg = this.getMessageDraft(message._id)?.draft
		msg = message.msg unless msg?

		editingNext = this.editing.index < index

