-
Notifications
You must be signed in to change notification settings - Fork 70
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
base: master
Are you sure you want to change the base?
Conversation
Apparently 7 would interfere with CLIENT_CAP_MULTI_PREFIX (4). xfnw@freeirc.org suggested changing CLIENT_CAP_EXTENDED_JOIN to 8.
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.
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!
src/ngircd/irc-channel.c
Outdated
@@ -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 |
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.
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.
src/ngircd/irc-channel.c
Outdated
#endif | ||
#ifdef IMPLEMENT_EXTENDED_JOIN | ||
CLIENT *c; | ||
// Pointless alias |
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.
C++ comments are not supported by old compilers. Please stick to C style comments: /* … */
.
And what do you mean with this comment at all?
src/ngircd/irc-channel.c
Outdated
cl2chan = Channel_FirstMember( Chan ); | ||
while(cl2chan) { | ||
c = Channel_GetClient( cl2chan ); | ||
//if (!Remote) { |
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.
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! ;-)
src/ngircd/irc-channel.c
Outdated
if(c && c != Client) { | ||
/* Ok, another Client */ | ||
conn = Client_Conn(c); | ||
/*if (Client_Type(c) == CLIENT_SERVER) |
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.
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! ;-)
src/ngircd/irc-channel.c
Outdated
conn = Client_Conn(Client); | ||
if(Client_Cap(Client) & CLIENT_CAP_EXTENDED_JOIN) { | ||
char * account_name; | ||
if(Client_AccountName(Client)) { |
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.
Please don't add braces where they are not needed ({ one_directive; }
).
Just use:
if(…)
directive;
src/ngircd/irc-channel.c
Outdated
} | ||
Conn_WriteStr(conn, ":%s JOIN %s %s :%s", Client_MaskCloaked(Client), channame, account_name, Client_Info(Client)); | ||
} | ||
else { |
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.
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.
src/ngircd/irc-channel.c
Outdated
else { | ||
account_name = "*"; | ||
} | ||
Conn_WriteStr(conn, ":%s JOIN %s %s :%s", Client_MaskCloaked(Client), channame, account_name, Client_Info(Client)); |
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.
Can't we use IRC_WriteStrClientPrefix()
here, like the original code did?
But probably I miss something obvious here?
This should help bots like bitbot authenticate users using services accounts.