--- logger.orig	2008-08-15 03:11:02.000000000 +0100
+++ logger	2009-03-06 11:36:17.000000000 +0000
@@ -8,6 +8,9 @@
 # with modifications from Ralph Swick
 # http://www.w3.org/People/all#swick
 #
+# and more by Toby Inkster
+# http://tobyinkster.co.uk/
+#
 #   This program is free software; you can redistribute it and/or
 #   modify it under the terms of the GNU General Public License
 #   as published by the Free Software Foundation; either version 2
@@ -65,10 +68,10 @@
 # MSWin does not permit ":" in file path components
 $::PortSep = $^O eq "MSWin32" ? "/" : ":";
 
-$::html_suffix="</dl>\n</body>\n</html>\n";
+$::html_suffix="</table>\n</body>\n</html>\n";
 $::html_suffix_length=undef;	# account for \n to \r\n expansion in stdio
 
-$::rdf_suffix="    </rdf:Seq>\n  </foaf:chatEventList>\n</foaf:ChatChannel>\n</rdf:RDF>\n";
+$::rdf_suffix="</st:ChatChannel>\n</rdf:RDF>\n";
 $::rdf_suffix_length=undef;	# account for \n to \r\n expansion in stdio
 
 #URIschemes and URIpatterns must match in order.  The order is not signficant.
@@ -478,28 +481,31 @@
       }
 
       my $escaped_chan = xml_escape($channel_name);
+      my $escaped_chan_uri = xml_escape($self->{URI});
+      
       print $html_log_fh <<"EOT";
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>IRC log of $escaped_chan on $date</title>
-EOT
-      my $progID = '$Id$';
-      $progID =~ s/\$/\&#36;/g;	# Hide the CVS tag from CVS in the output
-      print $html_log_fh '<meta name="generator" content="'.$progID.'" />';
-      print $html_log_fh <<"EOT";
-
- <style type="text/css">
-  .IRC { font-family: sans-serif }
- </style>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
+    "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:dc="http://purl.org/dc/terms/"
+      xmlns:s="http://rdfs.org/sioc/ns#"
+      xmlns:st="http://rdfs.org/sioc/types#"
+      xmlns:f="http://xmlns.com/foaf/0.1/"
+      xmlns:h5="http://buzzword.org.uk/rdf/h5#"
+      xmlns:x="http://www.w3.org/2001/XMLSchema#">
+<head profile="http://www.w3.org/1999/xhtml/vocab">
+ <title property="dc:title">IRC log of $escaped_chan on $date</title>
+ <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
+ <meta property="h5:generator" name="generator" content="logger-tai/20090306" />
+ <link rel="stylesheet" type="text/css" media="screen,projection" href="chatlog.css" />
+ <link rel="alternate" type="text/plain" href="${date}.txt" />
+ <link rel="alternate" type="application/rdf+xml" href="${date}.rdf" />
 </head>
-<body>
-<h1>IRC log of $escaped_chan on $date</h1>
+<body about="$escaped_chan_uri" typeof="st:ChatChannel">
+<h1>IRC log of <span property="dc:title">$escaped_chan</span> on $date</h1>
 <p><em>Timestamps are in UTC.</em></p>
-<dl class="IRC">
+<table class="IRC" rel="s:container_of" rev="s:has_container">
 EOT
       print $html_log_fh $::html_suffix;
     } else {
@@ -537,15 +543,17 @@
     }
 
     my $escaped_chan_uri = xml_escape($self->{URI});
+    my $escaped_chan = xml_escape($channel_name);
+
     print $rdf_log_fh <<"EOT";
 <?xml version="1.0" encoding="UTF-8"?>
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns:dc="http://purl.org/dc/elements/1.1/"
-         xmlns:wn="http://xmlns.com/wordnet/1.6/"
-         xmlns:foaf="http://xmlns.com/foaf/0.1/">
-<foaf:ChatChannel rdf:about="$escaped_chan_uri">
-  <foaf:chatEventList>
-    <rdf:Seq>
+         xmlns:dc="http://purl.org/dc/terms/"
+         xmlns:s="http://rdfs.org/sioc/ns#"
+         xmlns:st="http://rdfs.org/sioc/types#"
+         xmlns:f="http://xmlns.com/foaf/0.1/">
+<st:ChatChannel rdf:about="$escaped_chan_uri">
+  <dc:title>$escaped_chan</dc:title>
 EOT
     print $rdf_log_fh $::rdf_suffix;
   } else {
@@ -595,6 +603,7 @@
   my $date = sprintf("%04d-%02d-%02d", $tm[5], $tm[4], $tm[3]);
   my $time = sprintf("%02d:%02d:%02d", $tm[2], $tm[1], $tm[0]);
   my $date_time="$date $time";
+  my $datetime=$date.'T'.$time.'Z';
 
   my $hour=$tm[2];
   # if we're using dated logs and we passed midnight, start new logs
@@ -649,7 +658,7 @@
 	$escapedMsg = URI2link($escapedMsg, @uris);
     }
 
-    print $html_log_fh qq{<dt id="$ID">$time [$nick]</dt><dd>}.$escapedMsg.qq{</dd>\n};
+    print $html_log_fh qq{<tr id="$ID" about="#TalkAt$ID" typeof="st:InstantMessage"><th><a property="dc:issued" content="$datetime" datatype="x:dateTime" rel="s:link" href="#$ID">$time</a> <b rel="s:has_creator" rev="s:creator_of">[<span typeof="s:User" property="f:accountName">$nick</span>]</b></th><td property="s:content" datatype="">$escapedMsg</td></tr>\n};
     print $html_log_fh $::html_suffix;
   }
 
@@ -661,18 +670,19 @@
   seek($rdf_log_fh, -$::rdf_suffix_length, 2); # 2= SEEK_END
 
   print $rdf_log_fh <<"EOT";
-      <rdf:li>
-       <foaf:chatEvent rdf:ID="$ID">
-        <dc:date>${date}T${time}Z</dc:date>
+  <s:container_of>
+    <st:InstantMessage rdf:about="#TalkAt$ID">
+      <s:link rdf:resource="${date}.html#${ID}" />
+      <dc:issued>$datetime</dc:issued>
 EOT
-  print $rdf_log_fh qq{        <dc:description>}.cvs_escape($msg).qq{</dc:description>\n};
-  print $rdf_log_fh qq{        <dc:creator><wn:Person foaf:nick="$nick"/></dc:creator>\n} if $nick;
+  print $rdf_log_fh qq{      <s:content>}.cvs_escape($msg).qq{</s:content>\n};
+  print $rdf_log_fh qq{      <s:has_creator><s:User f:accountName="$nick" /></s:has_creator>\n} if $nick;
   foreach my $uri (@uris) {
     $uri = xml_escape($uri);
-    print $rdf_log_fh qq{        <dc:relation rdf:resource="$uri"/>\n};
+    print $rdf_log_fh qq{      <s:links_to rdf:resource="$uri"/>\n};
   }
-  print $rdf_log_fh qq{       </foaf:chatEvent>\n};
-  print $rdf_log_fh qq{      </rdf:li>\n};
+  print $rdf_log_fh qq{    </st:InstantMessage>\n};
+  print $rdf_log_fh qq{  </s:container_of>\n};
   print $rdf_log_fh $::rdf_suffix;
 }
 
@@ -1019,7 +1029,7 @@
   }
 
   if($command=~ /^(?:pointer|bookmark|here|where am i\?)/i) {
-    my($log_uri)=$channel->{LogURIPrefix};
+    my($log_uri)=$channel->{LogURIPrefix} . '.html';
 
     my $output;
     if($log_uri) {
@@ -1033,6 +1043,19 @@
     return;
   }
 
+  if($command=~ /^(?:tell|alert|show|remind)\s+(\S*)$/i) {
+    my($log_uri)=$channel->{LogURIPrefix};
+    my $nick = $1;
+    my $output;
+    if($log_uri) {
+      $log_uri.="#".$channel->{Last_ID} if $channel->{Last_ID};
+      my $output ="phenny, tell $nick that $from_nick says see $log_uri";
+      $self->privmsg($dest_nick, $output);
+      log_event($self, $event, time, "pfennig, $output") unless $is_private;
+    } 
+    return;
+  }
+
   if($command=~ /^chump\s*(.+)$/i) {
     my $item=$1;
     my($log_uri)=$channel->{LogURIPrefix};
@@ -1074,7 +1097,8 @@
       " silence      - Stop logging (also: stop, off, ...)",
       " listen       - Start logging (also: start, on, ...)",
       " bookmark     - Give the URI of the current log",
-      " chump LETTER - Record the URI of the current log under chump LETTER",
+      " tell XX      - Give the URI of the current log to nick XX",
+       " chump LETTER - Record the URI of the current log under chump LETTER",
       "I respond to '$::Nick, command' in public and '/msg $::Nick command' in private",
       "Logging Policy: All public output is logged if I am listening except for"
     );
@@ -1119,7 +1143,12 @@
 
   if ($command =~ /^(?:grep|search for|find)\s+(.+)$/) {
     $output.=qq{Sorry, searching removed.};
-  } else {
+  } 
+  
+  if ($from_nick eq 'phenny') {
+	  return;
+  }
+  else {
     $output.="I don't understand '$command', $from_nick.  Try /msg $::Nick help";
   }
 
@@ -1227,7 +1256,7 @@
 
     foreach my $u (@uri) {
 	my $p = quotemeta $u;
-	$l =~ s/($p)/<a href="$1">$1<\/a>/;
+	$l =~ s/($p)/<a rel="s:links_to" href="$1">$1<\/a>/;
     }
 
     return $l;
