goto out;
}
- client->data.registered = TRUE;
+ client->data.status |= SILC_IDLIST_STATUS_REGISTERED;
}
}
/* Do not process the notify if the client is not registered */
- if (client->data.registered == FALSE)
+ if (!(client->data.status & SILC_IDLIST_STATUS_REGISTERED))
break;
/* Do not add client to channel if it is there already */
chl = silc_calloc(1, sizeof(*chl));
chl->client = client;
chl->channel = channel;
+
+ /* If this is the first one on the channel then it is the founder off
+ the channel. */
+ if (!silc_hash_table_count(channel->user_list))
+ chl->mode = (SILC_CHANNEL_UMODE_CHANOP | SILC_CHANNEL_UMODE_CHANFO);
+
silc_hash_table_add(channel->user_list, client, chl);
silc_hash_table_add(client->channels, channel, chl);
silc_free(client_id);
/* Remove the client from all channels. */
silc_server_remove_from_channels(server, NULL, client, TRUE, tmp, FALSE);
- client->data.registered = FALSE;
+ client->data.status &= ~SILC_IDLIST_STATUS_REGISTERED;
cache->expire = SILC_ID_CACHE_EXPIRE_DEF;
server->stat.clients--;
if (server->server_type == SILC_ROUTER)
}
/* Update client entry */
- idata->registered = TRUE;
+ idata->status |= SILC_IDLIST_STATUS_REGISTERED;
client->nickname = nickname;
client->username = username;
client->userinfo = realname ? realname : strdup(" ");
silc_free(id_string);
/* Update server entry */
- idata->registered = TRUE;
+ idata->status |= SILC_IDLIST_STATUS_REGISTERED;
new_server->server_name = server_name;
new_server->id = server_id;
goto out;
}
entry->nickname = NULL;
- entry->data.registered = TRUE;
+ entry->data.status |= SILC_IDLIST_STATUS_REGISTERED;
if (sock->type == SILC_SOCKET_TYPE_SERVER)
server->stat.cell_clients++;
SILC_LOG_DEBUG(("Ignoring my own ID as new ID"));
break;
}
+
+ /* If the ID is the sender's ID, ignore it (we have it already) */
+ if (SILC_ID_SERVER_COMPARE(id, router->id)) {
+ SILC_LOG_DEBUG(("Ignoring sender's own ID"));
+ break;
+ }
SILC_LOG_DEBUG(("New server id(%s) from [%s] %s",
silc_id_render(id, SILC_ID_SERVER),
SILC_LOG_ERROR(("Could not add new server to the ID Cache"));
goto out;
}
- entry->data.registered = TRUE;
+ entry->data.status |= SILC_IDLIST_STATUS_REGISTERED;
if (sock->type == SILC_SOCKET_TYPE_SERVER)
server->stat.cell_servers++;