From kde-commits Sat Dec 16 00:12:38 2006 From: Will Stephenson Date: Sat, 16 Dec 2006 00:12:38 +0000 To: kde-commits Subject: branches/KDE/3.5/kdenetwork/kopete/kopete Message-Id: <1166227958.378482.12402.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=116622796713261 SVN commit 614008 by wstephens: Highly important dcop methods - why didn't we think of these before? M +24 -0 kopeteiface.cpp M +12 -0 kopeteiface.h --- branches/KDE/3.5/kdenetwork/kopete/kopete/kopeteiface.cpp #614007:614008 @@ -316,5 +316,29 @@ } } +QStringList KopeteIface::contactsForDisplayName( const QString & displayName ) +{ + Kopete::MetaContact * mc = Kopete::ContactList::self()->findMetaContactByDisplayName( displayName ); + QStringList contactIds; + if ( mc ) + { + QPtrList contacts = mc->contacts(); + QPtrListIterator it( contacts ); + for( ; it.current(); ++it ) + { + contactIds.append( (*it)->contactId() ); + } + } + return contactIds; +} + +QStringList KopeteIface::metacontactsForContactId( const QString & contactId ) +{ + Kopete::MetaContact * mc = Kopete::ContactList::self()->findMetaContactByContactId( contactId ); + if ( mc ) + return QStringList( mc->displayName() ); + else + return QStringList(); +} // vim: set noet ts=4 sts=4 sw=4: --- branches/KDE/3.5/kdenetwork/kopete/kopete/kopeteiface.h #614007:614008 @@ -155,6 +155,18 @@ * @param photoUrl URL to the photo */ void setGlobalPhoto( const KURL &photoUrl ); + + /** + * get the contactIds for a given display name + * @param displayName + */ + QStringList contactsForDisplayName( const QString & displayName ); + + /** + * get the metacontactIds that have the given contactId + * @param contactId + */ + QStringList metacontactsForContactId( const QString & contactId ); }; #endif