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

? if ($msg->{event} eq "topic") {
    Topic changed to "<?= $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
      <?if ($msg->{body}) { ?>
        (<?= $msg->{body} ?>)
      <? } ?>
? }

  </div>
</li>
