Browse Source

Fix special character encoding in Signal notifications

Fixes: #767
pull/770/head
Pēteris Caune 1 year ago
parent
commit
d19156801f
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
  1. 1
      CHANGELOG.md
  2. 4
      hc/api/tests/test_notify_signal.py
  3. 2
      templates/integrations/signal_message.html

1
CHANGELOG.md

@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
### Bug Fixes
- Fix the Signal integration to handle unexpected RPC messages better (#763)
- Fix special character encoding in Signal notifications (#767)
## v2.5 - 2022-12-14

4
hc/api/tests/test_notify_signal.py

@ -173,7 +173,7 @@ class NotifySignalTestCase(BaseTestCase):
socketobj = setup_mock(socket, {})
other = Check(project=self.project)
other.name = "Foobar"
other.name = "Foobar & Co"
other.status = "down"
other.last_ping = now() - td(minutes=61)
other.save()
@ -182,7 +182,7 @@ class NotifySignalTestCase(BaseTestCase):
message = socketobj.req["params"]["message"]
self.assertIn("The following checks are also down", message)
self.assertIn("Foobar", message)
self.assertIn("Foobar & Co", message)
@patch("hc.api.transports.socket.socket")
def test_it_does_not_show_more_than_10_other_checks(self, socket):

2
templates/integrations/signal_message.html

@ -13,7 +13,7 @@
{% else %}
{% line %}The following checks are {% if check.status == "down" %}also{% else %}still{% endif %} down:{% endline %}
{% for c in down_checks %}
{% line %}- “{{ c.name_then_code }}” (last ping: {{ c.last_ping|naturaltime }}){% endline %}
{% line %}- “{{ c.name_then_code|safe }}” (last ping: {{ c.last_ping|naturaltime }}){% endline %}
{% endfor %}
{% endif %}
{% else %}

Loading…
Cancel
Save