Act on channel mode lock as half-op

There's no reason you shouldn't be able to use modelock as a half-op.

Also a few other minor cleanups in this function - eg. use my_send_to_server()
with the passed server number instead of implicitly using from_server.
This commit is contained in:
Kevin Easton
2016-10-18 23:32:23 +11:00
parent da1618d393
commit c2d6a184a3
2 changed files with 7 additions and 5 deletions

View File

@@ -1,5 +1,7 @@
[Changes 1.2.2] [Changes 1.2.2]
* Act on channel mode lock as half-op. (caf)
* Fix crash and memory leak in $aliasctl(COMMAND MATCH). (caf) * Fix crash and memory leak in $aliasctl(COMMAND MATCH). (caf)
* Fix memory leaks in /CDCC PLIST and /CDCC NOTICE. (caf) * Fix memory leaks in /CDCC PLIST and /CDCC NOTICE. (caf)

View File

@@ -291,11 +291,11 @@ char *s;
int check_mode_lock(char *channel, char *mode_list, int server) int check_mode_lock(char *channel, char *mode_list, int server)
{ {
ChannelList *chan; ChannelList *chan = lookup_channel(channel, server, CHAN_NOUNLINK);
char buffer[BIG_BUFFER_SIZE];
if ((chan = lookup_channel(channel, server, 0)) && chan->modelock_key) if (chan && chan->modelock_key && (chan->have_op || chan->hop))
{ {
char buffer[BIG_BUFFER_SIZE];
char *modelock, *new_mode_list, *newmode, *save, *save1; char *modelock, *new_mode_list, *newmode, *save, *save1;
char *args = NULL, *args1 = NULL; char *args = NULL, *args1 = NULL;
int add = 0; int add = 0;
@@ -389,8 +389,8 @@ int check_mode_lock(char *channel, char *mode_list, int server)
} }
modelock++; modelock++;
} }
if (chan && chan->have_op && *buffer) if (*buffer)
send_to_server("MODE %s %s", chan->channel, buffer); my_send_to_server(server, "MODE %s %s", chan->channel, buffer);
new_free(&save); new_free(&save);
new_free(&save1); new_free(&save1);
return 1; return 1;