Allow storing multiple "other" prefixes such as +q and +a.

Original patch by JasonX, somewhat changed by exg and me.


git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4922 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Jilles Tjoelker 2008-11-28 00:16:51 +00:00 committed by jilles
commit 89cd47bf3a
15 changed files with 110 additions and 88 deletions

View file

@ -86,18 +86,12 @@ static char *expando_usermode(SERVER_REC *server, void *item, int *free_ret)
static char *expando_cumode(SERVER_REC *server, void *item, int *free_ret)
{
if (IS_IRC_CHANNEL(item) && CHANNEL(item)->ownnick) {
char other = NICK(CHANNEL(item)->ownnick)->other;
if (other != '\0') {
char *cumode = g_malloc(2);
cumode[0] = other;
cumode[1] = '\0';
*free_ret = TRUE;
return cumode;
}
return NICK(CHANNEL(item)->ownnick)->op ? "@" :
NICK(CHANNEL(item)->ownnick)->halfop ? "%" :
NICK(CHANNEL(item)->ownnick)->voice ? "+" : "";
char prefix = NICK(CHANNEL(item)->ownnick)->prefixes[0];
char *cumode = g_malloc(2);
cumode[0] = prefix;
cumode[1] = '\0';
*free_ret = TRUE;
return cumode; /* will be "\0\0" = "" if there is no prefix */
}
return "";
}