Fixes a bug in Android SMS parsing #526 (#530)

Co-authored-by: Donncha Ó Cearbhaill <donncha.ocearbhaill@amnesty.org>
This commit is contained in:
Tek
2024-10-16 16:56:06 +02:00
committed by GitHub
parent 052c4e207b
commit aced1aa74d
2 changed files with 7 additions and 3 deletions

View File

@@ -114,8 +114,10 @@ class SMS(AndroidExtraction):
message["isodate"] = convert_unix_to_iso(message["timestamp"])
# Extract links in the message body
links = check_for_links(message["body"])
message["links"] = links
body = message.get("body", None)
if body:
links = check_for_links(message["body"])
message["links"] = links
self.results.append(message)

View File

@@ -230,7 +230,9 @@ def parse_sms_file(data):
entry["body"] = entry["mms_body"]
entry.pop("mms_body")
message_links = check_for_links(entry["body"])
body = entry.get("body", None)
if body:
message_links = check_for_links(entry["body"])
entry["isodate"] = convert_unix_to_iso(int(entry["date"]) / 1000)
entry["direction"] = "sent" if int(entry["date_sent"]) else "received"