Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #637 from leopoldfreeman/master
Browse files Browse the repository at this point in the history
Add updateUserInfo function to connectionService
  • Loading branch information
py8765 committed Nov 4, 2014
2 parents f132be6 + e07e6af commit 0269219
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/common/service/connectionService.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@ pro.addLoginedUser = function(uid, info) {
this.logined[uid] = info;
};

/**
* Update user info.
* @param uid {String} user id
* @param info {Object} info for update.
*/
pro.updateUserInfo = function(uid, info) {
var user = this.logined[uid];
if (!user) {
return;
}

for (var p in info) {
if (info.hasOwnProperty(p) && typeof info[p] !== 'function') {
user[p] = info[p];
}
}
};

/**
* Increase connection count
*/
Expand Down

0 comments on commit 0269219

Please sign in to comment.