comparison skillbot.pl @ 60:69d7a89d3adc

Timezone is UTC by default if left out of friends
author Dominic Cleal <dominic@computerkb.co.uk>
date Mon, 29 Dec 2008 14:42:46 +0000
parents 74213ea642da
children 2328f73e25a8
comparison
equal deleted inserted replaced
59:74213ea642da 60:69d7a89d3adc
412 412
413 while (<FF>) { 413 while (<FF>) {
414 chomp; 414 chomp;
415 next if (/^#/); 415 next if (/^#/);
416 416
417 if (/^([0-9]+)\s+([a-z0-9]{64})\s+(\S+)\s+(\S+)(\s+(.+))?/i) { 417 if (/^([0-9]+)\s+([a-z0-9]{64})\s+(\S+)(\s+(\S+))?(\s+(.+))?/i) {
418 my $uid = $1; 418 my $uid = $1;
419 my $key = $2; 419 my $key = $2;
420 my $nick = $3; 420 my $nick = $3;
421 my $tz = $4; 421 my $tz = $5 || 'UTC';
422 my $c = $6; 422 my $c = $7;
423 423
424 if (! $frienduids{$uid}) { 424 if (! $frienduids{$uid}) {
425 unless (DateTime::TimeZone->is_valid_name($tz)) 425 unless (DateTime::TimeZone->is_valid_name($tz))
426 { 426 {
427 irc_debug("Invalid timezone (%s) supplied for friend %s". 427 irc_debug("Invalid timezone (%s) supplied for friend %s".
555 add_one_shot_timer($prefinish, sub { 555 add_one_shot_timer($prefinish, sub {
556 check_friend($self, $f); 556 check_friend($self, $f);
557 }); 557 });
558 } 558 }
559 559
560 $f->{timer} = add_one_shot_timer($skill->finish_time - time(), sub { 560 $f->{timer} = add_one_shot_timer($finish, sub {
561 $self->privmsg('#' . $config{channel}, sprintf( 561 $self->privmsg('#' . $config{channel}, sprintf(
562 "\002%s:\002 %s", $f->{nick}, 562 "\002%s:\002 %s", $f->{nick},
563 encode("utf8", $text))); 563 encode("utf8", $text)));
564 delete $f->{skill}; 564 delete $f->{skill};
565 delete $f->{skill_finish}; 565 delete $f->{skill_finish};