Skip to content

Commit

Permalink
Do something with subject data.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jun 20, 2016
1 parent f9e4a22 commit 2c59b31
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions archive_imessage.pl
Expand Up @@ -689,9 +689,6 @@ sub talk_gap {
# Convert from Cocoa epoch to Unix epoch (2001 -> 1970).
$date += 978307200;

# !!! FIXME: do something if defined $subject
# !!! FIXME: do something with $service

$startmsgid = $msgid if (not defined $startmsgid);

if (not defined $startids{$handle_id}) {
Expand Down Expand Up @@ -761,6 +758,20 @@ sub talk_gap {
$output_text = '';
$output_html = '';
@output_attachments = ();

if (defined $subject) {
chomp($subject);
$subject =~ s/\A\s+//;
$subject =~ s/\s+\Z//;
if (($subject eq '') || ($subject eq 'Re:')) {
$subject = undef;
}
}

if (defined $subject) {
$output_text = "iMessage subject: $subject\n\n";
$output_html = "<p><i>$subject</i></p>\n\n";
}
}

# UTF-8 for non-breaking space (&nbsp;). Dump it at end of line; iMessage seems to add it occasionally (maybe double-space to add a period then hit Send?).
Expand Down

0 comments on commit 2c59b31

Please sign in to comment.