Skip to content

Commit

Permalink
Fixed timestamp processing on newer macOS/iOS releases.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 20, 2019
1 parent 1eb529b commit e27e43f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions archive_imessage.pl
Expand Up @@ -934,6 +934,12 @@ sub talk_gap {
my ($idname, $msgid, $text, $service, $account, $handle_id, $subject, $date, $is_emote, $is_from_me, $was_downgraded, $is_audio_message, $cache_has_attachments) = @row;
next if not defined $text;

# This is probably from after Apple moved from seconds to nanoseconds
# (High Sierra and equivalent iOS releases).
if ($date > 99999999999) {
$date /= 1000000000;
}

# Convert from Cocoa epoch to Unix epoch (2001 -> 1970).
$date += 978307200;

Expand Down

0 comments on commit e27e43f

Please sign in to comment.