 		i18nLabel: 'Edit'
 		action: (event, instance) ->
 			message = $(event.currentTarget).closest('.message')[0]
-			instance.chatMessages.edit(message)
+			chatMessages[Session.get('openedRoom')].edit(message)
 			$("\##{message.id} .message-dropdown").hide()
 			input = instance.find('.input-message')
 			Meteor.setTimeout ->

					timer: 1000
					showConfirmButton: false

				instance.chatMessages.deleteMsg(message)
		validation: (message) ->
			return RocketChat.authz.hasAtLeastOnePermission('delete-message', message.rid ) or RocketChat.settings.get('Message_AllowDeleting') and message.u?._id is Meteor.userId()
		order: 2
		Tracker.nonreactive ->
			btns = buttons.get()
			if btns[id]
				btns[id] = _.extend btns[id], config
				buttons.set btns

	getButtons = (message) ->
		allButtons = _.toArray buttons.get()
		if message
			allowedButtons = _.compact _.map allButtons, (button) ->
				if not button.validation? or button.validation(message)
					return button
		else
			allowedButtons = allButtons

		return _.sortBy allowedButtons, 'order'

	resetButtons = ->
