Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2006 Pekka Riikonen
+ Copyright (C) 1997 - 2007 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* Continue after last command reply received */
if (SILC_STATUS_IS_ERROR(status) || status == SILC_STATUS_OK ||
status == SILC_STATUS_LIST_END)
- SILC_FSM_CALL_CONTINUE(notify->fsm);
+ SILC_FSM_CALL_CONTINUE_SYNC(notify->fsm);
return TRUE;
}
return SILC_FSM_FINISH;
}
- /* Save notify payload to packet context during processing */
notify->packet = packet;
notify->payload = payload;
notify->fsm = fsm;
/* Get the channel entry */
channel = silc_client_get_channel_by_id(client, conn, &id.u.channel_id);
+ if (!channel)
+ goto out;
/* If channel is being resolved handle notify after resolving */
if (channel->internal.resolve_cmd_ident) {
}
if (client_entry != conn->local_entry)
- silc_client_nickname_format(client, conn, client_entry);
+ silc_client_nickname_format(client, conn, client_entry, FALSE);
/* Join the client to channel */
if (!silc_client_add_to_channel(client, conn, channel, client_entry, 0))
SilcClient client = conn->client;
SilcClientNotify notify = state_context;
SilcNotifyPayload payload = notify->payload;
+ SilcPacket packet = notify->packet;
SilcNotifyType type = silc_notify_get_type(payload);
SilcArgumentPayload args = silc_notify_get_args(payload);
SilcClientEntry client_entry;
- unsigned char *tmp;
+ SilcChannelEntry channel;
+ unsigned char *tmp;
SilcUInt32 tmp_len;
SilcID id;
/* Notify application */
NOTIFY(client, conn, type, client_entry, tmp);
+ /* Remove from channel */
+ if (packet->dst_id_type == SILC_ID_CHANNEL) {
+ if (silc_id_str2id(packet->dst_id, packet->dst_id_len, SILC_ID_CHANNEL,
+ &id.u.channel_id, sizeof(id.u.channel_id))) {
+ channel = silc_client_get_channel_by_id(client, conn, &id.u.channel_id);
+ if (channel) {
+ silc_client_remove_from_channel(client, conn, channel, client_entry);
+ silc_client_unref_channel(client, conn, channel);
+ }
+ }
+ }
+
/* Delete client */
- silc_client_remove_from_channels(client, conn, client_entry);
silc_client_del_client(client, conn, client_entry);
silc_client_unref_client(client, conn, client_entry);
if (tmp) {
char *tmp_nick = NULL;
- if (client->internal->params->nickname_parse)
- client->internal->params->nickname_parse(client_entry->nickname,
- &tmp_nick);
- else
- tmp_nick = strdup(tmp);
+ silc_client_nickname_parse(client, conn, client_entry->nickname,
+ &tmp_nick);
/* If same nick, the client was new to us and has become "present"
to network. Send NULL as nick to application. */