#include "fe-common/core/keyboard.h"
#include "fe-common/silc/module-formats.h"
+#include "core.h"
+
static void
silc_verify_public_key_internal(SilcClient client, SilcClientConnection conn,
const char *name, SilcSocketType conn_type,
SILC_CHANNEL_REC *chanrec;
SILC_NICK_REC *nickrec;
SilcClientEntry client_entry, client_entry2;
- SilcChannelEntry channel;
+ SilcChannelEntry channel, channel2;
SilcServerEntry server_entry;
SilcIdType idtype;
void *entry;
MSGLEVEL_MODES, SILCTXT_CHANNEL_CMODE,
channel->channel_name, tmp ? tmp : "removed all",
server_entry->server_name);
+ } else {
+ channel2 = (SilcChannelEntry)entry;
+ printformat_module("fe-common/silc", server, channel->channel_name,
+ MSGLEVEL_MODES, SILCTXT_CHANNEL_CMODE,
+ channel->channel_name, tmp ? tmp : "removed all",
+ channel2->channel_name);
}
silc_free(tmp);
SILC_LOG_DEBUG(("Notify: CUMODE_CHANGE"));
- client_entry = va_arg(va, SilcClientEntry);
+ idtype = va_arg(va, int);
+ entry = va_arg(va, void *);
mode = va_arg(va, SilcUInt32);
client_entry2 = va_arg(va, SilcClientEntry);
channel = va_arg(va, SilcChannelEntry);
-
+
tmp = silc_client_chumode(mode);
chanrec = silc_channel_find_entry(server, channel);
if (chanrec != NULL) {
SILC_NICK_REC *nick;
-
+
if (client_entry2 == server->conn->local_entry)
chanrec->chanop = (mode & SILC_CHANNEL_UMODE_CHANOP) != 0;
signal_emit("nick mode changed", 2, chanrec, nick);
}
}
-
- printformat_module("fe-common/silc", server, channel->channel_name,
- MSGLEVEL_MODES, SILCTXT_CHANNEL_CUMODE,
- channel->channel_name, client_entry2->nickname,
- tmp ? tmp : "removed all",
- client_entry->nickname);
+
+ if (idtype == SILC_ID_CLIENT) {
+ client_entry = (SilcClientEntry)entry;
+ printformat_module("fe-common/silc", server, channel->channel_name,
+ MSGLEVEL_MODES, SILCTXT_CHANNEL_CUMODE,
+ channel->channel_name, client_entry2->nickname,
+ tmp ? tmp : "removed all",
+ client_entry->nickname);
+ } else if (idtype == SILC_ID_SERVER) {
+ server_entry = (SilcServerEntry)entry;
+ printformat_module("fe-common/silc", server, channel->channel_name,
+ MSGLEVEL_MODES, SILCTXT_CHANNEL_CUMODE,
+ channel->channel_name, client_entry2->nickname,
+ tmp ? tmp : "removed all",
+ server_entry->server_name);
+ } else {
+ channel2 = (SilcChannelEntry)entry;
+ printformat_module("fe-common/silc", server, channel->channel_name,
+ MSGLEVEL_MODES, SILCTXT_CHANNEL_CUMODE,
+ channel->channel_name, client_entry2->nickname,
+ tmp ? tmp : "removed all",
+ channel2->channel_name);
+ }
if (mode & SILC_CHANNEL_UMODE_CHANFO)
printformat_module("fe-common/silc",
server, channel->channel_name, MSGLEVEL_CRAP,
SILCTXT_CHANNEL_FOUNDER,
channel->channel_name, client_entry2->nickname);
-
+
silc_free(tmp);
break;
if (client_entry == conn->local_entry) {
printformat_module("fe-common/silc", server, channel->channel_name,
MSGLEVEL_CRAP, SILCTXT_CHANNEL_KICKED_YOU,
- channel->channel_name, client_entry2->nickname,
+ channel->channel_name,
+ client_entry ? client_entry2->nickname : "",
tmp ? tmp : "");
if (chanrec) {
chanrec->kicked = TRUE;
printformat_module("fe-common/silc", server, channel->channel_name,
MSGLEVEL_CRAP, SILCTXT_CHANNEL_KICKED,
client_entry->nickname, channel->channel_name,
- client_entry2->nickname, tmp ? tmp : "");
+ client_entry2 ? client_entry2->nickname : "",
+ tmp ? tmp : "");
if (chanrec) {
SILC_NICK_REC *nickrec = silc_nicklist_find(chanrec, client_entry);
}
break;
+ case SILC_NOTIFY_TYPE_CHANNEL_CHANGE:
+ break;
+
case SILC_NOTIFY_TYPE_SERVER_SIGNOFF:
{
/*
SILC_LOG_DEBUG(("Start"));
+ if (!server || server->connection_lost)
+ return;
+
if (server->conn && server->conn->local_entry) {
nicklist_rename_unique(SERVER(server),
server->conn->local_entry, server->nick,
silc_argument_get_arg_type(silc_command_get_args(cmd_payload),
2, &tmp_len);
if (tmp) {
- SilcClientID *client_id = silc_id_payload_parse_id(tmp, tmp_len);
+ SilcClientID *client_id = silc_id_payload_parse_id(tmp, tmp_len,
+ NULL);
if (client_id) {
client_entry = silc_client_get_client_by_id(client, conn,
client_id);
silc_argument_get_arg_type(silc_command_get_args(cmd_payload),
2, &tmp_len);
if (tmp) {
- SilcClientID *client_id = silc_id_payload_parse_id(tmp, tmp_len);
+ SilcClientID *client_id = silc_id_payload_parse_id(tmp, tmp_len,
+ NULL);
if (client_id) {
client_entry = silc_client_get_client_by_id(client, conn,
client_id);
MSGLEVEL_CRAP, SILCTXT_ROUTER_OPER);
server->umode = mode;
+ signal_emit("user mode changed", 2, server, NULL);
}
break;
if (!success)
return;
+ server->umode |= SILC_UMODE_SERVER_OPERATOR;
+ signal_emit("user mode changed", 2, server, NULL);
+
printformat_module("fe-common/silc", server, NULL,
MSGLEVEL_CRAP, SILCTXT_SERVER_OPER);
break;
if (!success)
return;
+ server->umode |= SILC_UMODE_ROUTER_OPERATOR;
+ signal_emit("user mode changed", 2, server, NULL);
+
printformat_module("fe-common/silc", server, NULL,
MSGLEVEL_CRAP, SILCTXT_ROUTER_OPER);
break;
if (!name) {
snprintf(file, sizeof(file) - 1, "%skey_%s_%d.pub", entity,
conn->sock->ip, conn->sock->port);
- snprintf(filename, sizeof(filename) - 1, "%s/.silc/%skeys/%s",
- pw->pw_dir, entity, file);
+ snprintf(filename, sizeof(filename) - 1, "%s/%skeys/%s",
+ get_irssi_dir(), entity, file);
snprintf(file, sizeof(file) - 1, "%skey_%s_%d.pub", entity,
conn->sock->hostname, conn->sock->port);
- snprintf(filename2, sizeof(filename2) - 1, "%s/.silc/%skeys/%s",
- pw->pw_dir, entity, file);
+ snprintf(filename2, sizeof(filename2) - 1, "%s/%skeys/%s",
+ get_irssi_dir(), entity, file);
ipf = filename;
hostf = filename2;
} else {
snprintf(file, sizeof(file) - 1, "%skey_%s_%d.pub", entity,
name, conn->sock->port);
- snprintf(filename, sizeof(filename) - 1, "%s/.silc/%skeys/%s",
- pw->pw_dir, entity, file);
+ snprintf(filename, sizeof(filename) - 1, "%s/%skeys/%s",
+ get_irssi_dir(), entity, file);
ipf = filename;
}
fingerprint[i] = '_';
snprintf(file, sizeof(file) - 1, "%skey_%s.pub", entity, fingerprint);
- snprintf(filename, sizeof(filename) - 1, "%s/.silc/%skeys/%s",
- pw->pw_dir, entity, file);
+ snprintf(filename, sizeof(filename) - 1, "%s/%skeys/%s",
+ get_irssi_dir(), entity, file);
silc_free(fingerprint);
ipf = filename;