old Client ID too.
Fixed some odd GCC "anonymous struct" errors from silcpkcs.h and
silcdlist.h.
if (!clients && r->retry < 1) {
/* Retry to resolve */
+ r->retry++;
silc_client_get_clients_by_channel(client, conn, channel,
silc_client_join_get_users, context);
- r->retry++;
return;
}
SILC_CHANNEL_REC *channel;
QUERY_REC *query;
char *unescaped_data;
- int unescaped_data_len;
+ SilcUInt32 unescaped_data_len;
char *mime_data;
int mime_data_len;
<tr>
<td><small>SILC_COMMAND_NICK</td>
<td><small>
-Returns the new Client ID after user has changed nickname.
+Returns the new Client ID and new nickname inside the SilcClientEntry.
+The `old_client_id' is the odl Client ID used by the client before the
+nickname was changed.
</td>
-<td width="50%"><small>SilcClientEntry local_entry, char *nickname
+<td width="50%"><small>SilcClientEntry local_entry, char *nickname,
+const SilcClientID *old_client_id
</td>
</tr>
SilcIDPayload idp;
unsigned char *tmp;
SilcUInt32 argc, len;
+ SilcClientID old_client_id;
SILC_LOG_DEBUG(("Start"));
goto out;
}
+ /* Save old Client ID */
+ old_client_id = *conn->local_id;
+
/* Take received Client ID */
tmp = silc_argument_get_arg_type(cmd->args, 2, &len);
idp = silc_id_payload_parse(tmp, len);
}
/* Notify application */
- COMMAND_REPLY((SILC_ARGS, conn->local_entry, conn->local_entry->nickname));
+ COMMAND_REPLY((SILC_ARGS, conn->local_entry, conn->local_entry->nickname,
+ (const SilcClientID *)&old_client_id));
out:
SILC_CLIENT_PENDING_EXEC(cmd, SILC_COMMAND_NICK);
bool ret = silc_idcache_del_by_context(conn->internal->client_cache,
client_entry);
- /* Remove from channels */
- silc_client_remove_from_channels(client, conn, client_entry);
+ if (ret) {
+ /* Remove from channels */
+ silc_client_remove_from_channels(client, conn, client_entry);
- /* Free the client entry data */
- silc_client_del_client_entry(client, conn, client_entry);
+ /* Free the client entry data */
+ silc_client_del_client_entry(client, conn, client_entry);
+ }
return ret;
}
* DESCRIPTION
*
* Converts an ID of type `type' to data. This can be used to
- * convert the ID's to data for inclusion in the packets.
+ * convert the ID's to data for inclusion in the packets. Use the
+ * silc_id_get_len to get the length of the ID.
*
***/
unsigned char *silc_id_id2str(const void *id, SilcIdType type);
*
* NAME
*
- * typedef struct { ... } *SilcPublicKey;
+ * typedef struct { ... } *SilcPublicKey, SilcPublicKeyStruct;
*
* DESCRIPTION
*
char *identifier;
unsigned char *pk;
SilcUInt32 pk_len;
-} *SilcPublicKey;
+} *SilcPublicKey, SilcPublicKeyStruct;
/***/
/****s* silccrypt/SilcPKCSAPI/SilcPublicKeyIdentifier
*
* NAME
*
- * typedef struct { ... } *SilcPublicKeyIdentifier;
+ * typedef struct { ... } *SilcPublicKeyIdentifier,
+ * SilcPublicKeyIdentifierStruct;
*
* DESCRIPTION
*
char *email;
char *org;
char *country;
-} *SilcPublicKeyIdentifier;
+} *SilcPublicKeyIdentifier, SilcPublicKeyIdentifierStruct;
/***/
/****s* silccrypt/SilcPKCSAPI/SilcPrivateKey
*
* NAME
*
- * typedef struct { ... } *SilcPrivateKey;
+ * typedef struct { ... } *SilcPrivateKey, SilcPrivateKeyStruct;
*
* DESCRIPTION
*
char *name;
unsigned char *prv;
SilcUInt32 prv_len;
-} *SilcPrivateKey;
+} *SilcPrivateKey, SilcPrivateKeyStruct;
/* Public and private key file headers */
#define SILC_PKCS_PUBLIC_KEYFILE_BEGIN "-----BEGIN SILC PUBLIC KEY-----\n"
*
* SOURCE
*/
-typedef struct {
+typedef struct SilcDListStruct {
SilcList list;
} *SilcDList;
/***/