diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2013-06-16 13:42:39 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2013-06-16 13:42:39 +0100 |
commit | 1a2c1c0c413ea1124544cdc9a24a0d2faa5dbb8f (patch) | |
tree | d3ae6d42d29b7b226abb017ab5dfb07536d2493b /irc.c | |
parent | ab19567e25a35beb23f922303d1f60ed13228356 (diff) | |
parent | 5cb946132871ef97fe9eabacafa62f1064d80423 (diff) |
Merging utf8-nicks branch. This adds a utf8_nicks setting which removes the
ASCII restriction on contact nicknames. Use at your own risk!
Diffstat (limited to 'irc.c')
-rw-r--r-- | irc.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -34,6 +34,7 @@ static gboolean irc_userping( gpointer _irc, gint fd, b_input_condition cond ); static char *set_eval_charset( set_t *set, char *value ); static char *set_eval_password( set_t *set, char *value ); static char *set_eval_bw_compat( set_t *set, char *value ); +static char *set_eval_utf8_nicks( set_t *set, char *value ); irc_t *irc_new( int fd ) { @@ -133,6 +134,7 @@ irc_t *irc_new( int fd ) s = set_add( &b->set, "timezone", "local", set_eval_timezone, irc ); s = set_add( &b->set, "to_char", ": ", set_eval_to_char, irc ); s = set_add( &b->set, "typing_notice", "false", set_eval_bool, irc ); + s = set_add( &b->set, "utf8_nicks", "false", set_eval_utf8_nicks, irc ); irc->root = iu = irc_user_new( irc, ROOT_NICK ); iu->host = g_strdup( myhost ); @@ -961,6 +963,23 @@ static char *set_eval_bw_compat( set_t *set, char *value ) return SET_INVALID; } +static char *set_eval_utf8_nicks( set_t *set, char *value ) +{ + irc_t *irc = set->data; + gboolean val = bool2int( value ); + + /* Do *NOT* unset this flag in the middle of a session. There will + be UTF-8 nicks around already so if we suddenly disable support + for them, various functions might behave strangely. */ + if( val ) + irc->status |= IRC_UTF8_NICKS; + else if( irc->status & IRC_UTF8_NICKS ) + irc_rootmsg( irc, "You need to reconnect to BitlBee for this " + "change to take effect." ); + + return set_eval_bool( set, value ); +} + void register_irc_plugin( const struct irc_plugin *p ) { irc_plugins = g_slist_prepend( irc_plugins, (gpointer) p ); |