Skip to content

Commit

Permalink
Merge pull request #8099 from RocketChat/set-avatar-on-ldap-login
Browse files Browse the repository at this point in the history
[FIX] Fix setting user avatar on LDAP login
  • Loading branch information
rodrigok committed Sep 14, 2017
1 parent b6034b6 commit 74f85fd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/rocketchat-ldap/server/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,13 @@ syncUserData = function syncUserData(user, ldapUser) {
type: 'image/jpeg'
};

fileStore.insert(file, rs, () => {
Meteor.setTimeout(function() {
RocketChat.models.Users.setAvatarOrigin(user._id, 'ldap');
RocketChat.Notifications.notifyLogged('updateAvatar', {username: user.username});
}, 500);
Meteor.runAsUser(user._id, () => {
fileStore.insert(file, rs, () => {
Meteor.setTimeout(function() {
RocketChat.models.Users.setAvatarOrigin(user._id, 'ldap');
RocketChat.Notifications.notifyLogged('updateAvatar', {username: user.username});
}, 500);
});
});
}
}
Expand Down

0 comments on commit 74f85fd

Please sign in to comment.