diff options
author | Christoph Witzany | 2017-10-29 11:16:40 +0100 |
---|---|---|
committer | Christoph Witzany | 2017-10-31 10:34:51 +0100 |
commit | 5cda55086acfc1000f0a0062045db50ad415db59 (patch) | |
tree | 4cad35c71d521507013f33bcd730143847234fb6 /lib/models | |
parent | dad5798472406aad08b1b1c5433f314fdaa679e7 (diff) |
Add mattermost authentication
Diffstat (limited to '')
-rw-r--r-- | lib/models/user.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/models/user.js b/lib/models/user.js index e59b86cc..27566def 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -111,6 +111,15 @@ module.exports = function (sequelize, DataTypes) { photo = letterAvatars(profile.username) } break + case 'mattermost': + photo = profile.avatarUrl + if (photo) { + if (bigger) photo = photo.replace(/(\?s=)\d*$/i, '$1400') + else photo = photo.replace(/(\?s=)\d*$/i, '$196') + } else { + photo = letterAvatars(profile.username) + } + break case 'dropbox': // no image api provided, use gravatar photo = 'https://www.gravatar.com/avatar/' + md5(profile.emails[0].value) |