Ignore:
Timestamp:
Jun 10, 2010, 2:47:11 PM (14 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, 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>
File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.