source: perl/lib/BarnOwl/Message/AIM.pm @ dca6255

Last change on this file since dca6255 was dca6255, checked in by Jason Gross <jgross@mit.edu>, 9 years ago
Moved log file name generation to perl I don't think that the class/personal distinction is the best for general protocols, but I don't know what should replace it. I've made class-logging default to only zephyr (a slight change from previous behavior, where jabber MUC's would be logged to $classlogpath, as well as all non-private non-login messages from other protocols), but made logging path generation overridable. TODO: Decide whether or not to filter out more 'bad' characters. Perhaps we should remove '!' because it indicates history in some shells and makes things obnoxious, or '~' becase it indicates homedirs in many shells. * '/' is for separating directories, and we don't want to accidentally make subdirectories We first NFKC for zephyrs, and then apply lc. The zephyr servers apply case-folded NFKC (so says http://zephyr.1ts.org/browser/zephyr/server/zstring.c). We should probably use Unicode::CaseFold instead of lc. I'm also not sure what the order case-adjustment and normalization should be. We first NFKC, then apply lc, to jabbers, as per http://xmpp.org/internet-drafts/attic/draft-ietf-xmpp-nodeprep-03.html (though I can't actually find anything that specifies the case-folding algorithm, nor the ordering). We now use lc instead of g_utf8_strdown to normalize AIM screennames.
  • Property mode set to 100644
File size: 683 bytes
Line 
1use strict;
2use warnings;
3
4package BarnOwl::Message::AIM;
5
6use base qw( BarnOwl::Message );
7
8# all non-loginout AIM messages are private for now...
9sub is_private {
10    return !(shift->is_loginout);
11}
12
13sub replycmd {
14    my $self = shift;
15    if ($self->is_incoming) {
16        return BarnOwl::quote('aimwrite', $self->sender);
17    } else {
18        return BarnOwl::quote('aimwrite', $self->recipient);
19    }
20}
21
22sub replysendercmd {
23    return shift->replycmd;
24}
25
26sub normalize_screenname {
27    my ($screenname) = @_;
28    $screenname =~ s/\s+//g;
29    return lc($screenname);
30}
31
32sub log_filenames {
33    return map { normalize_screenname($_) } BarnOwl::Message::log_filenames(@_);
34}
35
361;
Note: See TracBrowser for help on using the repository browser.