SILC_NICK_REC *nick;
SILC_CHANNEL_REC *chanrec;
+ SILC_LOG_DEBUG(("Start"));
+
server = conn == NULL ? NULL : conn->context;
chanrec = silc_channel_find_entry(server, channel);
if (!chanrec)
return;
nick = silc_nicklist_find(chanrec, sender);
+ if (!nick) {
+ /* We didn't find client but it clearly exists, add it. */
+ SilcChannelUser chu;
+
+ silc_list_start(channel->clients);
+ while ((chu = silc_list_get(channel->clients)) != SILC_LIST_END) {
+ if (chu->client == sender) {
+ nick = silc_nicklist_insert(chanrec, chu, FALSE);
+ break;
+ }
+ }
+ }
if (flags & SILC_MESSAGE_FLAG_ACTION)
printformat_module("fe-common/silc", server, channel->channel_name,
char *msg)
{
SILC_SERVER_REC *server;
+ char userhost[256];
+ SILC_LOG_DEBUG(("Start"));
+
server = conn == NULL ? NULL : conn->context;
+ memset(userhost, 0, sizeof(userhost));
+ if (sender->username)
+ snprintf(userhost, sizeof(userhost) - 1, "%s@%s",
+ sender->username, sender->hostname);
signal_emit("message private", 4, server, msg,
sender->nickname ? sender->nickname : "[<unknown>]",
- sender->username ? sender->username : NULL);
+ sender->username ? userhost : NULL);
}
/* Notify message to the client. The notify arguments are sent in the
SILC_SERVER_REC *server;
va_list va;
+ SILC_LOG_DEBUG(("Start"));
+
server = conn == NULL ? NULL : conn->context;
va_start(va, type);
{
SILC_SERVER_REC *server = conn->context;
+ SILC_LOG_DEBUG(("Start"));
+
+ if (server->conn) {
+ nicklist_rename_unique(SERVER(server),
+ server->conn->local_entry, server->nick,
+ server->conn->local_entry,
+ silc_client->username);
+ silc_change_nick(server, silc_client->username);
+ }
+
server->conn->context = NULL;
server->conn = NULL;
server->connection_lost = TRUE;
{
SILC_SERVER_REC *server = conn->context;
+ SILC_LOG_DEBUG(("Start"));
+
if (!success)
return;
silc_list_start(channel->clients);
while ((chu = silc_list_get(channel->clients)) != SILC_LIST_END) {
+ if (!chu->client->nickname)
+ continue;
if (chu->mode & SILC_CHANNEL_UMODE_CHANFO)
founder = chu->client;
silc_nicklist_insert(chanrec, chu, FALSE);
}
}
+typedef struct {
+ SilcClient client;
+ SilcClientConnection conn;
+ void *entry;
+ SilcIdType id_type;
+ char *fingerprint;
+} *GetkeyContext;
+
+void silc_getkey_cb(bool success, void *context)
+{
+ GetkeyContext getkey = (GetkeyContext)context;
+ char *entity = (getkey->id_type == SILC_ID_CLIENT ? "user" : "server");
+ char *name = (getkey->id_type == SILC_ID_CLIENT ?
+ ((SilcClientEntry)getkey->entry)->nickname :
+ ((SilcServerEntry)getkey->entry)->server_name);
+
+ if (success) {
+ printformat_module("fe-common/silc", NULL, NULL,
+ MSGLEVEL_CRAP, SILCTXT_GETKEY_VERIFIED, entity, name);
+ } else {
+ printformat_module("fe-common/silc", NULL, NULL,
+ MSGLEVEL_CRAP, SILCTXT_GETKEY_DISCARD, entity, name);
+ }
+
+ silc_free(getkey->fingerprint);
+ silc_free(getkey);
+}
+
/* Command reply handler. This function is called always in the command reply
function. If error occurs it will be called as well. Normal scenario
is that it will be called after the received command data has been parsed
va_start(vp, status);
+ SILC_LOG_DEBUG(("Start"));
+
switch(command) {
case SILC_COMMAND_WHOIS:
{
}
mode = silc_client_chmode(modei,
- channel_entry->channel_key->cipher->name,
- channel_entry->hmac->hmac->name);
+ channel_entry->channel_key ?
+ channel_entry->channel_key->cipher->name : "",
+ channel_entry->hmac ?
+ silc_hmac_get_name(channel_entry->hmac) : "");
g_free_not_null(chanrec->mode);
chanrec->mode = g_strdup(mode == NULL ? "" : mode);
signal_emit("channel mode changed", 1, chanrec);
while ((chu = silc_list_get(channel->clients)) != SILC_LIST_END) {
SilcClientEntry e = chu->client;
char stat[5], *mode;
+
+ if (!e->nickname)
+ continue;
memset(stat, 0, sizeof(stat));
mode = silc_client_chumode_char(chu->mode);
printformat_module("fe-common/silc", server, channel->channel_name,
MSGLEVEL_CRAP, SILCTXT_USERS,
- e->nickname, stat, e->username,
+ e->nickname, stat,
+ e->username ? e->username : "",
+ e->hostname ? e->hostname : "",
e->realname ? e->realname : "");
if (mode)
silc_free(mode);
SilcPublicKey public_key;
unsigned char *pk;
uint32 pk_len;
+ GetkeyContext getkey;
if (!success)
return;
if (public_key) {
pk = silc_pkcs_public_key_encode(public_key, &pk_len);
+
+ getkey = silc_calloc(1, sizeof(*getkey));
+ getkey->entry = entry;
+ getkey->id_type = id_type;
+ getkey->client = client;
+ getkey->conn = conn;
+ getkey->fingerprint = silc_hash_fingerprint(NULL, pk, pk_len);
silc_verify_public_key_internal(client, conn,
(id_type == SILC_ID_CLIENT ?
SILC_SOCKET_TYPE_CLIENT :
SILC_SOCKET_TYPE_SERVER),
pk, pk_len, SILC_SKE_PK_TYPE_SILC,
- NULL, NULL);
+ silc_getkey_cb, getkey);
silc_free(pk);
} else {
printformat_module("fe-common/silc", server, NULL,
{
InternalGetAuthMethod internal = (InternalGetAuthMethod)context;
+ SILC_LOG_DEBUG(("Start"));
+
switch (auth_meth) {
case SILC_AUTH_NONE:
/* No authentication required. */
{
InternalGetAuthMethod internal;
+ SILC_LOG_DEBUG(("Start"));
+
/* XXX must resolve from configuration whether this connection has
any specific authentication data */
void silc_failure(SilcClient client, SilcClientConnection conn,
SilcProtocol protocol, void *failure)
{
+ SILC_LOG_DEBUG(("Start"));
+
if (protocol->protocol->type == SILC_PROTOCOL_CLIENT_KEY_EXCHANGE) {
SilcSKEStatus status = (SilcSKEStatus)failure;
silc_client_perform_key_agreement). */
int silc_key_agreement(SilcClient client, SilcClientConnection conn,
- SilcClientEntry client_entry, char *hostname,
- int port,
- SilcKeyAgreementCallback *completion,
+ SilcClientEntry client_entry, const char *hostname,
+ uint16 port, SilcKeyAgreementCallback *completion,
void **context)
{
char portstr[12];
+ SILC_LOG_DEBUG(("Start"));
+
/* We will just display the info on the screen and return FALSE and user
will have to start the key agreement with a command. */
return FALSE;
}
+void silc_ftp(SilcClient client, SilcClientConnection conn,
+ SilcClientEntry client_entry, uint32 session_id,
+ const char *hostname, uint16 port)
+{
+
+ SILC_LOG_DEBUG(("Start"));
+
+ /* XXX */
+ silc_client_file_receive(client, conn, NULL, NULL, client_entry,
+ session_id);
+
+}
+
/* SILC client operations */
SilcClientOperations ops = {
silc_say,
silc_ask_passphrase,
silc_failure,
silc_key_agreement,
+ silc_ftp,
};