mirror of
https://github.com/irssi/irssi.git
synced 2026-08-16 07:02:12 +02:00
updating user modes were handled as they were channel modes, like +o
etc. thought they needed arguments. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@735 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
28f3e476da
commit
1fa98c2369
5 changed files with 14 additions and 9 deletions
|
|
@ -297,8 +297,10 @@ void parse_channel_modes(IRC_CHANNEL_REC *channel, const char *setby,
|
|||
g_string_free(newmode, TRUE);
|
||||
}
|
||||
|
||||
/* add `mode' to `old' - return newly allocated mode. */
|
||||
char *modes_join(const char *old, const char *mode)
|
||||
/* add `mode' to `old' - return newly allocated mode.
|
||||
`channel' specifies if we're parsing channel mode and we should try
|
||||
to join mode arguments too. */
|
||||
char *modes_join(const char *old, const char *mode, int channel)
|
||||
{
|
||||
GString *newmode;
|
||||
char *dup, *modestr, *curmode, type;
|
||||
|
|
@ -317,7 +319,7 @@ char *modes_join(const char *old, const char *mode)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!HAS_MODE_ARG(type, *curmode))
|
||||
if (!channel || !HAS_MODE_ARG(type, *curmode))
|
||||
mode_set(newmode, type, *curmode);
|
||||
else {
|
||||
mode_set_arg(newmode, type, *curmode,
|
||||
|
|
@ -341,7 +343,7 @@ static void parse_user_mode(IRC_SERVER_REC *server, const char *modestr)
|
|||
g_return_if_fail(IS_IRC_SERVER(server));
|
||||
g_return_if_fail(modestr != NULL);
|
||||
|
||||
newmode = modes_join(server->usermode, modestr);
|
||||
newmode = modes_join(server->usermode, modestr, FALSE);
|
||||
oldmode = server->usermode;
|
||||
server->usermode = newmode;
|
||||
server->server_operator = (strchr(newmode, 'o') != NULL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue