Last change
on this file since dce72c1 was
eea7bed4,
checked in by Jason Gross <jasongross9@gmail.com>, 7 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 | |
---|
1 | use strict; |
---|
2 | use warnings; |
---|
3 | |
---|
4 | package BarnOwl::Message::AIM; |
---|
5 | |
---|
6 | use base qw( BarnOwl::Message ); |
---|
7 | |
---|
8 | # all non-loginout AIM messages are private for now... |
---|
9 | sub is_private { |
---|
10 | return !(shift->is_loginout); |
---|
11 | } |
---|
12 | |
---|
13 | sub 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 | |
---|
22 | sub replysendercmd { |
---|
23 | return shift->replycmd; |
---|
24 | } |
---|
25 | |
---|
26 | sub normalize_screenname { |
---|
27 | my ($screenname) = @_; |
---|
28 | $screenname =~ s/\s+//g; |
---|
29 | return lc($screenname); |
---|
30 | } |
---|
31 | |
---|
32 | sub log_filenames { |
---|
33 | return map { normalize_screenname($_) } BarnOwl::Message::log_filenames(@_); |
---|
34 | } |
---|
35 | |
---|
36 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.