diff options
author | =Corey Hulen <corey@hulen.com> | 2016-01-15 09:16:07 -0600 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2016-01-15 09:16:07 -0600 |
commit | cc71c3e70646d4e8da5e8477933fc0c1576a3087 (patch) | |
tree | 324ff1a37a43c0a4ccae24b9990973f3d287bc47 | |
parent | 586967b757a869dbb5f3677e605009a1f5c61005 (diff) | |
parent | c672820ff6a2a58d390c9bbc80fffdcc654e2716 (diff) | |
download | chat-cc71c3e70646d4e8da5e8477933fc0c1576a3087.tar.gz chat-cc71c3e70646d4e8da5e8477933fc0c1576a3087.tar.bz2 chat-cc71c3e70646d4e8da5e8477933fc0c1576a3087.zip |
merging
-rw-r--r-- | api/post.go | 13 | ||||
-rw-r--r-- | config/config.json | 25 | ||||
-rw-r--r-- | docker/1.4/Dockerfile | 2 | ||||
-rw-r--r-- | web/react/components/user_settings/user_settings_security.jsx | 6 |
4 files changed, 15 insertions, 31 deletions
diff --git a/api/post.go b/api/post.go index be1ecd96a..ae4d3cc50 100644 --- a/api/post.go +++ b/api/post.go @@ -632,15 +632,22 @@ func sendNotificationsAndForget(c *Context, post *model.Post, team *model.Team, alreadySeen := make(map[string]string) for _, session := range sessions { - if len(session.DeviceId) > 0 && alreadySeen[session.DeviceId] == "" && strings.HasPrefix(session.DeviceId, "apple:") { + if len(session.DeviceId) > 0 && alreadySeen[session.DeviceId] == "" && + (strings.HasPrefix(session.DeviceId, model.PUSH_NOTIFY_APPLE+":") || strings.HasPrefix(session.DeviceId, model.PUSH_NOTIFY_ANDROID+":")) { alreadySeen[session.DeviceId] = session.DeviceId msg := model.PushNotification{} - msg.Platform = model.PUSH_NOTIFY_APPLE msg.Badge = 1 - msg.DeviceId = strings.TrimPrefix(session.DeviceId, "apple:") msg.ServerId = utils.CfgDiagnosticId + if strings.HasPrefix(session.DeviceId, model.PUSH_NOTIFY_APPLE+":") { + msg.Platform = model.PUSH_NOTIFY_APPLE + msg.DeviceId = strings.TrimPrefix(session.DeviceId, model.PUSH_NOTIFY_APPLE+":") + } else if strings.HasPrefix(session.DeviceId, model.PUSH_NOTIFY_ANDROID+":") { + msg.Platform = model.PUSH_NOTIFY_ANDROID + msg.DeviceId = strings.TrimPrefix(session.DeviceId, model.PUSH_NOTIFY_ANDROID+":") + } + if channel.Type == model.CHANNEL_DIRECT { msg.Message = senderName + " sent you a direct message" } else { diff --git a/config/config.json b/config/config.json index b3822692e..1a4156c8f 100644 --- a/config/config.json +++ b/config/config.json @@ -109,28 +109,5 @@ "AuthEndpoint": "", "TokenEndpoint": "", "UserApiEndpoint": "" - }, - "GoogleSettings": { - "Enable": false, - "Secret": "", - "Id": "", - "Scope": "", - "AuthEndpoint": "", - "TokenEndpoint": "", - "UserApiEndpoint": "" - }, - "LdapSettings": { - "Enable": false, - "LdapServer": null, - "LdapPort": 389, - "BaseDN": null, - "BindUsername": null, - "BindPassword": null, - "FirstNameAttribute": null, - "LastNameAttribute": null, - "EmailAttribute": null, - "UsernameAttribute": null, - "IdAttribute": null, - "QueryTimeout": 60 } -}
\ No newline at end of file +} diff --git a/docker/1.4/Dockerfile b/docker/1.4/Dockerfile index 1f0acdfc9..8dcea3927 100644 --- a/docker/1.4/Dockerfile +++ b/docker/1.4/Dockerfile @@ -34,7 +34,7 @@ VOLUME /var/lib/mysql WORKDIR /mattermost # Copy over files -ADD https://github.com/mattermost/platform/releases/download/v1.4.0-rc2/mattermost.tar.gz / +ADD https://github.com/mattermost/platform/releases/download/v1.4.0/mattermost.tar.gz / RUN tar -zxvf /mattermost.tar.gz --strip-components=1 && rm /mattermost.tar.gz ADD config_docker.json / ADD docker-entry.sh / diff --git a/web/react/components/user_settings/user_settings_security.jsx b/web/react/components/user_settings/user_settings_security.jsx index d9c5f58a9..d1266dd3f 100644 --- a/web/react/components/user_settings/user_settings_security.jsx +++ b/web/react/components/user_settings/user_settings_security.jsx @@ -206,7 +206,7 @@ export default class SecurityTab extends React.Component { <div> <a className='btn btn-primary' - href={'/' + teamName + '/claim?email=' + user.email} + href={'/' + teamName + '/claim?email=' + encodeURIComponent(user.email)} > {'Switch to using email and password'} </a> @@ -221,7 +221,7 @@ export default class SecurityTab extends React.Component { <div> <a className='btn btn-primary' - href={'/' + teamName + '/claim?email=' + user.email + '&new_type=' + Constants.GITLAB_SERVICE} + href={'/' + teamName + '/claim?email=' + encodeURIComponent(user.email) + '&new_type=' + Constants.GITLAB_SERVICE} > {'Switch to using GitLab SSO'} </a> @@ -236,7 +236,7 @@ export default class SecurityTab extends React.Component { <div> <a className='btn btn-primary' - href={'/' + teamName + '/claim?email=' + user.email + '&new_type=' + Constants.GOOGLE_SERVICE} + href={'/' + teamName + '/claim?email=' + encodeURIComponent(user.email) + '&new_type=' + Constants.GOOGLE_SERVICE} > {'Switch to using Google SSO'} </a> |