im.pidgin.pidgin: 04e7d54475c3ddf91ad523e3e58521bc4fa59c85

Will Thompson will at willthompson.co.uk
Thu Jan 31 12:23:22 EST 2008


On Thu, Jan 31, 2008 at 09:23:51AM -0700, Eoin Coffey wrote:
> The only place where I could find wants_to_die being used in libpurple
> (outside of connection.c) is in purple_account_set_enabled().  The logic
> there seems to be if wants_to_die is TRUE, as in the user as opted to log
> out or something, then don't bother attempting to connect / disconnect.
> 
> It seems that purple_connection_error_reason() and
> purple_connection_error_is_fatal() are for setting gc->wants_to_die and not
> accessing it.

Well, purple_connection_error_is_fatal() is meant to replace checking if
gc->wants_to_die is true.  wants_to_die is set to is_fatal() for
backwards compatibility with code that checks wants_to_die.

There are three uses of wants_to_die in libpurple:

* in purple_account_set_enabled(), the account is not connected or
  disconnected if wants_to_die is TRUE.  I have no idea why --- surely
  if you're enabling the account, you want it to connect (assuming it's
  in an online status, which is checked two lines later), and if you're
  disabling it, you want to disconnect it?  Can this check be removed?

* It's set in purple_connection_new() when registering a new account,
  with the explanation:
      /* set this so we don't auto-reconnect after registering */
  Why don't we want to connect when registration's successful?  If
  indeed we don't, shouldn't the account be disabled when registration
  finishes?

* It's set in purple_connections_disconnect_all(), and again I don't
  really know why.  Is this because disconnect_all() gets called when
  you quit?  In which case, could this be replaced with some global
  "we're quitting now!" flag?

In prpls, it's set in jabber_register_parse(); the same question as
purple_connection_new() applies.  It's also set in silc10, but I'm going
to fix that now to match silc11.
-- 
Will
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://pidgin.im/pipermail/devel/attachments/20080131/e0e80ace/attachment.sig>


More information about the Devel mailing list