From: Pekka Riikonen Date: Wed, 10 Apr 2002 10:02:18 +0000 (+0000) Subject: updates. X-Git-Tag: silc.client.0.8.6~4^2~10 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=2ee2102bc017e6e713c9c4e8260a46424d30b977 updates. --- diff --git a/apps/irssi/src/silc/core/client_ops.c b/apps/irssi/src/silc/core/client_ops.c index 3865d702..35c9a64e 100644 --- a/apps/irssi/src/silc/core/client_ops.c +++ b/apps/irssi/src/silc/core/client_ops.c @@ -1792,6 +1792,13 @@ int silc_key_agreement(SilcClient client, SilcClientConnection conn, return FALSE; } +/* Notifies application that file transfer protocol session is being + requested by the remote client indicated by the `client_entry' from + the `hostname' and `port'. The `session_id' is the file transfer + session and it can be used to either accept or reject the file + transfer request, by calling the silc_client_file_receive or + silc_client_file_close, respectively. */ + void silc_ftp(SilcClient client, SilcClientConnection conn, SilcClientEntry client_entry, SilcUInt32 session_id, const char *hostname, SilcUInt16 port) @@ -1823,6 +1830,31 @@ void silc_ftp(SilcClient client, SilcClientConnection conn, client_entry->nickname, hostname, portstr); } +/* Delivers SILC session detachment data indicated by `detach_data' to the + application. If application has issued SILC_COMMAND_DETACH command + the client session in the SILC network is not quit. The client remains + in the network but is detached. The detachment data may be used later + to resume the session in the SILC Network. The appliation is + responsible of saving the `detach_data', to for example in a file. + + The detachment data can be given as argument to the functions + silc_client_connect_to_server, or silc_client_add_connection when + creating connection to remote server, inside SilcClientConnectionParams + structure. If it is provided the client library will attempt to resume + the session in the network. After the connection is created + successfully, the application is responsible of setting the user + interface for user into the same state it was before detaching (showing + same channels, channel modes, etc). It can do this by fetching the + information (like joined channels) from the client library. */ + +void +silc_detach(SilcClient client, SilcClientConnection conn, + const unsigned char *detach_data, SilcUInt32 detach_data_len) +{ + +} + + /* SILC client operations */ SilcClientOperations ops = { silc_say, @@ -1839,4 +1871,5 @@ SilcClientOperations ops = { silc_failure, silc_key_agreement, silc_ftp, + silc_detach, }; diff --git a/apps/irssi/src/silc/core/client_ops.h b/apps/irssi/src/silc/core/client_ops.h index f7031fdb..505b6343 100644 --- a/apps/irssi/src/silc/core/client_ops.h +++ b/apps/irssi/src/silc/core/client_ops.h @@ -63,5 +63,8 @@ int silc_key_agreement(SilcClient client, SilcClientConnection conn, void silc_ftp(SilcClient client, SilcClientConnection conn, SilcClientEntry client_entry, SilcUInt32 session_id, const char *hostname, SilcUInt16 port); +void +silc_detach(SilcClient client, SilcClientConnection conn, + const unsigned char *detach_data, SilcUInt32 detach_data_len); #endif diff --git a/lib/silcclient/client_ops_example.c b/lib/silcclient/client_ops_example.c index e35a56e6..5b5c1e3a 100644 --- a/lib/silcclient/client_ops_example.c +++ b/lib/silcclient/client_ops_example.c @@ -225,6 +225,31 @@ silc_ftp(SilcClient client, SilcClientConnection conn, } +/* Delivers SILC session detachment data indicated by `detach_data' to the + application. If application has issued SILC_COMMAND_DETACH command + the client session in the SILC network is not quit. The client remains + in the network but is detached. The detachment data may be used later + to resume the session in the SILC Network. The appliation is + responsible of saving the `detach_data', to for example in a file. + + The detachment data can be given as argument to the functions + silc_client_connect_to_server, or silc_client_add_connection when + creating connection to remote server, inside SilcClientConnectionParams + structure. If it is provided the client library will attempt to resume + the session in the network. After the connection is created + successfully, the application is responsible of setting the user + interface for user into the same state it was before detaching (showing + same channels, channel modes, etc). It can do this by fetching the + information (like joined channels) from the client library. */ + +static void +silc_detach(SilcClient client, SilcClientConnection conn, + const unsigned char *detach_data, SilcUInt32 detach_data_len) +{ + +} + + /* The SilcClientOperation structure containing the operation functions. You will give this as an argument to silc_client_alloc function. */ SilcClientOperations ops = { @@ -241,5 +266,6 @@ SilcClientOperations ops = { silc_ask_passphrase, silc_failure, silc_key_agreement, - silc_ftp + silc_ftp, + silc_detach }; diff --git a/lib/silcclient/silcclient.h b/lib/silcclient/silcclient.h index 87c3b97c..dd3e5cb1 100644 --- a/lib/silcclient/silcclient.h +++ b/lib/silcclient/silcclient.h @@ -409,6 +409,26 @@ typedef struct { void (*ftp)(SilcClient client, SilcClientConnection conn, SilcClientEntry client_entry, SilcUInt32 session_id, const char *hostname, SilcUInt16 port); + + /* Delivers SILC session detachment data indicated by `detach_data' to the + application. If application has issued SILC_COMMAND_DETACH command + the client session in the SILC network is not quit. The client remains + in the network but is detached. The detachment data may be used later + to resume the session in the SILC Network. The appliation is + responsible of saving the `detach_data', to for example in a file. + + The detachment data can be given as argument to the functions + silc_client_connect_to_server, or silc_client_add_connection when + creating connection to remote server, inside SilcClientConnectionParams + structure. If it is provided the client library will attempt to resume + the session in the network. After the connection is created + successfully, the application is responsible of setting the user + interface for user into the same state it was before detaching (showing + same channels, channel modes, etc). It can do this by fetching the + information (like joined channels) from the client library. */ + void (*detach)(SilcClient client, SilcClientConnection conn, + const unsigned char *detach_data, + SilcUInt32 detach_data_len); } SilcClientOperations; /***/ @@ -640,7 +660,14 @@ typedef struct { /* The SILC session detachment data that was returned by `detach' client operation when the application detached from the network. Application is responsible of saving the data and giving it as argument here - for resuming the session in the SILC network. */ + for resuming the session in the SILC network. + + If this is provided here the client library will attempt to resume + the session in the network. After the connection is created + successfully, the application is responsible of setting the user + interface for user into the same state it was before detaching (showing + same channels, channel modes, etc). It can do this by fetching the + information (like joined channels) from the client library. */ unsigned char *detach_data; SilcUInt32 detach_data_len;