Changeset 2f25537 for perl/modules


Ignore:
Timestamp:
Jun 10, 2010, 2:47:11 PM (11 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
68e5464
Parents:
5d59c1e
git-author:
Anders Kaseorg <andersk@mit.edu> (06/10/10 02:03:20)
git-committer:
Anders Kaseorg <andersk@mit.edu> (06/10/10 14:47:11)
Message:
Jabber: Don’t break private replies in anonymous MUCs.

In commit 7c5d06020df6dac7defab775ce2d91bdb46805ee we changed the
Jabber message ‘from’ property to show less duplicate information as
the long_sender.  But in anonymous MUCs, we need the old ‘from’ for
private replies, so remove the duplicate information inside sub
long_sender instead in that case.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Nelson Elhage <nelhage@mit.edu>
Location:
perl/modules/Jabber/lib/BarnOwl
Files:
2 edited

Legend:

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

    r8278543 r2f25537  
    2020sub to { shift->{to} };
    2121sub room { shift->{room} };
     22sub nick { shift->{nick} };
    2223sub subject { shift->{subject} };
    2324sub status { shift->{status} }
     
    4142sub long_sender {
    4243    my $self = shift;
     44    if ($self->jtype eq 'groupchat' && $self->nick) {
     45        my $from_jid = Net::Jabber::JID->new($self->from);
     46        if ($from_jid->GetJID('base') eq $self->room &&
     47            $from_jid->GetResource() eq $self->nick) {
     48            return $self->nick;
     49        }
     50    }
    4351    return $self->from;
    4452}
  • perl/modules/Jabber/lib/BarnOwl/Module/Jabber.pm

    raa0a0b5 r2f25537  
    12411241            $muc = $connection->FindMUC(jid => $to);
    12421242        }
    1243         $props{from} = $muc->GetFullJID($from) || $nick || $room;
     1243        $props{from} = $muc->GetFullJID($from) || $props{from};
    12441244        $props{sender} = $nick || $room;
    12451245        $props{recipient} = $room;
Note: See TracChangeset for help on using the changeset viewer.