diff options
Diffstat (limited to 'irc_send.c')
-rw-r--r-- | irc_send.c | 28 |
1 files changed, 24 insertions, 4 deletions
@@ -44,7 +44,7 @@ void irc_send_login(irc_t *irc) PACKAGE, BITLBEE_VERSION, ARCH, CPU); irc_send_num(irc, 3, ":%s", IRCD_INFO); irc_send_num(irc, 4, "%s %s %s %s", irc->root->host, BITLBEE_VERSION, UMODES UMODES_PRIV, CMODES); - irc_send_num(irc, 5, "PREFIX=(ohv)@%%+ CHANTYPES=%s CHANMODES=,,,%s NICKLEN=%d CHANNELLEN=%d " + irc_send_num(irc, 5, "PREFIX=(ohv)~&@%%+ CHANTYPES=%s CHANMODES=,,,%s NICKLEN=%d CHANNELLEN=%d " "NETWORK=BitlBee SAFELIST CASEMAPPING=rfc1459 MAXTARGETS=1 WATCH=128 " "FLOOD=0/9999 :are supported by this server", CTYPES, CMODES, MAX_NICK_LENGTH - 1, MAX_NICK_LENGTH - 1); @@ -213,7 +213,11 @@ void irc_send_names(irc_channel_t *ic) *namelist = 0; } - if (icu->flags & IRC_CHANNEL_USER_OP) { + if (icu->flags & IRC_CHANNEL_USER_OWNER) { + strcat(namelist, "~"); + } else if (icu->flags & IRC_CHANNEL_USER_ADMIN) { + strcat(namelist, "&"); + } else if (icu->flags & IRC_CHANNEL_USER_OP) { strcat(namelist, "@"); } else if (icu->flags & IRC_CHANNEL_USER_HALFOP) { strcat(namelist, "%"); @@ -373,11 +377,27 @@ void irc_send_nick(irc_user_t *iu, const char *new) void irc_send_channel_user_mode_diff(irc_channel_t *ic, irc_user_t *iu, irc_channel_user_flags_t old, irc_channel_user_flags_t new) { - char changes[3 * (5 + strlen(iu->nick))]; - char from[strlen(ic->irc->root->nick) + strlen(ic->irc->root->user) + strlen(ic->irc->root->host) + 3]; + char changes[5 * (5 + strlen(iu->nick))]; + char from[strlen(ic->irc->root->nick) + strlen(ic->irc->root->user) + strlen(ic->irc->root->host) + 5]; int n; *changes = '\0'; n = 0; + if ((old & IRC_CHANNEL_USER_OWNER) != (new & IRC_CHANNEL_USER_OWNER)) { + n++; + if (new & IRC_CHANNEL_USER_OWNER) { + strcat(changes, "+q"); + } else { + strcat(changes, "-q"); + } + } + if ((old & IRC_CHANNEL_USER_ADMIN) != (new & IRC_CHANNEL_USER_ADMIN)) { + n++; + if (new & IRC_CHANNEL_USER_ADMIN) { + strcat(changes, "+a"); + } else { + strcat(changes, "-a"); + } + } if ((old & IRC_CHANNEL_USER_OP) != (new & IRC_CHANNEL_USER_OP)) { n++; if (new & IRC_CHANNEL_USER_OP) { |