From 11ae0e5a25d03aafe1322362afec85ccdf724f11 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sat, 26 May 2001 17:57:39 +0000 Subject: [PATCH] updates. --- CHANGES | 9 + apps/irssi/src/fe-common/silc/Makefile.am | 2 + .../irssi/src/fe-common/silc/fe-common-silc.c | 39 ++-- .../irssi/src/fe-common/silc/module-formats.c | 215 ++---------------- .../irssi/src/fe-common/silc/module-formats.h | 196 ++-------------- apps/irssi/src/silc/core/Makefile.am | 2 + apps/irssi/src/silc/core/silc-channels.c | 2 +- apps/irssi/src/silc/core/silc-core.c | 34 ++- apps/irssi/src/silc/core/silc-servers.c | 2 - lib/silcske/silcske.c | 28 +-- 10 files changed, 124 insertions(+), 405 deletions(-) diff --git a/CHANGES b/CHANGES index df4adf93..cde90157 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,12 @@ +Sat May 26 17:43:42 EEST 2001 Pekka Riikonen + + * Fixed channel joining notify handling, cumode notify handling + from Irssi SILC client. + + * Added SILC specific module-formats to the Irssi SILC client so + that SILC specific message hilighting, colors etc is possible. + Affected file irssi/src/fe-common/silc/module-formats.[ch]. + Sat May 26 12:13:37 EEST 2001 Pekka Riikonen * Changed the ask_passphrase client operation to be ascynchronous. diff --git a/apps/irssi/src/fe-common/silc/Makefile.am b/apps/irssi/src/fe-common/silc/Makefile.am index 74efdc41..6eb7757b 100644 --- a/apps/irssi/src/fe-common/silc/Makefile.am +++ b/apps/irssi/src/fe-common/silc/Makefile.am @@ -8,6 +8,7 @@ INCLUDES = \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ -I$(IRSSI_INCLUDE) -I$(IRSSI_INCLUDE)/src \ -I$(IRSSI_INCLUDE)/src/core \ + -I$(IRSSI_INCLUDE)/src/fe-common/core \ -I$(IRSSI_INCLUDE)/src/silc \ -I$(IRSSI_INCLUDE)/src/silc/core \ -I$(SILC_INCLUDE)/includes \ @@ -26,6 +27,7 @@ noinst_LIBRARIES = libfe_common_silc.a libfe_common_silc_a_SOURCES = \ fe-channels.c \ fe-common-silc.c \ + module-formats.c \ silc-modules.c noinst_HEADERS = \ diff --git a/apps/irssi/src/fe-common/silc/fe-common-silc.c b/apps/irssi/src/fe-common/silc/fe-common-silc.c index c779caee..0d7b8cc7 100644 --- a/apps/irssi/src/fe-common/silc/fe-common-silc.c +++ b/apps/irssi/src/fe-common/silc/fe-common-silc.c @@ -1,25 +1,27 @@ /* - fe-common-silc.c : irssi - Copyright (C) 2000 Timo Sirainen + fe-common-silc.c - 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; either version 2 of the License, or - (at your option) any later version. + Author: Pekka Riikonen - 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. + Copyright (C) 2001 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; either version 2 of the License, or + (at your option) any later version. + + 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. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "module.h" +#include "module-formats.h" #include "signals.h" +#include "themes.h" void fe_silc_channels_init(void); void fe_silc_channels_deinit(void); @@ -29,15 +31,18 @@ void fe_silc_modules_deinit(void); void fe_common_silc_init(void) { - fe_silc_channels_init(); - fe_silc_modules_init(); + theme_register(fecommon_silc_formats); + + fe_silc_channels_init(); + fe_silc_modules_init(); } void fe_common_silc_deinit(void) { - fe_silc_modules_deinit(); + fe_silc_modules_deinit(); + fe_silc_channels_deinit(); - fe_silc_channels_deinit(); + theme_unregister(); } void fe_common_silc_finish_init(void) diff --git a/apps/irssi/src/fe-common/silc/module-formats.c b/apps/irssi/src/fe-common/silc/module-formats.c index 2b30bffe..25ae7a86 100644 --- a/apps/irssi/src/fe-common/silc/module-formats.c +++ b/apps/irssi/src/fe-common/silc/module-formats.c @@ -1,211 +1,36 @@ /* - module-formats.c : irssi - Copyright (C) 2000 Timo Sirainen + modules-formats.c - 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; either version 2 of the License, or - (at your option) any later version. + Author: Pekka Riikonen - 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. + Copyright (C) 2001 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; either version 2 of the License, or + (at your option) any later version. + + 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. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "module.h" +#include "fe-common/core/formats.h" #include "printtext.h" -FORMAT_REC fecommon_irc_formats[] = { - { MODULE_NAME, "IRC", 0 }, - - /* ---- */ - { NULL, "Server", 0 }, - - { "lag_disconnected", "No PONG reply from server %_$0%_ in $1 seconds, disconnecting", 2, { 0, 1 } }, - { "disconnected", "Disconnected from %_$0%_ %K[%n$1%K]", 2, { 0, 0 } }, - { "server_list", "%_$0%_: $1:$2 ($3)", 5, { 0, 0, 1, 0, 0 } }, - { "server_lookup_list", "%_$0%_: $1:$2 ($3) (connecting...)", 5, { 0, 0, 1, 0, 0 } }, - { "server_reconnect_list", "%_$0%_: $1:$2 ($3) ($5 left before reconnecting)", 6, { 0, 0, 1, 0, 0, 0 } }, - { "server_reconnect_removed", "Removed reconnection to server %_$0%_ port %_$1%_", 3, { 0, 1, 0 } }, - { "server_reconnect_not_found", "Reconnection tag %_$0%_ not found", 1, { 0 } }, - { "query_server_changed", "Query with %_$2%_ changed to server %_$1%_", 3, { 0, 0, 0 } }, - { "setupserver_added", "Server $0 saved", 2, { 0, 1 } }, - { "setupserver_removed", "Server $0 removed", 2, { 0, 1 } }, - { "setupserver_not_found", "Server $0 not found", 2, { 0, 1 } }, - { "setupserver_header", "Server Port IRC Net Settings", 0 }, - { "setupserver_line", "%|$[!20]0 $[5]1 $[10]2 $3", 4, { 0, 1, 0, 0 } }, - { "setupserver_footer", "", 0 }, - { "netsplit", "%RNetsplit%n %_$0%_ %_$1%_ quits: $2", 3, { 0, 0, 0 } }, - { "netsplit_more", "%RNetsplit%n %_$0%_ %_$1%_ quits: $2 (+$3 more, use /NETSPLIT to show all of them)", 4, { 0, 0, 0, 1 } }, - { "netsplit_join", "%CNetsplit%n over, joins: $0", 1, { 0 } }, - { "netsplit_join_more", "%CNetsplit%n over, joins: $0 (+$1 more)", 2, { 0, 1 } }, - { "no_netsplits", "There are no net splits", 0 }, - { "netsplits_header", "Nick Channel Server Splitted server", 0 }, - { "netsplits_line", "$[9]0 $[10]1 $[20]2 $3", 4, { 0, 0, 0, 0 } }, - { "netsplits_footer", "", 0 }, - { "ircnet_added", "Ircnet $0 saved", 1, { 0 } }, - { "ircnet_removed", "Ircnet $0 removed", 1, { 0 } }, - { "ircnet_not_found", "Ircnet $0 not found", 1, { 0 } }, - { "ircnet_header", "Ircnets:", 0 }, - { "ircnet_line", "$0: $1", 2, { 0, 0 } }, - { "ircnet_footer", "", 0 }, - - /* ---- */ - { NULL, "Channels", 0 }, - - { "join", "%c%_$0%_ %K[%c$1%K]%n has joined %_$2", 3, { 0, 0, 0 } }, - { "part", "%c$0 %K[%n$1%K]%n has left %_$2%_ %K[%n$3%K]", 4, { 0, 0, 0, 0 } }, - { "joinerror_toomany", "Cannot join to channel %_$0%_ %K(%nYou have joined to too many channels%K)", 1, { 0 } }, - { "joinerror_full", "Cannot join to channel %_$0%_ %K(%nChannel is full%K)", 1, { 0 } }, - { "joinerror_invite", "Cannot join to channel %_$0%_ %K(%nYou must be invited%K)", 1, { 0 } }, - { "joinerror_banned", "Cannot join to channel %_$0%_ %K(%nYou are banned%K)", 1, { 0 } }, - { "joinerror_bad_key", "Cannot join to channel %_$0%_ %K(%nBad channel key%K)", 1, { 0 } }, - { "joinerror_bad_mask", "Cannot join to channel %_$0%_ %K(%nBad channel mask%K)", 1, { 0 } }, - { "joinerror_unavail", "Cannot join to channel %_$0%_ %K(%nChannel is temporarily unavailable%K)", 1, { 0 } }, - { "kick", "%c$0%n was kicked from %_$1%_ by %_$2%_ %K[%n$3%K]", 4, { 0, 0, 0, 0 } }, - { "quit", "%c$0 %K[%n$1%K]%n has quit IRC %K[%n$2%K]", 3, { 0, 0, 0 } }, - { "quit_once", "%_$3%_ %c$0 %K[%n$1%K]%n has quit IRC %K[%n$2%K]", 4, { 0, 0, 0, 0 } }, - { "invite", "%_$0%_ invites you to %_$1", 2, { 0, 0 } }, - { "inviting", "Inviting $0 to %_$1", 2, { 0, 0 } }, - { "not_invited", "You have not been invited to a channel!", 0 }, - { "names", "%K[%g%_Users%_%K(%g$0%K)]%n $1", 2, { 0, 0 } }, - { "names_nick", "%K[%n%_$0%_$1%K] ", 2, { 0, 0 } }, - { "endofnames", "%g%_$0%_%K:%n Total of %_$1%_ nicks %K[%n%_$2%_ ops, %_$3%_ voices, %_$4%_ normal%K]", 5, { 0, 1, 1, 1, 1 } }, - { "channel_created", "Channel %_$0%_ created $1", 2, { 0, 0 } }, - { "topic", "Topic for %c$0%K:%n $1", 2, { 0, 0 } }, - { "no_topic", "No topic set for %c$0", 1, { 0 } }, - { "new_topic", "%_$0%_ changed the topic of %c$1%n to%K:%n $2", 3, { 0, 0, 0 } }, - { "topic_unset", "Topic unset by %_$0%_ on %c$1", 2, { 0, 0 } }, - { "topic_info", "Topic set by %_$0%_ %K[%n$1%K]", 2, { 0, 0 } }, - { "chanmode_change", "mode/%c$0 %K[%n$1%K]%n by %_$2", 3, { 0, 0, 0 } }, - { "server_chanmode_change", "%RServerMode/%c$0 %K[%n$1%K]%n by %_$2", 3, { 0, 0, 0 } }, - { "channel_mode", "mode/%c$0 %K[%n$1%K]", 2, { 0, 0 } }, - { "bantype", "Ban type changed to %_$0", 1, { 0 } }, - { "no_bans", "No bans in channel %_$0%_", 1, { 0 } }, - { "banlist", "%_$0%_: ban %c$1", 2, { 0, 0 } }, - { "banlist_long", "%_$0%_: ban %c$1 %K[%nby %_$2%_, $3 secs ago%K]", 4, { 0, 0, 0, 1 } }, - { "ebanlist", "%_$0%_: ban exception %c$1", 2, { 0, 0 } }, - { "ebanlist_long", "%_$0%_: ban exception %c$1 %K[%nby %_$2%_, $3 secs ago%K]", 4, { 0, 0, 0, 1 } }, - { "invitelist", "%_$0%_: invite %c$1", 2, { 0, 0 } }, - { "no_such_channel", "$0: No such channel", 1, { 0 } }, - { "channel_synced", "Join to %_$0%_ was synced in %_$1%_ secs", 2, { 0, 2 } }, - { "not_in_channels", "You are not on any channels", 0 }, - { "current_channel", "Current channel $0", 1, { 0 } }, - { "chanlist_header", "You are on the following channels:", 0 }, - { "chanlist_line", "$[-10]0 %|+$1 ($2): $3", 4, { 0, 0, 0, 0 } }, - { "chansetup_not_found", "Channel $0 not found", 2, { 0, 0 } }, - { "chansetup_added", "Channel $0 saved", 2, { 0, 0 } }, - { "chansetup_removed", "Channel $0 removed", 2, { 0, 0 } }, - { "chansetup_header", "Channel IRC net Password Settings", 0 }, - { "chansetup_line", "$[15]0 %|$[10]1 $[10]2 $3", 4, { 0, 0, 0, 0 } }, - { "chansetup_footer", "", 0 }, - - /* ---- */ - { NULL, "Nick", 0 }, - - { "usermode_change", "Mode change %K[%n%_$0%_%K]%n for user %c$1", 2, { 0, 0 } }, - { "user_mode", "Your user mode is %K[%n%_$0%_%K]", 1, { 0 } }, - { "away", "You have been marked as being away", 0 }, - { "unaway", "You are no longer marked as being away", 0 }, - { "nick_away", "$0 is away: $1", 2, { 0, 0 } }, - { "no_such_nick", "$0: No such nick/channel", 1, { 0 } }, - { "your_nick", "Your nickname is $0", 1, { 0 } }, - { "your_nick_changed", "You're now known as %c$0", 1, { 0 } }, - { "nick_changed", "%_$0%_ is now known as %c$1", 2, { 0, 0 } }, - { "nick_in_use", "Nick %_$0%_ is already in use", 1, { 0 } }, - { "nick_unavailable", "Nick %_$0%_ is temporarily unavailable", 1, { 0 } }, - { "your_nick_owned", "Your nick is owned by %_$3%_ %K[%n$1@$2%K]", 4, { 0, 0, 0, 0 } }, - - /* ---- */ - { NULL, "Who queries", 0 }, - - { "whois", "%_$0%_ %K[%n$1@$2%K]%n%: ircname : $3", 4, { 0, 0, 0, 0 } }, - { "whowas", "%_$0%_ %K[%n$1@$2%K]%n%: ircname : $3", 4, { 0, 0, 0, 0 } }, - { "whois_idle", " idle : $1 days $2 hours $3 mins $4 secs", 5, { 0, 1, 1, 1, 1 } }, - { "whois_idle_signon", " idle : $1 days $2 hours $3 mins $4 secs %K[%nsignon: $5%K]", 6, { 0, 1, 1, 1, 1, 0 } }, - { "whois_server", " server : $1 %K[%n$2%K]", 3, { 0, 0, 0 } }, - { "whois_oper", " : %_IRC operator%_", 1, { 0 } }, - { "whois_registered", " : has registered this nick", 1, { 0 } }, - { "whois_channels", " channels : $1", 2, { 0, 0 } }, - { "whois_away", " away : $1", 2, { 0, 0 } }, - { "end_of_whois", "End of WHOIS", 1, { 0 } }, - { "end_of_whowas", "End of WHOWAS", 1, { 0 } }, - { "whois_not_found", "There is no such nick $0", 1, { 0 } }, - { "who", "$[-10]0 %|%_$[!9]1%_ $[!3]2 $[!2]3 $4@$5 %K(%W$6%K)", 7, { 0, 0, 0, 0, 0, 0, 0 } }, - { "end_of_who", "End of /WHO list", 1, { 0 } }, - - /* ---- */ - { NULL, "Your messages", 0 }, - - { "own_msg", "%K<%n$2%W$0%K>%n %|$1", 3, { 0, 0, 0 } }, - { "own_msg_channel", "%K<%n$3%W$0%K:%c$1%K>%n %|$2", 4, { 0, 0, 0, 0 } }, - { "own_msg_private", "%K[%rmsg%K(%R$0%K)]%n $1", 2, { 0, 0 } }, - { "own_msg_private_query", "%K<%W$2%K>%n %|$1", 3, { 0, 0, 0 } }, - { "own_notice", "%K[%rnotice%K(%R$0%K)]%n $1", 2, { 0, 0 } }, - { "own_me", "%W * $0%n $1", 2, { 0, 0 } }, - { "own_ctcp", "%K[%rctcp%K(%R$0%K)]%n $1 $2", 3, { 0, 0, 0 } }, - { "own_wall", "%K[%WWall%K/%c$0%K]%n $1", 2, { 0, 0 } }, - - /* ---- */ - { NULL, "Received messages", 0 }, - - { "pubmsg_me", "%K<%n$2%Y$0%K>%n %|$1", 3, { 0, 0, 0 } }, - { "pubmsg_me_channel", "%K<%n$3%Y$0%K:%c$1%K>%n %|$2", 4, { 0, 0, 0, 0 } }, - { "pubmsg_hilight", "%K<%n$3$0$1%K>%n %|$2", 4, { 0, 0, 0, 0 } }, - { "pubmsg_hilight_channel", "%K<%n$4$0$1%K:%c$2%K>%n %|$3", 5, { 0, 0, 0, 0, 0 } }, - { "pubmsg", "%K<%n$2$0%K>%n %|$1", 3, { 0, 0, 0 } }, - { "pubmsg_channel", "%K<%n$3$0%K:%c$1%K>%n %|$2", 4, { 0, 0, 0, 0 } }, - { "msg_private", "%K[%R$0%K(%r$1%K)]%n $2", 3, { 0, 0, 0 } }, - { "msg_private_query", "%K<%R$0%K>%n %|$2", 3, { 0, 0, 0 } }, - { "notice_server", "%g!$0%n $1", 2, { 0, 0 } }, - { "notice_public", "%K-%M$0%K:%m$1%K-%n $2", 3, { 0, 0, 0 } }, - { "notice_public_ops", "%K-%M$0%K:%m@$1%K-%n $2", 3, { 0, 0, 0 } }, - { "notice_private", "%K-%M$0%K(%m$1%K)-%n $2", 3, { 0, 0, 0 } }, - { "action_private", "%W (*) $0%n $2", 3, { 0, 0, 0 } }, - { "action_private_query", "%W * $0%n $2", 3, { 0, 0, 0 } }, - { "action_public", "%W * $0%n $1", 2, { 0, 0 } }, - { "action_public_channel", "%W * $0%K:%c$1%n $2", 3, { 0, 0, 0 } }, - - /* ---- */ - { NULL, "CTCPs", 0 }, - - { "ctcp_reply", "CTCP %_$0%_ reply from %_$1%_%K:%n $2", 3, { 0, 0, 0 } }, - { "ctcp_reply_channel", "CTCP %_$0%_ reply from %_$1%_ in channel %_$3%_%K:%n $2", 4, { 0, 0, 0, 0 } }, - { "ctcp_ping_reply", "CTCP %_PING%_ reply from %_$0%_: $1.$2 seconds", 3, { 0, 2, 2 } }, - { "ctcp_requested", "%g>>> %_$0%_ %K[%g$1%K] %grequested %_$2%_ from %_$3", 4, { 0, 0, 0, 0 } }, - - /* ---- */ - { NULL, "Other server events", 0 }, - - { "online", "Users online: %_$0", 1, { 0 } }, - { "pong", "PONG received from $0: $1", 2, { 0, 0 } }, - { "wallops", "%WWALLOP%n $0: $1", 2, { 0, 0 } }, - { "action_wallops", "%WWALLOP * $0%n $1", 2, { 0, 0 } }, - { "error", "%_ERROR%_ $0", 1, { 0 } }, - { "unknown_mode", "Unknown mode character $0", 1, { 0 } }, - { "not_chanop", "You're not channel operator in $0", 1, { 0 } }, +FORMAT_REC fecommon_silc_formats[] = { + { MODULE_NAME, "SILC", 0 }, /* ---- */ - { NULL, "Misc", 0 }, + { NULL, "Channel", 0 }, - { "ignored", "Ignoring %_$1%_ from %_$0%_", 2, { 0, 0 } }, - { "unignored", "Unignored %_$0%_", 1, { 0 } }, - { "ignore_not_found", "%_$0%_ is not being ignored", 1, { 0 } }, - { "ignore_no_ignores", "There are no ignores", 0 }, - { "ignore_header", "Ignorance List:", 0 }, - { "ignore_line", "$[-4]0 $1: $2 $3 $4", 4, { 1, 0, 0, 0 } }, - { "ignore_footer", "", 0 }, - { "talking_in", "You are now talking in %_$0%_", 1, { 0 } }, - { "query_start", "Starting query with %_$0%_", 1, { 0 } }, - { "no_query", "No query with %_$0%_", 1, { 0 } }, - { "no_msgs_got", "You have not received a message from anyone yet", 0 }, - { "no_msgs_sent", "You have not sent a message to anyone yet", 0 }, + { "channel_founder_you", "You are channel founder on {channel $0}", 1, { 0 } }, + { "channel_founder", "Channel founder on {channel $0} is: {channick_hilight $1}", 2, { 0, 0 } }, + { "channel_topic", "Topic for {channel $0} is: $1", 2, { 0, 0 } }, { NULL, NULL, 0 } }; diff --git a/apps/irssi/src/fe-common/silc/module-formats.h b/apps/irssi/src/fe-common/silc/module-formats.h index aa4c87c3..a61547ee 100644 --- a/apps/irssi/src/fe-common/silc/module-formats.h +++ b/apps/irssi/src/fe-common/silc/module-formats.h @@ -1,181 +1,33 @@ -#include "printtext.h" +/* -enum { - IRCTXT_MODULE_NAME, - - IRCTXT_FILL_1, - - IRCTXT_LAG_DISCONNECTED, - IRCTXT_DISCONNECTED, - IRCTXT_SERVER_LIST, - IRCTXT_SERVER_LOOKUP_LIST, - IRCTXT_SERVER_RECONNECT_LIST, - IRCTXT_RECONNECT_REMOVED, - IRCTXT_RECONNECT_NOT_FOUND, - IRCTXT_QUERY_SERVER_CHANGED, - IRCTXT_SETUPSERVER_ADDED, - IRCTXT_SETUPSERVER_REMOVED, - IRCTXT_SETUPSERVER_NOT_FOUND, - IRCTXT_SETUPSERVER_HEADER, - IRCTXT_SETUPSERVER_LINE, - IRCTXT_SETUPSERVER_FOOTER, - IRCTXT_NETSPLIT, - IRCTXT_NETSPLIT_MORE, - IRCTXT_NETSPLIT_JOIN, - IRCTXT_NETSPLIT_JOIN_MORE, - IRCTXT_NO_NETSPLITS, - IRCTXT_NETSPLITS_HEADER, - IRCTXT_NETSPLITS_LINE, - IRCTXT_NETSPLITS_FOOTER, - IRCTXT_IRCNET_ADDED, - IRCTXT_IRCNET_REMOVED, - IRCTXT_IRCNET_NOT_FOUND, - IRCTXT_IRCNET_HEADER, - IRCTXT_IRCNET_LINE, - IRCTXT_IRCNET_FOOTER, - - IRCTXT_FILL_2, - - IRCTXT_JOIN, - IRCTXT_PART, - IRCTXT_JOINERROR_TOOMANY, - IRCTXT_JOINERROR_FULL, - IRCTXT_JOINERROR_INVITE, - IRCTXT_JOINERROR_BANNED, - IRCTXT_JOINERROR_BAD_KEY, - IRCTXT_JOINERROR_BAD_MASK, - IRCTXT_JOINERROR_UNAVAIL, - IRCTXT_KICK, - IRCTXT_QUIT, - IRCTXT_QUIT_ONCE, - IRCTXT_INVITE, - IRCTXT_INVITING, - IRCTXT_NOT_INVITED, - IRCTXT_NAMES, - IRCTXT_NAMES_NICK, - IRCTXT_ENDOFNAMES, - IRCTXT_CHANNEL_CREATED, - IRCTXT_TOPIC, - IRCTXT_NO_TOPIC, - IRCTXT_NEW_TOPIC, - IRCTXT_TOPIC_UNSET, - IRCTXT_TOPIC_INFO, - IRCTXT_CHANMODE_CHANGE, - IRCTXT_SERVER_CHANMODE_CHANGE, - IRCTXT_CHANNEL_MODE, - IRCTXT_BANTYPE, - IRCTXT_NO_BANS, - IRCTXT_BANLIST, - IRCTXT_BANLIST_LONG, - IRCTXT_EBANLIST, - IRCTXT_EBANLIST_LONG, - IRCTXT_INVITELIST, - IRCTXT_NO_SUCH_CHANNEL, - IRCTXT_CHANNEL_SYNCED, - IRCTXT_NOT_IN_CHANNELS, - IRCTXT_CURRENT_CHANNEL, - IRCTXT_CHANLIST_HEADER, - IRCTXT_CHANLIST_LINE, - IRCTXT_CHANSETUP_NOT_FOUND, - IRCTXT_CHANSETUP_ADDED, - IRCTXT_CHANSETUP_REMOVED, - IRCTXT_CHANSETUP_HEADER, - IRCTXT_CHANSETUP_LINE, - IRCTXT_CHANSETUP_FOOTER, - - IRCTXT_FILL_4, - - IRCTXT_USERMODE_CHANGE, - IRCTXT_USER_MODE, - IRCTXT_AWAY, - IRCTXT_UNAWAY, - IRCTXT_NICK_AWAY, - IRCTXT_NO_SUCH_NICK, - IRCTXT_YOUR_NICK, - IRCTXT_YOUR_NICK_CHANGED, - IRCTXT_NICK_CHANGED, - IRCTXT_NICK_IN_USE, - IRCTXT_NICK_UNAVAILABLE, - IRCTXT_YOUR_NICK_OWNED, + modules-formats.h - IRCTXT_FILL_5, + Author: Pekka Riikonen - IRCTXT_WHOIS, - IRCTXT_WHOWAS, - IRCTXT_WHOIS_IDLE, - IRCTXT_WHOIS_IDLE_SIGNON, - IRCTXT_WHOIS_SERVER, - IRCTXT_WHOIS_OPER, - IRCTXT_WHOIS_REGISTERED, - IRCTXT_WHOIS_CHANNELS, - IRCTXT_WHOIS_AWAY, - IRCTXT_END_OF_WHOIS, - IRCTXT_END_OF_WHOWAS, - IRCTXT_WHOIS_NOT_FOUND, - IRCTXT_WHO, - IRCTXT_END_OF_WHO, + Copyright (C) 2001 Pekka Riikonen - IRCTXT_FILL_6, + 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; either version 2 of the License, or + (at your option) any later version. + + 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. - IRCTXT_OWN_MSG, - IRCTXT_OWN_MSG_CHANNEL, - IRCTXT_OWN_MSG_PRIVATE, - IRCTXT_OWN_MSG_PRIVATE_QUERY, - IRCTXT_OWN_NOTICE, - IRCTXT_OWN_ME, - IRCTXT_OWN_CTCP, - IRCTXT_OWN_WALL, - - IRCTXT_FILL_7, +*/ - IRCTXT_PUBMSG_ME, - IRCTXT_PUBMSG_ME_CHANNEL, - IRCTXT_PUBMSG_HILIGHT, - IRCTXT_PUBMSG_HILIGHT_CHANNEL, - IRCTXT_PUBMSG, - IRCTXT_PUBMSG_CHANNEL, - IRCTXT_MSG_PRIVATE, - IRCTXT_MSG_PRIVATE_QUERY, - IRCTXT_NOTICE_SERVER, - IRCTXT_NOTICE_PUBLIC, - IRCTXT_NOTICE_PUBLIC_OPS, - IRCTXT_NOTICE_PRIVATE, - IRCTXT_ACTION_PRIVATE, - IRCTXT_ACTION_PRIVATE_QUERY, - IRCTXT_ACTION_PUBLIC, - IRCTXT_ACTION_PUBLIC_CHANNEL, +#include "fe-common/core/formats.h" - IRCTXT_FILL_8, - - IRCTXT_CTCP_REPLY, - IRCTXT_CTCP_REPLY_CHANNEL, - IRCTXT_CTCP_PING_REPLY, - IRCTXT_CTCP_REQUESTED, - - IRCTXT_FILL_10, - - IRCTXT_ONLINE, - IRCTXT_PONG, - IRCTXT_WALLOPS, - IRCTXT_ACTION_WALLOPS, - IRCTXT_ERROR, - IRCTXT_UNKNOWN_MODE, - IRCTXT_NOT_CHANOP, - - IRCTXT_FILL_11, - - IRCTXT_IGNORED, - IRCTXT_UNIGNORED, - IRCTXT_IGNORE_NOT_FOUND, - IRCTXT_IGNORE_NO_IGNORES, - IRCTXT_IGNORE_HEADER, - IRCTXT_IGNORE_LINE, - IRCTXT_IGNORE_FOOTER, - IRCTXT_TALKING_IN, - IRCTXT_QUERY_STARTED, - IRCTXT_NO_QUERY, - IRCTXT_NO_MSGS_GOT, - IRCTXT_NO_MSGS_SENT +enum { + SILCTXT_MODULE_NAME, + + SILCTXT_FILL_1, + + SILCTXT_CHANNEL_FOUNDER_YOU, + SILCTXT_CHANNEL_FOUNDER, + SILCTXT_CHANNEL_TOPIC, }; -extern FORMAT_REC fecommon_irc_formats[]; +extern FORMAT_REC fecommon_silc_formats[]; diff --git a/apps/irssi/src/silc/core/Makefile.am b/apps/irssi/src/silc/core/Makefile.am index 5de213a0..387d87fe 100644 --- a/apps/irssi/src/silc/core/Makefile.am +++ b/apps/irssi/src/silc/core/Makefile.am @@ -8,6 +8,8 @@ INCLUDES = \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ -I$(IRSSI_INCLUDE) -I$(IRSSI_INCLUDE)/src \ -I$(IRSSI_INCLUDE)/src/core \ + -I$(IRSSI_INCLUDE)/src/fe-common/core \ + -I$(IRSSI_INCLUDE)/src/fe-common/silc \ -I$(SILC_INCLUDE)/includes \ -I$(SILC_INCLUDE)/lib/silccore \ -I$(SILC_INCLUDE)/lib/silccrypt \ diff --git a/apps/irssi/src/silc/core/silc-channels.c b/apps/irssi/src/silc/core/silc-channels.c index 940d8712..3f99c37d 100644 --- a/apps/irssi/src/silc/core/silc-channels.c +++ b/apps/irssi/src/silc/core/silc-channels.c @@ -328,7 +328,7 @@ static void event_cumode(SILC_SERVER_REC *server, va_list va) (mode & SILC_CHANNEL_UMODE_CHANOP) != 0; } - nick = silc_nicklist_find(chanrec, client); + nick = silc_nicklist_find(chanrec, destclient); if (nick != NULL) { nick->op = (mode & SILC_CHANNEL_UMODE_CHANOP) != 0; signal_emit("nick mode changed", 2, chanrec, nick); diff --git a/apps/irssi/src/silc/core/silc-core.c b/apps/irssi/src/silc/core/silc-core.c index 0ef7af68..8448245f 100644 --- a/apps/irssi/src/silc/core/silc-core.c +++ b/apps/irssi/src/silc/core/silc-core.c @@ -38,6 +38,7 @@ #include "fe-common/core/printtext.h" #include "fe-common/core/fe-channels.h" #include "fe-common/core/keyboard.h" +#include "fe-common/silc/module-formats.h" /* Command line option variables */ static bool opt_create_keypair = FALSE; @@ -121,7 +122,7 @@ static void silc_say(SilcClient client, SilcClientConnection conn, va_start(va, msg); str = g_strdup_vprintf(msg, va); - printtext(server, "#silc", MSGLEVEL_CRAP, "%s", str); + printtext(server, NULL, MSGLEVEL_CRAP, "%s", str); g_free(str); va_end(va); } @@ -302,23 +303,46 @@ void silc_client_join_get_users(SilcClient client, SilcChannelUser chu; SILC_SERVER_REC *server = conn->context; SILC_CHANNEL_REC *chanrec; + SilcClientEntry founder = NULL; NICK_REC *ownnick; if (!clients) return; - chanrec = silc_channel_find_entry(server, channel); + chanrec = silc_channel_find(server, channel->channel_name); if (chanrec == NULL) return; silc_list_start(channel->clients); - while ((chu = silc_list_get(channel->clients)) != SILC_LIST_END) + while ((chu = silc_list_get(channel->clients)) != SILC_LIST_END) { + if (chu->mode & SILC_CHANNEL_UMODE_CHANFO) + founder = chu->client; silc_nicklist_insert(chanrec, chu, FALSE); + } ownnick = NICK(silc_nicklist_find(chanrec, conn->local_entry)); nicklist_set_own(CHANNEL(chanrec), ownnick); signal_emit("channel joined", 1, chanrec); + + if (chanrec->topic) + printformat_module("fe-common/silc", server, channel->channel_name, + MSGLEVEL_CRAP, SILCTXT_CHANNEL_TOPIC, + channel->channel_name, chanrec->topic); + fe_channels_nicklist(CHANNEL(chanrec), CHANNEL_NICKLIST_FLAG_ALL); + + if (founder) { + if (founder == conn->local_entry) + printformat_module("fe-common/silc", + server, channel->channel_name, MSGLEVEL_CRAP, + SILCTXT_CHANNEL_FOUNDER_YOU, + channel->channel_name); + else + printformat_module("fe-common/silc", + server, channel->channel_name, MSGLEVEL_CRAP, + SILCTXT_CHANNEL_FOUNDER, + channel->channel_name, founder->nickname); + } } /* Command reply handler. This function is called always in the command reply @@ -557,7 +581,6 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, g_free_not_null(chanrec->topic); chanrec->topic = *topic == '\0' ? NULL : g_strdup(topic); signal_emit("channel topic changed", 1, chanrec); - silc_say(client, conn, "Topic for %s: %s", channel, topic); } mode = silc_client_chmode(modei, channel_entry); @@ -1331,6 +1354,9 @@ void silc_core_init_finish(void) silc_log_set_callbacks(silc_log_info, silc_log_warning, silc_log_error, NULL); + /* Do some irssi initializing */ + settings_add_bool("server", "skip_motd", FALSE); + settings_add_str("server", "alternate_nick", NULL); silc_init_userinfo(); /* Allocate SILC client */ diff --git a/apps/irssi/src/silc/core/silc-servers.c b/apps/irssi/src/silc/core/silc-servers.c index 8e908936..062b6049 100644 --- a/apps/irssi/src/silc/core/silc-servers.c +++ b/apps/irssi/src/silc/core/silc-servers.c @@ -327,8 +327,6 @@ void silc_server_init(void) command_bind("getkey", MODULE_NAME, (SIGNAL_FUNC) command_self); command_set_options("connect", "+silcnet"); - - settings_add_bool("server", "skip_motd", FALSE); } void silc_server_deinit(void) diff --git a/lib/silcske/silcske.c b/lib/silcske/silcske.c index 694c2ac8..e95c57e2 100644 --- a/lib/silcske/silcske.c +++ b/lib/silcske/silcske.c @@ -357,19 +357,19 @@ static void silc_ske_initiator_finish_final(SilcSKE ske, return; } - /* Decode the public key */ - if (!silc_pkcs_public_key_decode(payload->pk_data, payload->pk_len, - &public_key)) { - status = SILC_SKE_STATUS_UNSUPPORTED_PUBLIC_KEY; - if (finish->callback) - finish->callback(ske, finish->context); - silc_free(finish); - return; - } + if (payload->pk_data) { + /* Decode the public key */ + if (!silc_pkcs_public_key_decode(payload->pk_data, payload->pk_len, + &public_key)) { + status = SILC_SKE_STATUS_UNSUPPORTED_PUBLIC_KEY; + if (finish->callback) + finish->callback(ske, finish->context); + silc_free(finish); + return; + } - SILC_LOG_DEBUG(("Public key is authentic")); + SILC_LOG_DEBUG(("Public key is authentic")); - if (payload->pk_data) { /* Compute the hash value */ status = silc_ske_make_hash(ske, hash, &hash_len, FALSE); if (status != SILC_SKE_STATUS_OK) @@ -497,13 +497,13 @@ SilcSKEStatus silc_ske_initiator_finish(SilcSKE ske, finish->callback = callback; finish->context = context; - if (verify_key) { + if (payload->pk_data && verify_key) { SILC_LOG_DEBUG(("Verifying public key")); (*verify_key)(ske, payload->pk_data, payload->pk_len, payload->pk_type, verify_context, silc_ske_initiator_finish_final, finish); - + /* We will continue to the final state after the public key has been verified by the caller. */ return SILC_SKE_STATUS_PENDING; @@ -864,7 +864,7 @@ SilcSKEStatus silc_ske_responder_phase_2(SilcSKE ske, return status; } - if (verify_key) { + if (recv_payload->pk_data && verify_key) { SILC_LOG_DEBUG(("Verifying public key")); (*verify_key)(ske, recv_payload->pk_data, recv_payload->pk_len, -- 2.24.0