On Monday 07 January 2008, Tom Patzig said: > SVN commit 758223 by tpatzig: > > -2 new dbus functions, for convenience > *getDisplayName > *isContactOnline
I've asked Tom about this, he is implementing a Giver (DNSSD based file transfer) client and wants to show Kopete contacts in its contact list using these methods. I suggest rather than implementing another contact list though, to make it possible to use the Giver library in a kopete plugin that shows the DNSSD contacts there. Will k > > > M +18 -0 kopetedbusinterface.cpp > M +15 -0 kopetedbusinterface.h > M +9 -0 org.kde.Kopete.xml > > > --- trunk/KDE/kdenetwork/kopete/kopete/kopetedbusinterface.cpp > #758222:758223 @@ -272,6 +272,24 @@ > } > } > > +QString KopeteDBusInterface::getDisplayName(const QString &contactId) > +{ > + Kopete::MetaContact *contact = > Kopete::ContactList::self()->findMetaContactByContactId(contactId); + if ( > contact ) > + return contact->displayName(); > + else > + return ""; > +} > + > +bool KopeteDBusInterface::isContactOnline(const QString &displayName) > +{ > + Kopete::MetaContact *contact = > Kopete::ContactList::self()->findMetaContactByDisplayName(displayName); > + if ( contact ) > + return contact->isOnline(); > + else > + return false; > +} > + > bool KopeteDBusInterface::addContact(const QString &protocolName, const > QString &accountId, const QString &contactId, const QString &displayName, > const QString &groupName) { > QString protocolId = protocolName; > --- trunk/KDE/kdenetwork/kopete/kopete/kopetedbusinterface.h #758222:758223 > @@ -190,6 +190,21 @@ > * @param fileUrl Url of the file to send > */ > void sendFile( const QString &displayName, const QString &fileUrl ); > + > + QString getDisplayName(const QString &contactId); > + > + /** > + * @brief Retrieve the Display Name from the given contact ID > + * @param contactId Metacontact contactId > + */ > + > + bool isContactOnline(const QString &displayName); > + > + /** > + * @brief Get the Online Status of the contact > + * @param displayName The displayName of the contact > + */ > + > }; > > #endif > --- trunk/KDE/kdenetwork/kopete/kopete/org.kde.Kopete.xml #758222:758223 > @@ -94,5 +94,14 @@ > <arg name="displayName" type="s" direction="in"/> > <arg name="fileUrl" type="s" direction="in"/> > </method> > + <method name="getDisplayName"> > + <arg name="contactID" type="s" direction="in"/> > + <arg type="s" direction="out"/> > + </method> > + <method name="isContactOnline"> > + <arg name="displayName" type="s" direction="in"/> > + <arg type="b" direction="out"/> > + </method> > + > </interface> > </node> _______________________________________________ kopete-devel mailing list kopete-devel@kde.org https://mail.kde.org/mailman/listinfo/kopete-devel