Skip to content

Commit

Permalink
fix(moodle): better moodle notification msg
Browse files Browse the repository at this point in the history
  • Loading branch information
dcai committed Jan 31, 2020
1 parent 9cef643 commit 0f5f16f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions hooks/moodle.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@ def process_pushnotification_payload(data):
if not title:
title = "Notification"

data["fcm"] = {
"data": {"title": title, "site": site, "userfrom": userfrom, "notif": notif}
}

if "alert" not in data:
data["alert"] = message
data["alert"] = {"body": message, "title": title}

data["fcm"] = {"data": extra}
if not "wns" in extra:
data["extra"]["wns"] = {
data["wns"] = {
"type": "toast",
"template": "ToastText01",
"text": [data["alert"]],
Expand Down

0 comments on commit 0f5f16f

Please sign in to comment.