diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-05-03 01:39:39 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-05-03 01:39:39 +0100 |
commit | 6a9d068e73b6d08056302fdc85dd706a2dd647a5 (patch) | |
tree | f478fc61bc2e1c53ffcbd71fc081b91ac1324667 /irc_channel.c | |
parent | e54112f152c375df81a21181f755ced5f57165bc (diff) |
Restore away_devoice.
Diffstat (limited to 'irc_channel.c')
-rw-r--r-- | irc_channel.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/irc_channel.c b/irc_channel.c index 17ea64d3..fd79ba71 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -42,6 +42,9 @@ irc_channel_t *irc_channel_new( irc_t *irc, const char *name ) strcpy( ic->mode, CMODE ); irc_channel_add_user( ic, irc->root ); + if( strcmp( set_getstr( &irc->b->set, "ops" ), "both" ) == 0 || + strcmp( set_getstr( &irc->b->set, "ops" ), "root" ) == 0 ) + irc_channel_user_set_mode( ic, irc->root, IRC_CHANNEL_USER_OP ); irc->channels = g_slist_prepend( irc->channels, ic ); @@ -158,6 +161,19 @@ int irc_channel_set_topic( irc_channel_t *ic, const char *topic, const irc_user_ return 1; } +void irc_channel_user_set_mode( irc_channel_t *ic, irc_user_t *iu, irc_channel_user_flags_t flags ) +{ + irc_channel_user_t *icu = irc_channel_has_user( ic, iu ); + + if( icu->flags == flags ) + return; + + if( ic->flags & IRC_CHANNEL_JOINED ) + irc_send_channel_user_mode_diff( ic, iu, icu->flags, flags ); + + icu->flags = flags; +} + gboolean irc_channel_name_ok( const char *name ) { return strchr( CTYPES, name[0] ) != NULL && nick_ok( name + 1 ); |