Summary: | Screenname in MSN with DCOP | ||
---|---|---|---|
Product: | [Unmaintained] kopete | Reporter: | Acher <matvei> |
Component: | general | Assignee: | Matt Rogers <mattr> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | kopete-bugs-null, pierre.linux59, smoothhound |
Priority: | NOR | ||
Version First Reported In: | 0.9.1 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Acher
2004-12-07 08:28:53 UTC
Hi After reading the source code of kopete, it seems extremely easy to do. I suppose that it's necessary to put that feature in the Account baseclass, and then implement it only in MSN protocol. Am I right ? Am I allowed to code that ? Thanks > I suppose that it's necessary to put that feature in the Account baseclass, > and then implement it only in MSN protocol. It looks like the better solution. > Am I allowed to code that ? You're always allowed to code anything. If it's generic enough, and that others protocol may implement it too, it will probably be included in the CVS On Wednesday 08 December 2004 18:46, Olivier Goffart wrote: > > I suppose that it's necessary to put that feature in the Account > > baseclass, and then implement it only in MSN protocol. > > It looks like the better solution. In general, for adding MSN-specific DCOP stuff, three options present themselves: 1) it's a general property which could apply to any account -> feel free to implement it, your code is likely to be accepted, much more so if it works for more than just MSN 2) it's MSN-specific, and it's stored as an account property -> implement a DCOP interface to read (and maybe write?) arbitrary account properties 3) it's MSN-specific, and it's not a property, or you want custom handling of it in some non-trivial way -> implement a DCOP interface for an MSN account. For (1) and (2), a new DCOP object representing each account should ideally be added, and a function on that object used, but that's non-essential (since the DCOP interface is unpublished and inter-version compatibility is by no means guaranteed, we can easily change this later). Nothing MSN-specific can appear in the Kopete application DCOP interface - that's not what Kopete's about. So how to create it ? Is a new DCOP object for each account needed, or can we do that in the "base" DCOP object ? http://bugs.kde.org/show_bug.cgi?id=90003 Same wish ;) *** Bug 90003 has been marked as a duplicate of this bug. *** I second that, i wish the same ting. *** This bug has been confirmed by popular vote. *** SVN commit 431229 by mlarouche: FEATURE: 94591 Implement two new commands in DCOP interface. Global identity must be activated for both commands. void setGlobalNickname(const QString &nickname) to set your global nickname. void setGlobalPhoto(const KURL &photoUrl) to set your global photo. M +22 -0 kopeteiface.cpp M +11 -0 kopeteiface.h --- trunk/KDE/kdenetwork/kopete/kopete/kopeteiface.cpp #431228:431229 @@ -31,6 +31,7 @@ #include "kopeteaway.h" #include "kopetegroup.h" #include "kopetecontact.h" +#include "kopeteconfig.h" KopeteIface::KopeteIface() : DCOPObject( "KopeteIface" ) { @@ -286,5 +287,26 @@ Kopete::Away::getInstance()->setAutoAway(); } +void KopeteIface::setGlobalNickname( const QString &nickname ) +{ + if( Kopete::Config::enableGlobalIdentity() ) + { + Kopete::MetaContact *myselfMetaContact = Kopete::ContactList::self()->myself(); + myselfMetaContact->setDisplayNameSource( Kopete::MetaContact::SourceCustom ); + myselfMetaContact->setDisplayName( nickname ); + } +} + +void KopeteIface::setGlobalPhoto( const KURL &photoUrl ) +{ + if( Kopete::Config::enableGlobalIdentity() ) + { + Kopete::MetaContact *myselfMetaContact = Kopete::ContactList::self()->myself(); + myselfMetaContact->setPhoto( photoUrl ); + if( myselfMetaContact->photoSource() != Kopete::MetaContact::SourceCustom ) + myselfMetaContact->setPhotoSource( Kopete::MetaContact::SourceCustom ); + } +} + // vim: set noet ts=4 sts=4 sw=4: --- trunk/KDE/kdenetwork/kopete/kopete/kopeteiface.h #431228:431229 @@ -144,6 +144,17 @@ */ void setAutoAway(); + /** + * set the global nickname if global identity is enabled. + * @param nickname the new global nickname + */ + void setGlobalNickname( const QString &nickname ); + + /** + * set the global photo if global identity is enabled. + * @param photoUrl URL to the photo + */ + void setGlobalPhoto( const KURL &photoUrl ); }; #endif I don't find "kopeteconfig.h" in svn :( It's a generated file (from kopete/libkopete/kopeteconfig.kcfgc) |