~ubuntu-branches/debian/experimental/kopete/experimental

« back to all changes in this revision

Viewing changes to libkopete/kopetechatsession.cpp

  • Committer: Package Import Robot
  • Author(s): Maximiliano Curia
  • Date: 2015-02-24 11:32:57 UTC
  • mfrom: (1.1.41 vivid)
  • Revision ID: package-import@ubuntu.com-20150224113257-gnupg4v7lzz18ij0
Tags: 4:14.12.2-1
* New upstream release (14.12.2).
* Bump Standards-Version to 3.9.6, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
                        d->displayName.append( c->metaContact()->displayName() );
195
195
                else
196
196
                {
197
 
                        d->displayName.append( c->nickName() );
 
197
                        d->displayName.append( c->displayName() );
198
198
                }
199
199
        }
200
200
 
313
313
 
314
314
        if ( msg.direction() == Kopete::Message::Inbound )
315
315
        {
316
 
                const QString nick = myself()->nickName();
 
316
                const QString nick = myself()->displayName();
317
317
                if ( Kopete::BehaviorSettings::self()->highlightEnabled() && !nick.isEmpty() )
318
318
                {
319
319
                        const QString nickNameRegExp = QString::fromLatin1( "(^|[\\W])(%1)([\\W]|$)" ).arg( QRegExp::escape( nick ) );
465
465
                                disconnect( old->metaContact(), SIGNAL(photoChanged()), this, SIGNAL(photoChanged()) );
466
466
                        }
467
467
                        else
468
 
                                disconnect( old, SIGNAL(propertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)), this, SLOT(slotUpdateDisplayName()) );
 
468
                                disconnect( old, SIGNAL(displayNameChanged(QString,QString)), this, SLOT(slotUpdateDisplayName()) );
469
469
 
470
 
                        disconnect( old, SIGNAL(propertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)), this, SLOT(slotContactPropertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)) );
 
470
                        disconnect( old, SIGNAL(displayNameChanged(QString,QString)), this, SLOT(slotDisplayNameChanged(QString,QString)) );
471
471
 
472
472
                        emit contactAdded( c, suppress );
473
473
                        emit contactRemoved( old, QString() );
488
488
                        connect( c->metaContact(), SIGNAL(photoChanged()), this, SIGNAL(photoChanged()) );
489
489
                }
490
490
                else
491
 
                        connect( c, SIGNAL(propertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)), this, SLOT(slotUpdateDisplayName()) );
 
491
                        connect( c, SIGNAL(displayNameChanged(QString,QString)), this, SLOT(slotUpdateDisplayName()) );
492
492
                connect( c, SIGNAL(contactDestroyed(Kopete::Contact*)), this, SLOT(slotContactDestroyed(Kopete::Contact*)) );
493
 
                connect( c, SIGNAL(propertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)), this, SLOT(slotContactPropertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)) );
 
493
                connect( c, SIGNAL(displayNameChanged(QString,QString)), this, SLOT(slotDisplayNameChanged(QString,QString)) );
494
494
 
495
495
                slotUpdateDisplayName();
496
496
        }
521
521
                        disconnect( c->metaContact(), SIGNAL(photoChanged()), this, SIGNAL(photoChanged()) );
522
522
                }
523
523
                else
524
 
                        disconnect( c, SIGNAL(propertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)), this, SLOT(slotUpdateDisplayName()) );
 
524
                        disconnect( c, SIGNAL(displayNameChanged(QString,QString)), this, SLOT(slotUpdateDisplayName()) );
525
525
                disconnect( c, SIGNAL(contactDestroyed(Kopete::Contact*)), this, SLOT(slotContactDestroyed(Kopete::Contact*)) );
526
526
 
527
 
                disconnect( c, SIGNAL(propertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)), this, SLOT(slotContactPropertyChanged(Kopete::PropertyContainer*,QString,QVariant,QVariant)) );
 
527
                disconnect( c, SIGNAL(displayNameChanged(QString,QString)), this, SLOT(slotDisplayNameChanged(QString,QString)) );
528
528
 
529
529
                slotUpdateDisplayName();
530
530
        }
561
561
        }
562
562
 
563
563
        KNotification *notification = new KNotification( "user_is_typing_message", viewWidget );
564
 
        const QString msgBody = i18n( "User <i>%1</i> is typing a message", c->nickName() );
 
564
        const QString msgBody = i18n( "User <i>%1</i> is typing a message", c->displayName() );
565
565
        notification->setText( msgBody );
566
566
        notification->setPixmap( QPixmap::fromImage( c->metaContact()->picture().image() ) );
567
567
        notification->setActions( QStringList( i18nc("@action", "Chat") ) );
731
731
        d->warnGroupChat=b;
732
732
}
733
733
 
734
 
void Kopete::ChatSession::slotContactPropertyChanged( Kopete::PropertyContainer * contact, const QString &key, const QVariant &oldValue, const QVariant &newValue ){
735
 
        Kopete::Contact *c = (Kopete::Contact*) contact;
736
 
        if (key == Kopete::Global::Properties::self()->nickName().key()){
737
 
                const QString nick = oldValue.toString();
738
 
                emit nickNameChanged(c,nick);
739
 
        }
740
 
        Q_UNUSED(newValue);
 
734
void Kopete::ChatSession::slotDisplayNameChanged(const QString &oldName, const QString &)
 
735
{
 
736
        Kopete::Contact *c = static_cast<Kopete::Contact *>(sender());
 
737
        emit nickNameChanged(c, oldName);
741
738
}
742
739
 
743
740
#include "kopetechatsession.moc"