aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--irc.h1
-rw-r--r--irc_channel.c11
-rw-r--r--irc_im.c4
-rw-r--r--root_commands.c2
4 files changed, 16 insertions, 2 deletions
diff --git a/irc.h b/irc.h
index e6a4dcf9..74e66075 100644
--- a/irc.h
+++ b/irc.h
@@ -233,6 +233,7 @@ int irc_channel_set_topic( irc_channel_t *ic, const char *topic, const irc_user_
void irc_channel_user_set_mode( irc_channel_t *ic, irc_user_t *iu, irc_channel_user_flags_t flags );
void irc_channel_printf( irc_channel_t *ic, char *format, ... );
gboolean irc_channel_name_ok( const char *name );
+void irc_channel_name_strip( char *name );
int irc_channel_name_cmp( const char *a_, const char *b_ );
void irc_channel_update_ops( irc_channel_t *ic, char *value );
char *set_eval_irc_channel_ops( struct set *set, char *value );
diff --git a/irc_channel.c b/irc_channel.c
index da6abbe4..f0e564bc 100644
--- a/irc_channel.c
+++ b/irc_channel.c
@@ -286,6 +286,17 @@ gboolean irc_channel_name_ok( const char *name_ )
return TRUE;
}
+void irc_channel_name_strip( char *name )
+{
+ int i, j;
+
+ for( i = j = 0; name[i]; i ++ )
+ if( name[i] > ' ' && name[i] != ',' )
+ name[j++] = name[i];
+
+ name[j] = '\0';
+}
+
int irc_channel_name_cmp( const char *a_, const char *b_ )
{
static unsigned char case_map[256];
diff --git a/irc_im.c b/irc_im.c
index ada92b16..f4c5f390 100644
--- a/irc_im.c
+++ b/irc_im.c
@@ -534,11 +534,11 @@ static gboolean bee_irc_chat_name_hint( bee_t *bee, struct groupchat *c, const c
strncpy( stripped, name, MAX_NICK_LENGTH );
stripped[MAX_NICK_LENGTH] = '\0';
- nick_strip( stripped );
+ irc_channel_name_strip( stripped );
if( set_getbool( &bee->set, "lcnicks" ) )
nick_lc( stripped );
- full_name = g_strdup_printf( "&%s", stripped );
+ full_name = g_strdup_printf( "#%s", stripped );
if( stripped[0] && irc_channel_by_name( irc, full_name ) == NULL )
{
diff --git a/root_commands.c b/root_commands.c
index b47ce078..470b2536 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -1015,6 +1015,8 @@ static void cmd_chat( irc_t *irc, char **cmd )
s = g_strdup_printf( "#%s", channel );
g_free( channel );
channel = s;
+
+ irc_channel_name_strip( channel );
}
if( ( ic = irc_channel_new( irc, channel ) ) &&