update stuff on statusbar.
+Fri Mar 8 17:16:41 EET 2002 Pekka Riikonen <priikone@silcnet.org>
+
+ * Fixed the USERS command reply to save the user's mode on the
+ channel as well. Fixed JOIN command reply to check whether a
+ client is on channel already and not join it twice. Affected
+ file lib/silcclient/command_reply.c.
+
+ * Added new file silc-expandos.c into irssi/silc/core/ to return
+ various stuff for various signal for the statusbar etc. updating.
+ Now Irssi SILC client prints channel user modes etc. on the
+ statusbar.
+
Thu Mar 7 19:21:22 EET 2002 Pekka Riikonen <priikone@silcnet.org>
* Changed silc_mutex_[un]lock calls in lib/silcutil/silcschedule.c
TODO/bugs in Irssi SILC client
==============================
- o /USERS does not show the user modes on the channel correctly.
-
o Fix the silc_channels_join to parse the command like, with fe.
silc_parse_command_line, because currently it ignores all options,
including passphrase which makes autojoin impossible to +a channels.
silc-nicklist.c \
silc-queries.c \
silc-servers.c \
+ silc-expandos.c \
silc-servers-reconnect.c
noinst_HEADERS = \
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,
server, channel->channel_name, MSGLEVEL_CRAP,
SILCTXT_CHANNEL_FOUNDER,
channel->channel_name, client_entry2->nickname);
-
+
silc_free(tmp);
break;
SilcUInt32 sims_count = 0;
#endif
+void silc_expandos_init(void);
+void silc_expandos_deinit(void);
+
static int my_silc_scheduler(void)
{
silc_client_run_one(silc_client);
silc_pkcs_register_default();
silc_hash_register_default();
silc_hmac_register_default();
- silc_client_show_key(arg);
+ silc_client_show_key((char *)arg);
exit(0);
}
silc_server_init();
silc_channels_init();
silc_queries_init();
+ silc_expandos_init();
idletag = g_timeout_add(5, (GSourceFunc) my_silc_scheduler, NULL);
silc_server_deinit();
silc_channels_deinit();
silc_queries_deinit();
+ silc_expandos_deinit();
chat_protocol_unregister("SILC");
--- /dev/null
+/*
+
+ silc-expandos.c
+
+ Author: Pekka Riikonen <priikone@silcnet.org>
+
+ Copyright (C) 2002 Pekka Riikonen
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+*/
+
+#include "module.h"
+#include "misc.h"
+#include "expandos.h"
+#include "settings.h"
+
+#include "chatnets.h"
+#include "servers-setup.h"
+#include "channels-setup.h"
+#include "silc-servers.h"
+#include "silc-channels.h"
+#include "silc-queries.h"
+#include "silc-nicklist.h"
+
+/* User mode in active server */
+
+static char *expando_usermode(SERVER_REC *server, void *item, int *free_ret)
+{
+ return "";
+}
+
+/* Expands to your usermode on channel */
+
+static char *expando_cumode(SERVER_REC *server, void *item, int *free_ret)
+{
+ if (IS_CHANNEL(item) && CHANNEL(item)->ownnick) {
+ SILC_NICK_REC *nick = (SILC_NICK_REC *)CHANNEL(item)->ownnick;
+ return (nick->op && nick->founder) ? "*@" :
+ nick->op ? "@" : nick->founder ? "*" : "";
+ }
+
+ return "";
+}
+
+static char *expando_cumode_space(SERVER_REC *server, void *item,
+ int *free_ret)
+{
+ char *ret = expando_cumode(server, item, free_ret);
+ return *ret == '\0' ? " " : ret;
+}
+
+void silc_expandos_init(void)
+{
+ expando_create("usermode", expando_usermode,
+ "window changed", EXPANDO_ARG_NONE,
+ "window server changed", EXPANDO_ARG_WINDOW,
+ "user mode changed", EXPANDO_ARG_SERVER, NULL);
+ expando_create("cumode", expando_cumode,
+ "window changed", EXPANDO_ARG_NONE,
+ "window item changed", EXPANDO_ARG_WINDOW,
+ "nick mode changed", EXPANDO_ARG_WINDOW_ITEM, NULL);
+ expando_create("cumode_space", expando_cumode_space,
+ "window changed", EXPANDO_ARG_NONE,
+ "window item changed", EXPANDO_ARG_WINDOW,
+ "nick mode changed", EXPANDO_ARG_WINDOW_ITEM, NULL);
+}
+
+void silc_expandos_deinit(void)
+{
+ expando_destroy("usermode", expando_usermode);
+ expando_destroy("cumode", expando_cumode);
+ expando_destroy("cumode_space", expando_cumode_space);
+}
}
/* Join client to the channel */
- chu = silc_calloc(1, sizeof(*chu));
- chu->client = client_entry;
- chu->channel = channel;
- chu->mode = mode;
- silc_hash_table_add(channel->user_list, client_entry, chu);
- silc_hash_table_add(client_entry->channels, channel, chu);
+ if (!silc_client_on_channel(channel, client_entry)) {
+ chu = silc_calloc(1, sizeof(*chu));
+ chu->client = client_entry;
+ chu->channel = channel;
+ chu->mode = mode;
+ silc_hash_table_add(channel->user_list, client_entry, chu);
+ silc_hash_table_add(client_entry->channels, channel, chu);
+ }
silc_free(client_id);
silc_buffer_pull(client_id_list, idp_len);
if (!silc_client_on_channel(channel, client_entry)) {
chu = silc_calloc(1, sizeof(*chu));
chu->client = client_entry;
+ chu->mode = mode;
chu->channel = channel;
silc_hash_table_add(channel->user_list, client_entry, chu);
silc_hash_table_add(client_entry->channels, channel, chu);