Use .jpg in avatars

pull/111/head
Rodrigo Nascimento 11 years ago
parent 2c8ff8e124
commit 24fa96040c
  1. 2
      client/views/avatar/avatar.coffee
  2. 4
      server/methods/setAvatarFromService.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

@ -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

Loading…
Cancel
Save