transport: fix, assign all data before change connection state
When used with purple, call to sipe_backend_connection_completed()
triggers purple to change state to PURPLE_CONNECTED and to emit
the events "signed-on", "account-signed-on" and "autojoin".
An application willing to communicate (message, file xfer, ...)
will be waiting for connection. It has registered a callback to
one of the events above to be informed of connection ready.
With current code, the connection info are still not fully parsed
when the events are emitted. Following data are not yet assigned:
- sipe_private->contact;
- sipe_private->allowed_events;
- sipe_private->public.flags
Without these information, the application cannot start the
communication immediately; it will the and receive reply from
server:
SIP/2.0 400 Invalid Contact information
Move call to sipe_backend_connection_completed() few lines below,
when info are fully parsed and all data already assigned.
How to reproduce it:
- use "nullclient" available as an example in libpurple;
- enable debug messages in init_libpurple() by changing:
- purple_debug_set_enabled(FALSE);
+ purple_debug_set_enabled(TRUE);
- add an action in callback signed_on(), e.g.
+ serv_send_file(gc, "sip_account", "file_name");
with proper strings for file to send and destination account.
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>