Skip to content
This repository has been archived by the owner on Dec 1, 2017. It is now read-only.

Commit

Permalink
Making sure we always get the real name and correct gravatar size.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwex committed Aug 14, 2012
1 parent 8039f25 commit b6d36a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require('../../lib/extensions/string');

function User(attrs){
this.email = (attrs['email'] || '').trim();
this.realName = (attrs['realName'] || '').trim();
this.realName = (attrs['realName'] || attrs['real_name'] || '').trim();
this.nick = (attrs['nick'] || '').trim();
this.gravatarHash = crypto.createHash('md5').update(this.email).digest("hex");
}
Expand All @@ -43,7 +43,7 @@ User.prototype.getGravatarUrl = function(size){
size = 30;
}
var hash = crypto.createHash('md5').update(this.email).digest("hex");
return "http://www.gravatar.com/avatar/" + hash + "s=" + size;
return "http://www.gravatar.com/avatar/" + hash + "?s=" + size;
};

User.prototype.save = function(callback){
Expand Down

0 comments on commit b6d36a6

Please sign in to comment.