Makefile.PL方式に移行、test suiteを同梱しました<br>
iPhone/iPod touch用にログアウト機能(セッション廃棄)を追加しました<br>
アクセススキーマをhttp, httpsから選べるようになりました<br>
+ 日が変わるタイミングでメッセージ表示に日付を挿入するようにしました<br>
</dd>
<dt>1.33</dt>
# -*- mode: perl; coding: utf-8 -*-
# Keitairc::IrcBuffer
-# $Id: IrcBuffer.pm,v 1.21 2008-12-20 11:59:55 morimoto Exp $
+# $Id: IrcBuffer.pm,v 1.22 2009-01-03 00:32:03 morimoto Exp $
# $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/Keitairc/IrcBuffer.pm,v $
#
# Copyright (c) 2008 Jun Morimoto <morimoto@mrmt.net>
}
################################################################
-sub now{
- my ($sec, $min, $hour) = localtime(time);
+sub format_time{
+ my ($me, $t) = @_;
+ my ($sec, $min, $hour) = localtime($t);
sprintf('%02d:%02d', $hour, $min);
}
################################################################
+sub format_date{
+ my ($me, $t) = @_;
+ my ($sec, $min, $hour, $day, $month, $year) = localtime($t);
+ sprintf('%04d/%02d/%02d', $year+1900, $month+1, $day);
+}
+
+################################################################
# 引数の $name (チャネル名) は、生の iso-2022-jp のまま、ないしは irc
# チャネルで扱われている charset のまま扱うこと。こういう慣習なので
# しょうがない。
$me->{rbuffer}->{$cid} = [];
}
- push @{$me->{tbuffer}->{$cid}}, now();
+ push @{$me->{tbuffer}->{$cid}}, time;
push @{$me->{nbuffer}->{$cid}}, $who;
push @{$me->{mbuffer}->{$cid}}, $message;
push @{$me->{rbuffer}->{$cid}}, 0;
# -*- mode: perl; coding: utf-8 -*-
# keitairc/lib/plugins/00all
# チャネルの全メッセージ閲覧
-# $Id: 00all,v 1.14 2008-12-31 13:59:52 morimoto Exp $
+# $Id: 00all,v 1.15 2009-01-03 00:32:03 morimoto Exp $
# $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00all,v $
# The line number (1 incremented) and filename below must be
my ($tp, $np, $mp, $rp) = $::ib->buffer_ptr($cid);
if(defined $tp){
my @range = (0 .. @{$tp}-1);
- @range = reverse @range if $::cf->reverse_message();
+ @range = reverse @range if $::cf->reverse_unread();
+ my ($last_date, $current_date) = ('', undef);
for my $lp (@range){
my $p = {};
- $p->{time} = @{$tp}[$lp];
+ $current_date = $::ib->format_date(@{$tp}[$lp]);
+ unless($last_date eq $current_date){
+ $last_date = $current_date;
+ my $pp = {};
+ $pp->{date} = $current_date;
+ push @loop, $pp;
+ }
+
+ $p->{time} = $::ib->format_time(@{$tp}[$lp]);
$p->{nick} = $::ib->simple_escape(@{$np}[$lp]);
my $message = $::ib->colorize($::ib->simple_escape(@{$mp}[$lp])) || '';
for my $name ($::pl->list_replace_plugins()){
# -*- mode: perl; coding: utf-8 -*-
# keitairc/lib/plugins/00recent
# 未読発言一覧
-# $Id: 00recent,v 1.11 2008-12-31 13:59:52 morimoto Exp $
+# $Id: 00recent,v 1.12 2009-01-03 00:32:03 morimoto Exp $
# $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00recent,v $
# The line number (1 incremented) and filename below must be
my @looop;
if(defined $tp){
my @range = (0 .. @{$tp}-1);
- @range = reverse @range if $::cf->reverse_recent();
+ @range = reverse @range if $::cf->reverse_unread();
+ my ($last_date, $current_date) = ('', undef);
for my $lp (@range){
next if @{$rp}[$lp];
my $pp = {};
- $pp->{time} = @{$tp}[$lp];
+ $current_date = $::ib->format_date(@{$tp}[$lp]);
+ unless($last_date eq $current_date){
+ $last_date = $current_date;
+ my $ppp = {};
+ $ppp->{date} = $current_date;
+ push @looop, $ppp;
+ }
+ $pp->{time} = $::ib->format_time(@{$tp}[$lp]);
$pp->{nick} = $::ib->simple_escape(@{$np}[$lp]);
my $message = $::ib->colorize($::ib->simple_escape(@{$mp}[$lp])) || '';
for my $name ($::pl->list_replace_plugins()){
# -*- mode: perl; coding: utf-8 -*-
# keitairc/lib/plugins/00unread
# チャネルの未読メッセージ閲覧
-# $Id: 00unread,v 1.13 2008-12-31 13:59:52 morimoto Exp $
+# $Id: 00unread,v 1.14 2009-01-03 00:32:03 morimoto Exp $
# $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/plugins/00unread,v $
# The line number (1 incremented) and filename below must be
if(defined $tp){
my @range = (0 .. @{$tp}-1);
@range = reverse @range if $::cf->reverse_unread();
+ my ($last_date, $current_date) = ('', undef);
for my $lp (@range){
next if @{$rp}[$lp];
my $p = {};
- $p->{time} = @{$tp}[$lp];
+ $current_date = $::ib->format_date(@{$tp}[$lp]);
+ unless($last_date eq $current_date){
+ $last_date = $current_date;
+ my $pp = {};
+ $pp->{date} = $current_date;
+ push @loop, $pp;
+ }
+
+ $p->{time} = $::ib->format_time(@{$tp}[$lp]);
$p->{nick} = $::ib->simple_escape(@{$np}[$lp]);
my $message = $::ib->colorize($::ib->simple_escape(@{$mp}[$lp])) || '';
for my $name ($::pl->list_replace_plugins()){
/*
- * $Id: iui-keitairc.css,v 1.3 2008-12-31 13:59:52 morimoto Exp $
+ * $Id: iui-keitairc.css,v 1.4 2009-01-03 00:32:03 morimoto Exp $
* $Source: /home/ishikawa/work/keitairc/tmp/keitairc/lib/public/iui-keitairc.css,v $
*/
background: #7b9ba5;
}
+body > ul > li.date {
+ background: #fff;
+ color: #7b9ba5;
+ font-size: 14px;
+ font-weight: normal;
+ padding: 1px 10px;
+ top: 2px;
+ margin-bottom: 2px;
+}
+
body > ul > li.note {
position: relative;
top: 2px;
<tmpl_loop name="loop">
- <tmpl_if nick>
- <tmpl_if read>
- <!-- tmpl_var time -->
+ <tmpl_if date>
+ <font color="#6666ff" size="-1"><!-- tmpl_var date --></font>
+ <tmpl_else>
+ <tmpl_if nick>
+ <tmpl_if read>
+ <!-- tmpl_var time -->
+ <tmpl_else>
+ <font color="#6666ff"><!-- tmpl_var time --></font>
+ </tmpl_if>
+ <!-- tmpl_var nick -->>
+ <!-- tmpl_var message -->
<tmpl_else>
- <font color="#6666ff"><!-- tmpl_var time --></font>
- </tmpl_if>
- <!-- tmpl_var nick -->>
- <!-- tmpl_var message -->
- <tmpl_else>
- <tmpl_if read>
- <!-- tmpl_var time -->
- <tmpl_else>
- <font color="#6666ff"><!-- tmpl_var time --></font>
- </tmpl_if>
- <font color="#c6d1ff"><!-- tmpl_var message --></font>
+ <tmpl_if read>
+ <!-- tmpl_var time -->
+ <tmpl_else>
+ <font color="#6666ff"><!-- tmpl_var time --></font>
+ </tmpl_if>
+ <font color="#c6d1ff"><!-- tmpl_var message --></font>
+ </tmpl_if>
</tmpl_if>
<br />
</tmpl_loop>
<tmpl_loop name="loop">
<a href="all/<!-- tmpl_var cid -->"><!-- tmpl_var cname --></a><br />
<tmpl_loop name="looop">
- <font color="#0000ff"><!-- tmpl_var time --></font>
- <!-- tmpl_var nick -->>
- <!-- tmpl_var message --><br />
+ <tmpl_if date>
+ <font color="#6666ff" size="-1"><!-- tmpl_var date --></font>
+ <tmpl_else>
+ <font color="#0000ff"><!-- tmpl_var time --></font>
+ <!-- tmpl_var nick -->>
+ <!-- tmpl_var message --><br />
+ </tmpl_if>
</tmpl_loop>
</tmpl_loop>
</form>
<tmpl_loop name="loop">
- <tmpl_if nick>
- <font color="#6666ff"><!-- tmpl_var time --></font>
- <!-- tmpl_var nick -->>
- <!-- tmpl_var message -->
+ <tmpl_if date>
+ <font color="#6666ff" size="-1"><!-- tmpl_var date --></font>
<tmpl_else>
- <font color="#6666ff"><!-- tmpl_var time --></font>
- <font color="#c6d1ff"><!-- tmpl_var message --></font>
+ <tmpl_if nick>
+ <font color="#6666ff"><!-- tmpl_var time --></font>
+ <!-- tmpl_var nick -->>
+ <!-- tmpl_var message -->
+ <tmpl_else>
+ <font color="#6666ff"><!-- tmpl_var time --></font>
+ <font color="#c6d1ff"><!-- tmpl_var message --></font>
+ </tmpl_if>
</tmpl_if>
<br />
</tmpl_loop>
<ul id="home" title="<!-- tmpl_var channel_compact -->" selected="true">
<tmpl_loop name="loop">
- <tmpl_if read>
- <li class="message">
+ <tmpl_if date>
+ <li class="date">
+ <!-- tmpl_var date -->
+ </li>
<tmpl_else>
- <li class="messagenew">
+ <tmpl_if read>
+ <li class="message">
+ <tmpl_else>
+ <li class="messagenew">
+ </tmpl_if>
+ <span class="nick">
+ <!-- tmpl_var time --> <!-- tmpl_var nick -->
+ </span>
+ <!-- tmpl_var message -->
+ </li>
</tmpl_if>
- <span class="nick">
- <!-- tmpl_var time --> <!-- tmpl_var nick -->
- </span>
- <!-- tmpl_var message -->
- </li>
</tmpl_loop>
<tmpl_unless loop>
- <li class="message">(\82Ü\82¾\94\8c¾\82ª\82 \82è\82Ü\82¹\82ñ)</li>
+ <li class="message">\82Ü\82¾\94\8c¾\82ª\82 \82è\82Ü\82¹\82ñ</li>
</tmpl_unless>
<tmpl_if follow_nick>
<a target="_self" href="all/<!-- tmpl_var cid -->"><!-- tmpl_var cname --></a>
</li>
<tmpl_loop name="looop">
- <li class="messagenew">
- <span class="nick">
- <!-- tmpl_var time --> <!-- tmpl_var nick -->
- </span>
- <!-- tmpl_var message -->
- </li>
+ <tmpl_if date>
+ <li class="date">
+ <!-- tmpl_var date -->
+ </li>
+ <tmpl_else>
+ <li class="messagenew">
+ <span class="nick">
+ <!-- tmpl_var time --> <!-- tmpl_var nick -->
+ </span>
+ <!-- tmpl_var message -->
+ </li>
+ </tmpl_if>
</tmpl_loop>
</tmpl_loop>
<tmpl_unless loop>
- <li class="message">(\96¢\93Ç\94\8c¾\82Í\82 \82è\82Ü\82¹\82ñ)</li>
+ <li class="message">\96¢\93Ç\94\8c¾\82Í\82 \82è\82Ü\82¹\82ñ</li>
</tmpl_unless>
<li><a target="_self" href="recent">\8dX\90V</a></li>