diff --git a/client/views/avatar/avatar.coffee b/client/views/avatar/avatar.coffee index 01242ad63c6..b6492dd9c98 100644 --- a/client/views/avatar/avatar.coffee +++ b/client/views/avatar/avatar.coffee @@ -10,5 +10,5 @@ Template.avatar.helpers random = Session.get('AvatarRandom') if not username? and this.userId? username = Meteor.users.findOne(this.userId)?.username - url = "#{Meteor.absoluteUrl()}avatar/#{username}?_dc=#{random}" + url = "#{Meteor.absoluteUrl()}avatar/#{username}.jpg?_dc=#{random}" return url \ No newline at end of file diff --git a/server/methods/setAvatarFromService.coffee b/server/methods/setAvatarFromService.coffee index 75b80125b62..0565684da58 100644 --- a/server/methods/setAvatarFromService.coffee +++ b/server/methods/setAvatarFromService.coffee @@ -8,7 +8,7 @@ Meteor.methods {image, contentType} = RocketFile.dataURIParse dataURI rs = RocketFile.bufferToStream new Buffer(image, 'base64') - ws = RocketFileAvatarInstance.createWriteStream user.username, contentType + ws = RocketFileAvatarInstance.createWriteStream "#{user.username}.jpg", contentType ws.on 'end', Meteor.bindEnvironment -> Meteor.users.update {_id: user._id}, {$set: {avatarOrigin: service}} @@ -22,7 +22,7 @@ Meteor.methods user = Meteor.user() - RocketFileAvatarInstance.deleteFile user.username + RocketFileAvatarInstance.deleteFile "#{user.username}.jpg" Meteor.users.update user._id, {$unset: {avatarOrigin: 1}} return