4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-09-16 07:12:31 +00:00

Update vendor (mattermost)

This commit is contained in:
Wim
2017-03-25 21:04:10 +01:00
parent 07fd825349
commit eacb1c1771
108 changed files with 26050 additions and 211 deletions

View File

@@ -10,8 +10,10 @@ import (
)
const (
PUSH_NOTIFY_APPLE = "apple"
PUSH_NOTIFY_ANDROID = "android"
PUSH_NOTIFY_APPLE = "apple"
PUSH_NOTIFY_ANDROID = "android"
PUSH_NOTIFY_APPLE_REACT_NATIVE = "apple_rn"
PUSH_NOTIFY_ANDROID_REACT_NATIVE = "android_rn"
PUSH_TYPE_MESSAGE = "message"
PUSH_TYPE_CLEAR = "clear"
@@ -46,12 +48,12 @@ func (me *PushNotification) ToJson() string {
}
func (me *PushNotification) SetDeviceIdAndPlatform(deviceId string) {
if strings.HasPrefix(deviceId, PUSH_NOTIFY_APPLE+":") {
me.Platform = PUSH_NOTIFY_APPLE
me.DeviceId = strings.TrimPrefix(deviceId, PUSH_NOTIFY_APPLE+":")
} else if strings.HasPrefix(deviceId, PUSH_NOTIFY_ANDROID+":") {
me.Platform = PUSH_NOTIFY_ANDROID
me.DeviceId = strings.TrimPrefix(deviceId, PUSH_NOTIFY_ANDROID+":")
index := strings.Index(deviceId, ":")
if index > -1 {
me.Platform = deviceId[:index]
me.DeviceId = deviceId[index+1:]
}
}