? my ($app, $msg) = @_;
<li class="event <?= $msg->{event} ?>" id="<?= $msg->{msgid} ?>">
    <div class="left"><span class="timestamp"><?= $msg->{timestamp} ?></span></div>
    <div class="msg">

? if ($msg->{event} eq "topic") {
    Topic changed to "<?= Text::MicroTemplate::encoded_string($msg->{body}) ?>"
?   if ($msg->{nick}) {
      by <a href="javascript:alice.connection.requestWindow('<?= $msg->{nick} ?>','<?= $msg->{window}->{id} ?>')" class="nick"><?= $msg->{nick} ?></a>
?   }

? } elsif ($msg->{event} eq "invite") {
    <?= $msg->{nick} ?> has invited you to join <?= $msg->{body} ?>

? } elsif ($msg->{event} eq "joined" or $msg->{event} eq "left") { 
    <a href="javascript:alice.connection.requestWindow('<?= $msg->{nick} ?>','<?= $msg->{window}->{id} ?>')" class="nick"><?= $msg->{nick} ?></a> <?= $msg->{event} ?> the chat room.
?   if ($msg->{body}) {
      (<?= $msg->{body} ?>)
?   }

? } elsif ($msg->{event} eq "nick") {
    <?= $msg->{nick} ?> is now known as <a href="javascript:alice.connection.requestWindow('<?= $msg->{body} ?>','<?= $msg->{window}->{id} ?>')" class="nick"><?= $msg->{body} ?></a>.

? } elsif ($msg->{event} eq "disconnect") {
      You have been disconnected from <?= $msg->{body} ?>

? } elsif ($msg->{event} eq "reconnect") {
      You have reconnected to <?= $msg->{body} ?>
? }

  </div>
</li>
