This repository was archived by the owner on Jun 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
Misc feature + fix package. #227
Open
jevolk
wants to merge
4
commits into
charybdis-ircd:release/4
Choose a base branch
from
matrix-construct:release/4
base: release/4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
75999c4
configure.ac: Reclassify msys platform as an analog of cygwin rather …
jevolk 7106638
Add flag to relax spoof restriction on the oper conf's hostmask match…
jevolk dd1c60f
modules: Add SAJOIN command for an oper to force join target lists.
jevolk c3c7e88
!fixup dd1c60f5673c53329016d3a9ab68d67b5daed4c0
jevolk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
/* | ||
* charybdis: porto vintage '88. | ||
* m_sajoin.c: Force join a user to a channel. | ||
* | ||
* Copyright (c) 2016 Charybdis Development Team | ||
* Copyright (c) 2016 Jason Volk <[email protected]> | ||
* | ||
* Permission to use, copy, modify, and/or distribute this software for | ||
any | ||
* purpose with or without fee is hereby granted, provided that the | ||
above | ||
* copyright notice and this permission notice is present in all copies. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE | ||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, | ||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | ||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#include "stdinc.h" | ||
#include "client.h" | ||
#include "ircd.h" | ||
#include "msg.h" | ||
#include "numeric.h" | ||
#include "send.h" | ||
#include "s_conf.h" | ||
#include "logger.h" | ||
#include "parse.h" | ||
#include "modules.h" | ||
#include "hash.h" | ||
#include "cache.h" | ||
#include "rb_dictionary.h" | ||
|
||
const char sajoin_desc[] = | ||
"Allows operators to force a user to join a channel."; | ||
|
||
static void mo_sajoin(struct MsgBuf *, struct Client *, struct Client *, int, const char **); | ||
|
||
struct Message sajoin_msgtab = | ||
{ | ||
"SAJOIN", 0, 0, 0, 0, | ||
{ | ||
mg_unreg, | ||
mg_ignore, | ||
mg_ignore, | ||
mg_ignore, | ||
mg_ignore, | ||
{ mo_sajoin, 3 } | ||
} | ||
}; | ||
|
||
mapi_clist_av1 sajoin_clist[] = | ||
{ | ||
&sajoin_msgtab, | ||
NULL | ||
}; | ||
|
||
DECLARE_MODULE_AV2 | ||
( | ||
sajoin, | ||
NULL, | ||
NULL, | ||
sajoin_clist, | ||
NULL, | ||
NULL, | ||
NULL, | ||
NULL, | ||
sajoin_desc | ||
); | ||
|
||
/* Soft join is where SAJOIN peruses as the user itself attempting | ||
* to join the channel and is susceptible to bans etc. | ||
*/ | ||
static void | ||
join_soft(struct Client *const client, | ||
const char *const chname) | ||
{ | ||
static char buf[BUFSIZE]; | ||
const size_t len = snprintf(buf, sizeof(buf), ":%s JOIN %s", | ||
use_id(client), | ||
chname); | ||
|
||
parse(client, buf, buf + len); | ||
} | ||
|
||
/* Hard join forces the target user into the channel manually, | ||
* with as few checks as possible to bypass any bans etc. | ||
* | ||
* !! NOT YET IMPLEMENTED !! | ||
*/ | ||
static void | ||
join_hard(struct Client *const client, | ||
const char *const chname) | ||
{ | ||
} | ||
|
||
/* | ||
* parv[1] = channel list (chan,chan,chan,...) | ||
* parv[2] = nick list (nick,nick,nick,...) | ||
* (future) parv[3] = options | ||
*/ | ||
static void | ||
mo_sajoin(struct MsgBuf *const msgbuf, | ||
struct Client *const client_p, | ||
struct Client *const source_p, | ||
int parc, | ||
const char **const parv) | ||
{ | ||
static const char *const SEP = ","; | ||
static char vec[BUFSIZE]; | ||
char *ctx, *target; | ||
|
||
int clients = 0; | ||
static struct Client *client[BUFSIZE]; | ||
rb_strlcpy(vec, parv[2], sizeof(vec)); | ||
target = rb_strtok_r(vec, SEP, &ctx); do | ||
{ | ||
if(!(client[clients] = find_person(target))) | ||
continue; | ||
|
||
clients++; | ||
} | ||
while((target = rb_strtok_r(NULL, SEP, &ctx))); | ||
|
||
rb_strlcpy(vec, parv[1], sizeof(vec)); | ||
target = rb_strtok_r(vec, SEP, &ctx); do | ||
{ | ||
if(!check_channel_name(target)) | ||
continue; | ||
|
||
for(size_t i = 0; i < clients; i++) | ||
join_soft(client[i], target); | ||
} | ||
while((target = rb_strtok_r(NULL, SEP, &ctx))); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Check for local vs. remote client. ENCAP SAJOIN for remotes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the parv comment is odd there