 		catch e
 			console.log '[routes.coffee] api/v1/admin.listRoomInfo Error: ', e.message, e.stack
 			return RocketChat.API.v1.failure e.name + ': ' + e.message
-			
-=======
-	
->>>>>>> c8cce2e553f8e5299869595757fffa026bd32d05
+			
				body: [rooms: rooms]
		catch e
			return RocketChat.API.v1.failure e.name + ': ' + e.message
<<<<<<< HEAD
	

RocketChat.API.v1.addRoute 'admin.addUpdateUser', authRequired: true,
	post: ->
	
		if RocketChat.authz.hasRole(@userId, 'admin') is false
			return RocketChat.API.v1.unauthorized()
		
		try
			console.log '[routes.coffee] api/v1/admin.addUpdateUser -> request ', _.omit @bodyParams, ['password']
			if !_.isObject @bodyParams
				return RocketChat.API.v1.failure()
					error : 'Request body not encoded as valid JSON'
			
			udata = _.pick @bodyParams, [
					'name'
					'username'
					'email'
					'password'
					'requiredPasswordChange'
					'joinDefaultChannels'
					'verified'
					'sendWelcomeEmail'
				]
			_.defaults udata, {
				'name': '', 
				'username': '',
				'email': '',
				'password': '',
				'requiredPasswordChange': true,
				'joinDefaultChannels': true,
				'verified': false,
				'sendWelcomeEmail': true,
			}
				
			Meteor.runAsUser this.userId, () =>
				Meteor.call 'insertOrUpdateUser', udata
			return RocketChat.API.v1.success
				user: RocketChat.models.Users.findOneByUsername udata.username
				 
		catch e
			console.log '[routes.coffee] api/v1/admin.addUpdateUser Error: ', e.message, e.stack
			return RocketChat.API.v1.failure e.name + ': ' + e.message
			
###
can take these as args to update.

		
		return RocketChat.API.v1.success
			body: [ name:@bodyParams.name]


# Get Room Information
RocketChat.API.v1.addRoute 'room.info', authRequired: true,
	post: ->
		
		if RocketChat.authz.hasRole(@userId, 'admin') is false
			return RocketChat.API.v1.unauthorized()

		try
			check @bodyParams,
				roomId: Match.Maybe(String)
				name: Match.Maybe(String)
			
			this.response.setTimeout(1000)
			room = RocketChat.models.Rooms.findOneById @bodyParams.roomId
			if !room
				room = RocketChat.models.Rooms.findOneByName @bodyParams.name

			return { room: room }
		
		catch e
			return RocketChat.API.v1.failure e.name + ': ' + e.message
				
				
### Retrieve integrations for a specific room
