8000 Implement IRCv3 `extended-join` by hello-smile6 · Pull Request #300 · ngircd/ngircd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Implement IRCv3 extended-join #300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

hello-smile6
Copy link
Contributor

This should help bots like bitbot authenticate users using services accounts.

9pfs added 3 commits December 12, 2022 02:21
Apparently 7 would interfere with CLIENT_CAP_MULTI_PREFIX (4). xfnw@freeirc.org suggested changing CLIENT_CAP_EXTENDED_JOIN to 8.
Copy link
Member
@alexbarton alexbarton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your contribution, @hello-smile6! This looks really promising, but not quite ready for merging.

Could you please check my comments?

Thank you!

@@ -236,8 +237,56 @@ join_forward(CLIENT *Client, CLIENT *target, CHANNEL *chan,
}

/* tell users in this channel about the new client */
#define IMPLEMENT_EXTENDED_JOIN
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have preprocessor directives (#define) start in the first column: old(er) compilers don't support them being indented. This affects those lines here, but you have some down below, too.

But: Why do we need IMPLEMENT_EXTENDED_JOIN in the first place? I think you can just get rid of it altogether.

#endif
#ifdef IMPLEMENT_EXTENDED_JOIN
CLIENT *c;
// Pointless alias
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++ comments are not supported by old compilers. Please stick to C style comments: /* … */.
And what do you mean with this comment at all?

cl2chan = Channel_FirstMember( Chan );
while(cl2chan) {
c = Channel_GetClient( cl2chan );
//if (!Remote) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove dead code and don't comment it out if it is no longer needed.
And don't forget to fix the indentation as well! ;-)

if(c && c != Client) {
/* Ok, another Client */
conn = Client_Conn(c);
/*if (Client_Type(c) == CLIENT_SERVER)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove dead code and don't comment it out if it is no longer needed.
And don't forget to fix the indentation as well! ;-)

conn = Client_Conn(Client);
if(Client_Cap(Client) & CLIENT_CAP_EXTENDED_JOIN) {
char * account_name;
if(Client_AccountName(Client)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't add braces where they are not needed ({ one_directive; }).
Just use:

if(…)
    directive;

}
Conn_WriteStr(conn, ":%s JOIN %s %s :%s", Client_MaskCloaked(Client), channame, account_name, Client_Info(Client));
}
else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is broken here (the else should be one level up), which makes it a bit hard to read.
And please remove the unnecessary braces ({, }) here as well – see my comment above.

else {
account_name = "*";
}
Conn_WriteStr(conn, ":%s JOIN %s %s :%s", Client_MaskCloaked(Client), channame, account_name, Client_Info(Client));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use IRC_WriteStrClientPrefix() here, like the original code did?
But probably I miss something obvious here?

@alexbarton alexbarton self-assigned this Dec 17, 2022
@alexbarton alexbarton added the enhancement This is a wishlist-item enhancing current or adding new functionality label Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is a wishlist-item enhancing current or adding new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0