From 5cda55086acfc1000f0a0062045db50ad415db59 Mon Sep 17 00:00:00 2001 From: Christoph Witzany Date: Sun, 29 Oct 2017 11:16:40 +0100 Subject: Add mattermost authentication --- lib/models/user.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/models/user.js') 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) -- cgit v1.2.3