diff options
author | Timo Sirainen <cras@irssi.org> | 2000-08-20 07:17:13 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-08-20 07:17:13 +0000 |
commit | 67cc9af1bd825268e0bf12dca262bdbf64e56d29 (patch) | |
tree | f1baf82253e80d7c95e799f0f528c10b321d5a8c /src/irc/core/channels.c | |
parent | 7cbd164e759449450f38fac0d087960c3b5355b8 (diff) | |
download | irssi-67cc9af1bd825268e0bf12dca262bdbf64e56d29.zip |
Channel mode handling changed - there's no more mode_xxx fields in
channel structure, but instead just one mode string field. Also
handling half-ops (+h) should work right.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@617 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/core/channels.c')
-rw-r--r-- | src/irc/core/channels.c | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/src/irc/core/channels.c b/src/irc/core/channels.c index 445bc1e4..158abede 100644 --- a/src/irc/core/channels.c +++ b/src/irc/core/channels.c @@ -62,6 +62,7 @@ CHANNEL_REC *channel_create(IRC_SERVER_REC *server, const char *channel, int aut rec->name = g_strdup(channel); rec->server = server; rec->createtime = time(NULL); + rec->mode = g_strdup(""); if (*channel == '+') rec->no_modes = TRUE; @@ -126,34 +127,6 @@ CHANNEL_REC *channel_find(IRC_SERVER_REC *server, const char *channel) } -char *channel_get_mode(CHANNEL_REC *channel) -{ - GString *mode; - char *ret; - - g_return_val_if_fail(channel != NULL, NULL); - - mode = g_string_new(NULL); - - if (channel->mode_secret) g_string_append_c(mode, 's'); - if (channel->mode_private) g_string_append_c(mode, 'p'); - if (channel->mode_moderate) g_string_append_c(mode, 'm'); - if (channel->mode_invite) g_string_append_c(mode, 'i'); - if (channel->mode_nomsgs) g_string_append_c(mode, 'n'); - if (channel->mode_optopic) g_string_append_c(mode, 't'); - if (channel->mode_anonymous) g_string_append_c(mode, 'a'); - if (channel->mode_reop) g_string_append_c(mode, 'r'); - if (channel->mode_key) g_string_append_c(mode, 'k'); - if (channel->limit > 0) g_string_append_c(mode, 'l'); - - if (channel->mode_key) g_string_sprintfa(mode, " %s", channel->key); - if (channel->limit > 0) g_string_sprintfa(mode, " %d", channel->limit); - - ret = mode->str; - g_string_free(mode, FALSE); - return ret; -} - #define get_join_key(key) \ (((key) == NULL || *(key) == '\0') ? "x" : (key)) |