From 687ec880201e4872a9abf72f5efe135164fc349b Mon Sep 17 00:00:00 2001 From: dequis Date: Sat, 12 Sep 2015 05:25:33 -0300 Subject: IRCv3 multi-prefix... but mostly just adding prefixes to WHO We can't actually have multiple prefixes internally, so the only thing missing for multi-prefix compliance is actually having the prefix in the WHO reply, which is a rfc1459 thing. Note to future self: check irc logs for the implementation I threw away. The one that actually handled multiple prefixes. I hope that's useful. --- irc_channel.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'irc_channel.c') diff --git a/irc_channel.c b/irc_channel.c index cbd306a3..714e974a 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -428,6 +428,18 @@ void irc_channel_set_mode(irc_channel_t *ic, const char *s) } } +char irc_channel_user_get_prefix(irc_channel_user_t *icu) +{ + if (icu->flags & IRC_CHANNEL_USER_OP) { + return '@'; + } else if (icu->flags & IRC_CHANNEL_USER_HALFOP) { + return '%'; + } else if (icu->flags & IRC_CHANNEL_USER_VOICE) { + return '+'; + } + return 0; +} + void irc_channel_auto_joins(irc_t *irc, account_t *acc) { GSList *l; -- cgit v1.2.3