From f64eb142d08a83d33071a97f9b8cb252c617fe94 Mon Sep 17 00:00:00 2001
From: Alexandre Morignot <erdnaxeli@cervoi.se>
Date: Thu, 5 Feb 2015 12:36:44 +0100
Subject: [PATCH] we put all in msg

---
 tools/readjson.pl | 2 +-
 tools/readmail.pl | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/readjson.pl b/tools/readjson.pl
index 3ea35ea..a0f0831 100755
--- a/tools/readjson.pl
+++ b/tools/readjson.pl
@@ -37,6 +37,6 @@ sub on_start {
     print "$json\n";
 
     # TODO: handle $content->{'msg'}
-    $kernel->post('IKC', 'post', 'poe://PlayBot/fbrecv/fbmsg', [ $content->{'author'}, $content->{'link'} ]);
+    $kernel->post('IKC', 'post', 'poe://PlayBot/fbrecv/fbmsg', [ $content->{'author'}, $content->{'msg'} ]);
     $kernel->post('IKC', 'shutdown');
 }
diff --git a/tools/readmail.pl b/tools/readmail.pl
index 8273cb1..88a87cf 100755
--- a/tools/readmail.pl
+++ b/tools/readmail.pl
@@ -31,16 +31,15 @@ sub get_content {
     open (my $fh, "<", $file);
 
     $content{'msg'} = '';
-    $content{'link'} = '';
 
     while (<$fh>) {
         if (/^(.*) posted in NightIIEs/) {
             $content{'author'} = $1;
         } elsif (/^https:\/\/l.facebook.com\/l\/.*\/(.*)/) {
-            $content{'link'} .= ' '.$uri->decode($1);
+            $content{'msg'} .= ' '.$uri->decode($1);
         } elsif (/#/) {
             chomp;
-            $content{'msg'} .= $_;
+            $content{'msg'} .= ' '.$_;
         }
     }
 
-- 
GitLab