Re: [Evolution-hackers] CamelStore and service->connect()

On Thu, 2005-08-25 at 14:25 +0200, Jules Colding wrote:
> Hi,
> I need the user to provide a password when connecting to the remote
> server. The connection is, as far as I can understand, established when
> service->connect() is invoked. 
> Is connect() invoke by the store itself, or by an external process?
> I can connect while initiating the store, so I really do not need a
> specific service->connect() function. Can I make service->connect() be a
> noop?

You should really only connect when connect is called; but it depends on
what you're doing a bit though.  e.g. local mail doesn't do anything for
a connect since it has no connection.

> If not, may I keep a pointer to my session in my service instance so
> that I can query the password during the invocation of connect()?

Which session?  As jeff said, the CamelSession is already set in the
store.service, assuming you called construct properly.

If it is your own 'session' object, e.g. as with imap we have a socket
which represents the connection; then yes, you need to keep your own
pointer in your own store object for that, and initialise that at
connect time.

You should probably get the password from the url, and ask for one if
that isn't set.  e.g. like the imap code does.

> Is the return value from connect() just whether there is a present live
> connection or not? I am curious as whether I can just connect in the
> store init function and then always just return TRUE in connect()?

It's just whether it worked.  It should just be !exception_set().

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]