[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kopete-devel
Subject:    Re: [Kopete-devel] 1000 and 1 way to add contacts to kopete
From:       Olivier Goffart <ogoffart () tiscalinet ! be>
Date:       2002-08-28 23:26:35
[Download RAW message or body]



>2. How to create _one_ function to add a new contact from the protocol-side 
>to the contactlist? So far I see several ways of adding contacts:
>- contact from serverside list
>- unknown contact that just messaged me
>- contact from addcontactpage (aka, partly-there-contact *g*)
>
>So far I have seen that addcontactpage now gives me an _already existing_ 
>metacontact whereas for unknown/serverside contacts I need to create a new 
>metacontact myself.

-For contacts from AddContactPage:

void MyProtocolAddContactPage::slotFinish(KopeteMetaContact *m)
{
	MyProtocolContact *c=new MyProtocolContact(......);
	m->addContact(c,QStringList()); 
}

You can reach the groups with m->groups() 

-For contact from serverside list:

KopeteMetaContact *m = KopeteContactList::contactList()->findContact(...);
if(m) //Existing contact,update data (such as groups change by another client)
else 
{
	m= new KopeteMetaContact();
	MyProtocolContact *c=new MyProtocolContact(......);
	m->addContact( c, c->groups() );
	KopeteContactList::contactList()->addMetaContact(mc);
}

-For Unknown contact that just messaged me

I don't know..
I think that it misses something in the api for do that.
I propose created flag in the metacontact for don't serialize it, and to add 
it in a special group.

>And finally the big question for the feature we are all working on since 0.4:
>How to make grouping of two contacts into one MetaContact possible (i.e. what 
>is missing for that)?

Use 'Add contact' from the contextmenu of a metacontact 

note: Work only if the plugin implemented 
MyProtocolAddContactPage::slotFinish(KopeteMetaContact *m)
(currently only MSN)

>Btw, I thought about Drag'n'Drop in our contactlist instead/additonally to 
>context-menu-actions for move and copy, any comments on that? (we can do that 
>later!, it's just an idea) :)

I think it is a good idea


Another question:
What do you think about several contacts from the same protocols into the same 
metacontact?
The api currently allow that. But there are problems with serialize.

--
Olivier Goffart


_______________________________________________
Kopete-devel mailing list
Kopete-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/kopete-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic