Skip to content

Commit

Permalink
fix: handle location and contact sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
shridarpatil committed May 3, 2024
1 parent 665e086 commit 409e2fc
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@
"label": "Status",
"read_only": 1
},
{
"allow_in_quick_entry": 1,
"fieldname": "message",
"fieldtype": "HTML Editor",
"label": "Message",
"set_only_once": 1
},
{
"allow_in_quick_entry": 1,
"depends_on": "eval:(doc.type==\"Outgoing\");",
Expand All @@ -70,17 +63,49 @@
"label": "TO ",
"set_only_once": 1
},
{
"fieldname": "column_break_5",
"fieldtype": "Column Break"
},
{
"depends_on": "eval:(doc.type==\"Incoming\");",
"fieldname": "from",
"fieldtype": "Data",
"label": "From",
"set_only_once": 1
},
{
"default": "0",
"fieldname": "use_template",
"fieldtype": "Check",
"label": "Use Template"
},
{
"depends_on": "eval:doc.use_template == 1",
"fieldname": "template",
"fieldtype": "Link",
"label": "Template",
"options": "WhatsApp Templates"
},
{
"fieldname": "template_parameters",
"fieldtype": "Small Text",
"label": "Template Parameters",
"read_only": 1
},
{
"fieldname": "template_header_parameters",
"fieldtype": "Small Text",
"label": "Template Header Parameters",
"read_only": 1
},
{
"fieldname": "column_break_5",
"fieldtype": "Column Break"
},
{
"allow_in_quick_entry": 1,
"fieldname": "message",
"fieldtype": "HTML Editor",
"label": "Message",
"set_only_once": 1
},
{
"allow_in_quick_entry": 1,
"fieldname": "message_type",
Expand All @@ -106,7 +131,7 @@
"fieldname": "content_type",
"fieldtype": "Select",
"label": "Content Type",
"options": "\ntext\ndocument\nimage\nvideo\naudio\nflow\nlocation\ncontacts",
"options": "\ntext\ndocument\nimage\nvideo\naudio\nflow\nreaction\nlocation\ncontact",
"reqd": 1
},
{
Expand All @@ -116,18 +141,20 @@
"fieldtype": "Attach",
"label": "Attach"
},
{
"fieldname": "section_break_iyjf",
"fieldtype": "Section Break"
},
{
"default": "0",
"fieldname": "use_template",
"fieldname": "is_reply",
"fieldtype": "Check",
"label": "Use Template"
"label": "Is Reply"
},
{
"depends_on": "eval:doc.use_template == 1",
"fieldname": "template",
"fieldtype": "Link",
"label": "Template",
"options": "WhatsApp Templates"
"fieldname": "reply_to_message_id",
"fieldtype": "Data",
"label": "Reply To Message ID"
},
{
"fieldname": "section_break_dhba",
Expand All @@ -148,42 +175,11 @@
"fieldtype": "Dynamic Link",
"label": "Reference name",
"options": "reference_doctype"
},
{
"fieldname": "reply_to_message_id",
"fieldtype": "Data",
"label": "Reply To Message ID"
},
{
"fieldname": "section_break_iyjf",
"fieldtype": "Section Break"
},
{
"default": "0",
"fieldname": "is_reply",
"fieldtype": "Check",
"label": "Is Reply"
},
{
"fieldname": "template_parameters",
"fieldtype": "Small Text",
"label": "Template Parameters",
"read_only": 1
},
{
"fieldname": "template_header_parameters",
"fieldtype": "Small Text",
"label": "Template Header Parameters",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
<<<<<<< Updated upstream
"modified": "2024-04-25 16:07:48.143626",
=======
"modified": "2024-04-30 18:00:06.805534",
>>>>>>> Stashed changes
"modified": "2024-05-03 13:22:45.081391",
"modified_by": "Administrator",
"module": "Frappe Whatsapp",
"name": "WhatsApp Message",
Expand Down
2 changes: 1 addition & 1 deletion frappe_whatsapp/utils/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def post():
"type": "Incoming",
"from": message['from'],
"message_id": message['id'],
"message": message[message_type].get("location"),
"message": message[message_type].get(message_type),
"content_type" : message_type
}).insert(ignore_permissions=True)

Expand Down

0 comments on commit 409e2fc

Please sign in to comment.