Skip to content
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

JELP module and command negotiation #122

Open
cooper opened this issue Jul 27, 2016 · 1 comment
Open

JELP module and command negotiation #122

cooper opened this issue Jul 27, 2016 · 1 comment
Assignees
Milestone

Comments

@cooper
Copy link
Owner

cooper commented Jul 27, 2016

Concept

I had an idea years ago to negotiate commands on burst. It would be useful for determining whether to send outgoing commands to servers. Servers could also notify opers of protocol mismatches when things don't add up. My original idea was to include parameter information too, but I don't think that has any true benefit.

Once the JELP protocol is versioned and standardized, we can simplify this by adding definitions for commands in a certain protocol version. The receiving server will be certain to have at least the commands in that set if the version in the SERVER command is greater than or equal to the one specified.

A bit tricky will be determining which modules/commands were added and removed during a RELOAD. We certainly do not want to send it all over again each time we do that.

How it might look

During burst, include a parameter which is a stable modeset ID (JELP version):

:0 MOD :Channel::Access,11.2 Channel::Invite,4.4 Grant,9.1 Git,0.6 Reload,2.1 Ban,15.3 Cloak,0.5 DNSBL,0.2
:0 CMD 1.67 :GRANT UPDATE RELOAD BAN BANINFO BANIDK BANDEL

When a module is loaded, such as Ban:

:0 MOD :Ban,10.2 Ban::JELP,5.4
:0 CMD :BAN BANINFO BANIDK BANDEL

When a module is unloaded:

:0 CMD -BAN -BANINFO -BANIDK -BANDEL
:0 MOD -Ban -Ban::JELP

Example

GRANT currently sends out UMODE and OPER commands which will one day be invalid (#91). Adding a command which enables oper flags and sets umode +o would fix this. But what if you want to GRANT a user who does not have the grant module?

if (!$t_user->server->has_cmd('GRANT')) {
    $user->server_notice(grant => 'Grant is not available on the destination server');
    return;
}

Brainstorming

Other random ideas:

  • Check if servers have a module with $server->has_mod('Cloak')
  • Check if servers have a command with $server->has_cmd('GRANT')
  • MODESYNC (MODESYNC #63) could automatically be initiated by MOD. If we see that a remote server now has a module which provides channel modes, send our modes!
@cooper
Copy link
Owner Author

cooper commented May 31, 2017

I don't think command negotiation is really needed. Whether a command is available can be determined by module or protocol version.

@cooper cooper added this to the v14 milestone May 31, 2017
@cooper cooper self-assigned this Oct 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant