 		transformWrite: transformWrite
 
 	WebApp.connectHandlers.use '/avatar/', (req, res, next) ->
-		console.log 'avatar called!'
 		this.params =
 			username: req.url.replace(/^\//, '').replace(/\?.*$/, '')
 

		transformWrite = (file, readStream, writeStream) ->
			RocketChatFile.gm(readStream, file.fileName).background('#ffffff').resize(width, height+'^>').gravity('Center').extent(width, height).stream('jpeg').pipe(writeStream)

	path = "/var"

	if RocketChat.settings.get('Accounts_AvatarStorePath')?.trim() isnt ''
		path = RocketChat.settings.get 'Accounts_AvatarStorePath'

Meteor.startup ->
	storeType = 'GridFS'

	if RocketChat.settings.get 'Accounts_AvatarStoreType'
		storeType = RocketChat.settings.get 'Accounts_AvatarStoreType'

	RocketChatStore = RocketChatFile[storeType]

