More client library rewrites (key agreement, plus other).
[silc.git] / lib / silcclient / tests / test_silcclient.c
index 68d5f90cb6e5feb2778a2825dd3cd4d7425b912b..ef5529a050a6baa3bcae125471c32a3793bd8a69 100644 (file)
@@ -6,25 +6,11 @@
 SilcBool success;
 SilcClientOperations ops;
 
-/* XXX */
-SilcChannelUser silc_client_on_channel(SilcChannelEntry channel,
-                                       SilcClientEntry client_entry)
-{
-  return NULL;
-}
-
 SilcBuffer silc_client_attributes_request(SilcAttribute attribute, ...)
 {
   return NULL;
 }
 
-SilcBool silc_client_del_channel_private_keys(SilcClient client,
-                                              SilcClientConnection conn,
-                                              SilcChannelEntry channel)
-{
-  return FALSE;
-}
-
 
 /******* MyBot code **********************************************************/
 
@@ -40,12 +26,14 @@ typedef struct {
 
 static void
 silc_connected(SilcClient client, SilcClientConnection conn,
-              SilcClientConnectionStatus status, void *context)
+              SilcClientConnectionStatus status,
+              SilcStatus error, const char *message,
+              void *context)
 {
   MyBot mybot = client->application;
 
   if (status == SILC_CLIENT_CONN_DISCONNECTED) {
-    SILC_LOG_DEBUG(("Disconnected"));
+    SILC_LOG_DEBUG(("Disconnected %s", message ? message : ""));
     silc_client_stop(client);
     return;
   }
@@ -85,14 +73,9 @@ int mybot_start(void)
     return 1;
   }
 
-  /* Now fill the allocated client with mandatory parameters the library
-     requires: username, hostname and "real name". */
-  mybot->client->username = silc_get_username();
-  mybot->client->hostname = silc_net_localhost();
-  mybot->client->realname = strdup("I am the MyBot");
-
   /* Now we initialize the client. */
-  if (!silc_client_init(mybot->client)) {
+  if (!silc_client_init(mybot->client, silc_get_username(),
+                       silc_net_localhost(), "I am the MyBot")) {
     perror("Could not init client");
     return 1;
   }
@@ -189,7 +172,7 @@ silc_channel_message(SilcClient client, SilcClientConnection conn,
 
 
 /* Private message to the client. The `sender' is the sender of the
-   message. The message is `message'and maybe NULL.  The `flags'  
+   message. The message is `message'and maybe NULL.  The `flags'
    indicates message flags  and it is used to determine how the message
    can be interpreted (like it may tell the message is multimedia
    message). */
@@ -360,11 +343,10 @@ silc_ask_passphrase(SilcClient client, SilcClientConnection conn,
    silc_client_perform_key_agreement). If TRUE is returned also the
    `completion' and `context' arguments must be set by the application. */
 
-static bool
+static void
 silc_key_agreement(SilcClient client, SilcClientConnection conn,
                   SilcClientEntry client_entry, const char *hostname,
-                  SilcUInt16 port, SilcKeyAgreementCallback *completion,
-                  void **context)
+                  SilcUInt16 port)
 {
   /* MyBot does not support incoming key agreement protocols, it's too
      simple for that. */