4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-05 08:14:04 +00:00

Update dependencies (#1610)

* Update dependencies

* Update module to go 1.17
This commit is contained in:
Wim
2021-10-17 00:47:22 +02:00
committed by GitHub
parent 7ae45c42e7
commit 4dd8bae5c9
494 changed files with 15698 additions and 19720 deletions

View File

@ -70,23 +70,23 @@ type PushNotification struct {
IsIdLoaded bool `json:"is_id_loaded"`
}
func (me *PushNotification) ToJson() string {
b, _ := json.Marshal(me)
func (pn *PushNotification) ToJson() string {
b, _ := json.Marshal(pn)
return string(b)
}
func (me *PushNotification) DeepCopy() *PushNotification {
copy := *me
func (pn *PushNotification) DeepCopy() *PushNotification {
copy := *pn
return &copy
}
func (me *PushNotification) SetDeviceIdAndPlatform(deviceId string) {
func (pn *PushNotification) SetDeviceIdAndPlatform(deviceId string) {
index := strings.Index(deviceId, ":")
if index > -1 {
me.Platform = deviceId[:index]
me.DeviceId = deviceId[index+1:]
pn.Platform = deviceId[:index]
pn.DeviceId = deviceId[index+1:]
}
}
@ -94,11 +94,11 @@ func PushNotificationFromJson(data io.Reader) (*PushNotification, error) {
if data == nil {
return nil, errors.New("push notification data can't be nil")
}
var me *PushNotification
if err := json.NewDecoder(data).Decode(&me); err != nil {
var pn *PushNotification
if err := json.NewDecoder(data).Decode(&pn); err != nil {
return nil, err
}
return me, nil
return pn, nil
}
func PushNotificationAckFromJson(data io.Reader) (*PushNotificationAck, error) {