summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-05-17 15:22:05 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-05-17 15:22:05 +0000
commit3ecf864f18fad9a1d3b2cf6e094bc0512c3407d4 (patch)
tree49683fadc73ea0f3d58fe200f9ad7cdf808d4a17 /src/irc
parentede752530eeae6136b1891f0fdebdea24ebde552 (diff)
downloadirssi-3ecf864f18fad9a1d3b2cf6e094bc0512c3407d4.zip
!channel fixes.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2803 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/core/channel-events.c10
-rw-r--r--src/irc/core/irc-channels.c5
2 files changed, 12 insertions, 3 deletions
diff --git a/src/irc/core/channel-events.c b/src/irc/core/channel-events.c
index 02fe0242..6b474097 100644
--- a/src/irc/core/channel-events.c
+++ b/src/irc/core/channel-events.c
@@ -236,8 +236,18 @@ static void event_join(IRC_SERVER_REC *server, const char *data, const char *nic
shortchan = g_strdup_printf("!%s", channel+6);
chanrec = channel_find_unjoined(server, shortchan);
if (chanrec != NULL) {
+ channel_change_name(CHANNEL(chanrec), channel);
g_free(chanrec->name);
chanrec->name = g_strdup(channel);
+ } else {
+ /* well, did we join it with full name? if so, and if
+ this was the first short one, change it's name. */
+ chanrec = channel_find_unjoined(server, channel);
+ if (chanrec != NULL &&
+ irc_channel_find(server, shortchan) == NULL) {
+ channel_change_visible_name(CHANNEL(chanrec),
+ shortchan);
+ }
}
}
diff --git a/src/irc/core/irc-channels.c b/src/irc/core/irc-channels.c
index d6acf6ae..5adf5fb1 100644
--- a/src/irc/core/irc-channels.c
+++ b/src/irc/core/irc-channels.c
@@ -149,12 +149,11 @@ static CHANNEL_REC *irc_channel_find_server(SERVER_REC *server,
if (rec->chat_type != server->chat_type)
continue;
+ /* check both !ABCDEchannel and !channel */
if (g_strcasecmp(channel, rec->name) == 0)
return rec;
- /* check after removing ABCDE from !ABCDEchannel */
- if (*channel == '!' && *rec->name == '!' &&
- g_strcasecmp(channel+1, rec->name+6) == 0)
+ if (g_strcasecmp(channel, rec->visible_name) == 0)
return rec;
}