+Tue Oct 3 21:22:00 CEST 2006 Jochen Eisinger <coffee@silcnet.org>
+
+ * When joining channels with a password given in the config file,
+ use it. Also use it when cycling (it would be better to get
+ the password from the server, but this isn't possible in SILC).
+ Affected files apps/irssi/src/silc/core/silc-servers.c,
+ apps/irssi/src/silc/core/silc-channels.c
+
Sun Oct 1 20:39:34 CEST 2006 Jochen Eisinger <coffee@silcnet.org>
* Always return a valid username. Affected file
const char *channels, int automatic)
{
char **list, **tmp;
+ char *channel, *key;
SILC_CHANNEL_REC *chanrec;
+ CHANNEL_SETUP_REC *schannel;
+ GString *tmpstr;
list = g_strsplit(channels, ",", -1);
for (tmp = list; *tmp != NULL; tmp++) {
if (chanrec)
continue;
- silc_command_exec(server, "JOIN", *tmp);
+ channel = *tmp;
+ key = strchr(channel, ' ');
+ if (key != NULL) {
+ *key = '\0';
+ key++;
+ }
+ tmpstr = g_string_new(NULL);
+
+ schannel = channel_setup_find(channel, server->connrec->chatnet);
+ if (key && *key != '\0')
+ g_string_sprintfa(tmpstr, "%s %s", channel, key);
+ else if (schannel->password && schannel->password[0] != '\0')
+ g_string_sprintfa(tmpstr, "%s %s", channel, schannel->password);
+ else
+ g_string_sprintfa(tmpstr, "%s", channel);
+
+ silc_command_exec(server, "JOIN", tmpstr->str);
+
+ g_string_free(tmpstr, FALSE);
}
g_strfreev(list);
#include "settings.h"
#include "servers-setup.h"
+#include "channels-setup.h"
#include "client_ops.h"
#include "silc-servers.h"
chans = g_string_new(NULL);
for (tmp = server->channels; tmp != NULL; tmp = tmp->next) {
CHANNEL_REC *channel = tmp->data;
-
- g_string_sprintfa(chans, "%s,", channel->name);
+ CHANNEL_SETUP_REC *schannel;
+
+ if ((schannel = channel_setup_find(channel->name, server->connrec->chatnet)) &&
+ schannel->password)
+ g_string_sprintfa(chans, "%s %s,", channel->name,
+ schannel->password);
+ else
+ g_string_sprintfa(chans, "%s,", channel->name);
}
if (chans->len > 0)