summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-12-09 09:34:15 -0500
committerJoram Wilander <jwawilander@gmail.com>2015-12-09 09:34:15 -0500
commit34cf264a08890f494144bd11663770b191bae9ef (patch)
treebb5c4c351a1f30b8d84b4ad138360140f78d6673
parent7ead8171993a1652f4ba0c555ed198b5285bd7c0 (diff)
parent20e3c568d146d0fe653975c8059cd4bc2e7911e9 (diff)
downloadchat-34cf264a08890f494144bd11663770b191bae9ef.tar.gz
chat-34cf264a08890f494144bd11663770b191bae9ef.tar.bz2
chat-34cf264a08890f494144bd11663770b191bae9ef.zip
Merge pull request #1667 from mattermost/fix-push
Fixing push notifications
-rw-r--r--api/post.go6
-rw-r--r--config/config.json4
-rw-r--r--docker/dev/config_docker.json4
-rw-r--r--docker/local/config_docker.json4
-rw-r--r--model/config.go4
5 files changed, 13 insertions, 9 deletions
diff --git a/api/post.go b/api/post.go
index e1adc1d98..6736d75e2 100644
--- a/api/post.go
+++ b/api/post.go
@@ -565,7 +565,11 @@ func sendNotificationsAndForget(c *Context, post *model.Post, team *model.Team,
msg.DeviceId = strings.TrimPrefix(session.DeviceId, "apple:")
msg.ServerId = utils.CfgDiagnosticId
- msg.Message = profileMap[id].FirstName + " mentioned you in " + channel.DisplayName
+ if channel.Type == model.CHANNEL_DIRECT {
+ msg.Message = channelName + " sent you a direct message"
+ } else {
+ msg.Message = profileMap[id].FirstName + " mentioned you in " + channelName
+ }
httpClient := http.Client{}
request, _ := http.NewRequest("POST", *utils.Cfg.EmailSettings.PushNotificationServer+"/api/v1/send_push", strings.NewReader(msg.ToJson()))
diff --git a/config/config.json b/config/config.json
index 999ea8a83..4220d1055 100644
--- a/config/config.json
+++ b/config/config.json
@@ -68,8 +68,8 @@
"ConnectionSecurity": "",
"InviteSalt": "bjlSR4QqkXFBr7TP4oDzlfZmcNuH9YoS",
"PasswordResetSalt": "vZ4DcKyVVRlKHHJpexcuXzojkE5PZ5eL",
- "SendPushNotifications": true,
- "PushNotificationServer": "https://push.mattermost.com"
+ "SendPushNotifications": false,
+ "PushNotificationServer": ""
},
"RateLimitSettings": {
"EnableRateLimiter": true,
diff --git a/docker/dev/config_docker.json b/docker/dev/config_docker.json
index 4c5502ddd..a35abb9da 100644
--- a/docker/dev/config_docker.json
+++ b/docker/dev/config_docker.json
@@ -68,8 +68,8 @@
"ConnectionSecurity": "",
"InviteSalt": "bjlSR4QqkXFBr7TP4oDzlfZmcNuH9YoS",
"PasswordResetSalt": "vZ4DcKyVVRlKHHJpexcuXzojkE5PZ5eL",
- "SendPushNotifications": true,
- "PushNotificationServer": "https://push.mattermost.com"
+ "SendPushNotifications": false,
+ "PushNotificationServer": ""
},
"RateLimitSettings": {
"EnableRateLimiter": true,
diff --git a/docker/local/config_docker.json b/docker/local/config_docker.json
index 4c5502ddd..a35abb9da 100644
--- a/docker/local/config_docker.json
+++ b/docker/local/config_docker.json
@@ -68,8 +68,8 @@
"ConnectionSecurity": "",
"InviteSalt": "bjlSR4QqkXFBr7TP4oDzlfZmcNuH9YoS",
"PasswordResetSalt": "vZ4DcKyVVRlKHHJpexcuXzojkE5PZ5eL",
- "SendPushNotifications": true,
- "PushNotificationServer": "https://push.mattermost.com"
+ "SendPushNotifications": false,
+ "PushNotificationServer": ""
},
"RateLimitSettings": {
"EnableRateLimiter": true,
diff --git a/model/config.go b/model/config.go
index 869f975e6..14ce444c5 100644
--- a/model/config.go
+++ b/model/config.go
@@ -181,12 +181,12 @@ func (o *Config) SetDefaults() {
if o.EmailSettings.SendPushNotifications == nil {
o.EmailSettings.SendPushNotifications = new(bool)
- *o.EmailSettings.SendPushNotifications = true
+ *o.EmailSettings.SendPushNotifications = false
}
if o.EmailSettings.PushNotificationServer == nil {
o.EmailSettings.PushNotificationServer = new(string)
- *o.EmailSettings.PushNotificationServer = "https://push.mattermost.com"
+ *o.EmailSettings.PushNotificationServer = ""
}
}