Changeset 101aedb


Ignore:
Timestamp:
Jan 7, 2014, 6:02:23 PM (8 years ago)
Author:
Jason Gross <jgross@mit.edu>
Children:
50a3240
Parents:
c0d31b3
git-author:
Jason Gross <jgross@mit.edu> (02/16/13 23:30:26)
git-committer:
Jason Gross <jgross@mit.edu> (01/07/14 18:02:23)
Message:
Add IRC logging filename generation

Based on asedeno's comment
"For IRC I'd probably want a combination of network and (channel or
nick)."
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/IRC/lib/BarnOwl/Message/IRC.pm

    r60b49a7 r101aedb  
    9292}
    9393
     94# logging
     95sub log_filenames {
     96    my ($m) = @_;
     97    die "IRC should not be handling non-IRC messages" if lc($m->type) ne "irc";
     98    BarnOwl::error("IRC message without a network") if !defined($m->network) || $m->network eq '';
     99    my $filename = lc($m->type) . ":" . lc($m->network);
     100    if ($m->is_personal) {
     101        if ($m->is_incoming) {
     102            $filename .= ":" . $m->sender;
     103        } elsif ($m->is_outgoing) {
     104            $filename .= ":" . $m->recipient;
     105        }
     106    } else {
     107        $filename .= ":" . $m->channel;
     108    }
     109    return ($filename);
     110}
     111
    941121;
Note: See TracChangeset for help on using the changeset viewer.