nucleus-ffm / foss_warn

An unofficial open source application to get emergency alerts from https://warnung.bund.de/meldungen.
GNU General Public License v3.0
98 stars 6 forks source link

Fix missing link #121

Closed nucleus-ffm closed 2 months ago

nucleus-ffm commented 3 months ago

fix #119 and fix #120

MatsG23 commented 3 months ago

I used the chance to change the return value for an invalid phone number and email address to null. I think this should be a cleaner approach. Additionally, the extractPhoneNumber has split the contact text but if I understood it correctly we always returned the first element anyways. I adjusted it to match the logic in extractWebAddress more closely

MatsG23 commented 3 months ago

Two further questions:

nucleus-ffm commented 3 months ago

Additionally, the extractPhoneNumber has split the contact text but if I understood it correctly we always returned the first element anyways. I adjusted it to match the logic in extractWebAddress more closely

We can not do this that way. A common case is e.g. "Bürgertelefon 1234 5678" so we have to filter the "Bürgertelefon in the front to get the telephone number. I had to change that back.

In general, the contact field is in the CAP docu defined as "The text describing the contact for follow-up and confirmation of the alert message (OPTIONAL)". So, there can be anything inside that field. I also saw an alert containing a URL inside the contact field.