continue;
}
- silc_channel_create(server, channel, FALSE);
silc_command_exec(server, "JOIN", channel);
g_free(channel);
}
static void event_cmode(SILC_SERVER_REC *server, va_list va)
{
SILC_CHANNEL_REC *chanrec;
+ void *entry;
SilcClientEntry client;
+ SilcServerEntry server_entry;
SilcChannelEntry channel;
char *mode;
uint32 modei;
+ SilcIdType idtype;
- client = va_arg(va, SilcClientEntry);
+ idtype = va_arg(va, int);
+ entry = va_arg(va, void *);
modei = va_arg(va, uint32);
(void)va_arg(va, char *);
(void)va_arg(va, char *);
signal_emit("channel mode changed", 1, chanrec);
}
- printformat_module("fe-common/silc", server, channel->channel_name,
- MSGLEVEL_MODES, SILCTXT_CHANNEL_CMODE,
- channel->channel_name, mode ? mode : "removed all",
- client->nickname);
+ if (idtype == SILC_ID_CLIENT) {
+ client = (SilcClientEntry)entry;
+ printformat_module("fe-common/silc", server, channel->channel_name,
+ MSGLEVEL_MODES, SILCTXT_CHANNEL_CMODE,
+ channel->channel_name, mode ? mode : "removed all",
+ client->nickname);
+ } else {
+ server_entry = (SilcServerEntry)entry;
+ printformat_module("fe-common/silc", server, channel->channel_name,
+ MSGLEVEL_MODES, SILCTXT_CHANNEL_CMODE,
+ channel->channel_name, mode ? mode : "removed all",
+ server_entry->server_name);
+ }
g_free(mode);
}
g_free(tmp);
if (argc < 4) {
- silc_say(silc_client, conn, "Usage: /KEY msg|channel <nickname|channel> "
+ silc_say(silc_client, conn, SILC_CLIENT_MESSAGE_INFO,
+ "Usage: /KEY msg|channel <nickname|channel> "
"set|unset|agreement|negotiate [<arguments>]");
return;
}
type = 2;
if (type == 0) {
- silc_say(silc_client, conn, "Usage: /KEY msg|channel <nickname|channel> "
+ silc_say(silc_client, conn, SILC_CLIENT_MESSAGE_INFO,
+ "Usage: /KEY msg|channel <nickname|channel> "
"set|unset|agreement|negotiate [<arguments>]");
return;
}
else
strcat(buf, "*generated*");
- silc_say(silc_client, conn, "%s", buf);
+ silc_say(silc_client, conn, SILC_CLIENT_MESSAGE_INFO, "%s", buf);
}
} else {
printformat_module("fe-common/silc", server, NULL, MSGLEVEL_CRAP,
else
strcat(buf, "*generated*");
- silc_say(silc_client, conn, "%s", buf);
+ silc_say(silc_client, conn, SILC_CLIENT_MESSAGE_INFO, "%s", buf);
}
}
strcat(buf, "<hidden>");
- silc_say(silc_client, conn, "%s", buf);
+ silc_say(silc_client, conn, SILC_CLIENT_MESSAGE_INFO, "%s", buf);
}
silc_client_free_channel_private_keys(keys, keys_count);
}
if (command == 0) {
- silc_say(silc_client, conn, "Usage: /KEY msg|channel <nickname|channel> "
+ silc_say(silc_client, conn, SILC_CLIENT_MESSAGE_INFO,
+ "Usage: /KEY msg|channel <nickname|channel> "
"set|unset|agreement|negotiate [<arguments>]");
goto out;
}
silc_free(serv);
}
+/* Lists locally saved client and server public keys. */
+
+static void command_listkeys(const char *data, SILC_SERVER_REC *server,
+ WI_ITEM_REC *item)
+{
+
+}
+
void silc_channels_init(void)
{
signal_add("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed);
command_bind("notice", MODULE_NAME, (SIGNAL_FUNC) command_notice);
command_bind("away", MODULE_NAME, (SIGNAL_FUNC) command_away);
command_bind("key", MODULE_NAME, (SIGNAL_FUNC) command_key);
+ command_bind("listkeys", MODULE_NAME, (SIGNAL_FUNC) command_listkeys);
silc_nicklist_init();
}
command_unbind("notice", (SIGNAL_FUNC) command_notice);
command_unbind("away", (SIGNAL_FUNC) command_away);
command_unbind("key", (SIGNAL_FUNC) command_key);
+ command_unbind("listkeys", (SIGNAL_FUNC) command_listkeys);
silc_nicklist_deinit();
}