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

Improve internal channel mode handling #101

Closed
cooper opened this Issue Jul 19, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@cooper
Owner

cooper commented Jul 19, 2016

This issue is a checklist for several others which are related but have to be completed in a particular order.

  • Mode letters have to be manually looked up when generating mode strings (#77).
    • New channel method ->handle_modes() will be the low-level modes applicator.
    • Mode blocks need to be passed user objects rather than UIDs and nicks.
    • Mode blocks need to return user objects rather than array references of UIDs and nicks.
    • New channel methods ->do_modes() and ->do_modes_local() will be wrappers to a new ->_do_modes() method which will:
      • Accept a hash in the form of an array reference of mode names which MAY be negated. Values are string parameters or undef if no parameter is present. See the main issue for a detailed description of this method's arguments.
      • Apply the new modes. The new method will use the same logic for this as is presently in ->do_mode_string() and friends, calling mode blocks when appropriate.
      • Notify local clients when necessary. This MAY be split up into multiple MODE messages, depending on a configurable limit.
      • Unless the local version of the method was used, notify other servers.
    • New server method ->strings_from_cmodes() will:
      • Accept modes in the same form used by ->do_modes().
      • Take a parameter which specifies whether the strings should use UIDs or nicknames.
      • Take a parameter which specifies whether to split the changes up into more than one string.
      • Take a parameter which specifies whether to organize the modes alphabetically.
      • Return one or more mode strings.
    • New server method ->cmodes_from_string() will:
      • Accept a mode string in the perspective of some server.
      • Return a hash reference of named modes in the form used by ->do_modes().
  • On JELP burst, only one MODE message per channel is sent to users (#70).
    • In order to fix this, we need to make ->do_mode_string() a wrapper for ->do_modes().
    • First it will call ->cmodes_from_string() and then apply the result with ->do_modes().
    • Although this issue does not usually apply to TS6, it would fix an analogous problem with pseudoserver packages that may send large mode messages.
    • JELP and TS6 handlers will be unchanged. All of this new magic is internal.
  • Mode changes in a single client MODE message are currently unlimited (#25).
    • Truncate mode parameters sent in a client MODE message to a configurable limit.
    • Truncate mode letters sent in a client MODE message to a configurable number of characters.

@cooper cooper added the internals label Jul 19, 2016

@cooper cooper added this to the v12 milestone Jul 19, 2016

cooper added a commit that referenced this issue Jul 20, 2016

cooper added a commit that referenced this issue Jul 21, 2016

rather than constantly converting between UIDs/nick and objects, mode…
… blocks are always passed objects from now on. #101

cooper added a commit that referenced this issue Jul 21, 2016

11.39: new server method ->strings_from_cmodes() generates one or mor…
…e strings based on named modes. #101.             new configuration options channels:max_modes_per_line and channels:max_modes_per_sline determine how many modes can fit in an outgoing MODE message.

cooper added a commit that referenced this issue Jul 21, 2016

11.4: new methods ->do_modes() and ->do_modes_local() apply named mod…
…es, notifying local users and other servers. #77. #101.

cooper added a commit that referenced this issue Jul 21, 2016

11.41: new server method ->cmodes_from_string() extracts named modes …
…from a mode string in a certain perspective. closes #77.             channel methods ->handle_mode_string(), ->do_mode_string(), and ->do_mode_string_local() are now all wrappers for the new named mode methods. #101.

cooper added a commit that referenced this issue Jul 21, 2016

11.42: new configuration option channels:client_max_modes_simple limi…
…ts the number of modes per client MODE message. #101.             new configuration option channels:client_max_mode_params limits the number of parameters per client MODE message.             renamed channels:max_modes_per_sline to channels:max_modes_per_server_line.

@cooper cooper closed this Jul 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment