Changeset 0da506ce9d98b7097cea151432f3eb19eab40e6d
- Timestamp:
- 01/26/07 16:52:37 (2 years ago)
- Author:
- Nelson Elhage <nelhage@…>
- git-author:
- Nelson Elhage <nelhage@mit.edu> / 2007-01-26T16:41:33Z-0500
- Parents:
- c25a20fcbef752a45d4e0f8a19d35b2fda93190f
- Children:
- ac1bbe23d335d92de71ead394cb3042676203969
- git-committer:
- Nelson Elhage <nelhage@mit.edu> / 2007-01-26T21:52:37Z+0000
- Message:
-
Add smartnarrow on login/out messages.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
rc25a20f
|
r0da506c
|
|
| 1414 | 1414 | die("Unable to resolve account $from") unless $from_jid; |
| 1415 | 1415 | $to_jid = resolveDestJID($to, $from_jid); |
| 1416 | | push @matches, [$from_jid, $to_jid]; |
| | 1416 | push @matches, [$from_jid, $to_jid] if $to_jid; |
| 1417 | 1417 | } else { |
| 1418 | 1418 | for my $f ($conn->getJIDs) { |
| … |
… |
|
| 1461 | 1461 | $user = $self->to; |
| 1462 | 1462 | } |
| 1463 | | $user = Net::Jabber::JID->new($user)->GetJID($inst ? 'full' : 'base'); |
| 1464 | | $filter = "jabber-user-$user"; |
| 1465 | | $ftext = qq{type ^jabber\$ and ( ( direction ^in\$ and from ^$user ) } . |
| 1466 | | qq{or ( direction ^out\$ and to ^$user ) ) }; |
| 1467 | | BarnOwl::filter("$filter $ftext"); |
| 1468 | | return $filter; |
| | 1463 | return smartfilter_user($user, $inst); |
| 1469 | 1464 | } elsif ($self->jtype eq 'groupchat') { |
| 1470 | 1465 | my $room = $self->room; |
| … |
… |
|
| 1473 | 1468 | BarnOwl::filter("$filter $ftext"); |
| 1474 | 1469 | return $filter; |
| 1475 | | } |
| 1476 | | } |
| | 1470 | } elsif ($self->login ne 'none') { |
| | 1471 | return smartfilter_user($self->from, $inst); |
| | 1472 | } |
| | 1473 | } |
| | 1474 | |
| | 1475 | sub smartfilter_user { |
| | 1476 | my $user = shift; |
| | 1477 | my $inst = shift; |
| | 1478 | |
| | 1479 | $user = Net::Jabber::JID->new($user)->GetJID( $inst ? 'full' : 'base' ); |
| | 1480 | my $filter = "jabber-user-$user"; |
| | 1481 | my $ftext = |
| | 1482 | qq{type ^jabber\$ and ( ( direction ^in\$ and from ^$user ) } |
| | 1483 | . qq{or ( direction ^out\$ and to ^$user ) ) }; |
| | 1484 | BarnOwl::filter("$filter $ftext"); |
| | 1485 | return $filter; |
| | 1486 | |
| | 1487 | } |
| | 1488 | |
| 1477 | 1489 | |
| 1478 | 1490 | 1; |