Changeset 25729b2 for perl/modules
- Timestamp:
- Jan 8, 2007, 4:17:55 PM (18 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 723f464
- Parents:
- 6beac73
- git-author:
- Nelson Elhage <nelhage@mit.edu> (01/08/07 15:55:09)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (01/08/07 16:17:55)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/modules/jabber.pl
r9667006 r25729b2 1156 1156 } 1157 1157 1158 ##################################################################### 1159 ##################################################################### 1160 1161 package owl::Message::Jabber; 1162 1163 our @ISA = qw( owl::Message ); 1164 1165 sub jtype { shift->{jtype} }; 1166 sub from { shift->{from} }; 1167 sub to { shift->{to} }; 1168 1169 sub smartfilter { 1170 my $self = shift; 1171 my $inst = shift; 1172 1173 if($self->jtype eq 'chat') { 1174 my ($user, $filter, $ftext); 1175 if($self->direction eq 'in') { 1176 $user = $self->from; 1177 } else { 1178 $user = $self->to; 1179 } 1180 $user = Net::Jabber::JID->new($user)->GetJID($inst ? 'full' : 'base'); 1181 $filter = "jabber-user-$user"; 1182 $ftext = qq{type ^jabber\$ and ( ( direction ^in\$ and from ^$user ) } . 1183 qq{or ( direction ^out\$ and to ^$user ) ) }; 1184 owl::filter("$filter $ftext"); 1185 return $filter; 1186 } 1187 } 1188 1158 1189 1;
Note: See TracChangeset
for help on using the changeset viewer.