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

How to solve a problem with "irc-framework" of kiwiirc #62

Open
Madriix opened this issue Jul 20, 2022 · 0 comments
Open

How to solve a problem with "irc-framework" of kiwiirc #62

Madriix opened this issue Jul 20, 2022 · 0 comments

Comments

@Madriix
Copy link
Collaborator

Madriix commented Jul 20, 2022

Hi
On JBNC there is all this currently:

          if(data[1]=="CAP") {
            if(data[3] && data[3]=='LS') {
              if(lines[n].trim().indexOf("cap-notify")>=0) {
                this.write("CAP REQ :cap-notify\n");
              }
              if(lines[n].trim().indexOf("away-notify")>=0) {
                this.write("CAP REQ :away-notify\n");
              }
              if(lines[n].trim().indexOf("invite-notify")>=0) {
                this.write("CAP REQ :invite-notify\n");
              }
              if(lines[n].trim().indexOf("extended-join")>=0) {
                this.write("CAP REQ :extended-join\n");
              }
              if(lines[n].trim().indexOf("userhost-in-names")>=0) {
                this.write("CAP REQ :userhost-in-names\n");
                this.userhostInNames=true;
              }
              if(lines[n].trim().indexOf("multi-prefix")>=0) {
                this.write("CAP REQ :multi-prefix\n");
              }
              if(lines[n].trim().indexOf("account-notify")>=0) {
                this.write("CAP REQ :account-notify\n");
              }
              if(lines[n].trim().indexOf("message-tags")>=0) {
                this.write("CAP REQ :message-tags\n");
                this.messagetags=true;
              }
              if(lines[n].trim().indexOf("account-tag")>=0) {
                this.write("CAP REQ :account-tag\n");
              }
              if(this.messagetags && lines[n].trim().indexOf("server-time")>=0) {
                this.write("CAP REQ :server-time\n");
              }
              if(lines[n].trim().indexOf("sasl")>=0) {
                this.write("CAP REQ :sasl\n");
                this.sasl=true;
              }
              if (!this.sasl)
                this.write("CAP END\n");
            }
            else if(this.sasl && data[3] && data[3]=='ACK') {
              if(lines[n].trim().indexOf("sasl")>=0) {
                this.write("AUTHENTICATE :PLAIN\n");
              }
            }
            else {
              if (!this.sasl)
                this.write("CAP END\n");
            }
            continue;
          }

I found a problem here:
https://github.com/kiwiirc/irc-framework/blob/469cbe7b2129ddae0328a7efe91eb218257e98ff/src/commands/handlers/channel.js#L218

handler.network.cap.isEnabled('extended-join')
this line always returns "false"
even for this one (the line 226):
data.gecos = command.params[gecos_idx] || '';
which can be tested for debug with:
data.gecos = command.params[gecos_idx]+" - test:"+handler.network.cap.isEnabled('sasl') || '';

it returns false all the time, when it should return true
It should be noted that jbnc recognizes well that it is connected by sasl, and it also detects the raws of the "extended-join" but on ircframework it always detects false for the "isEnabled", the problem could come from where ? Jbnc or irc-framework?
Something must be missing but i don't know where

also on you can remove the "if" https://github.com/kiwiirc/irc-framework/blob/469cbe7b2129ddae0328a7efe91eb218257e98ff/src/commands/handlers/channel.js#L218 like this:

        //if (handler.network.cap.isEnabled('extended-join')) {
            data.account = command.params[1] === '*' ? false : command.params[1];
            gecos_idx = 2;
        //}

and there the "data.gecos" works well, it is displayed correctly, the problem comes from the "handler.network.cap.isEnabled" which detects no active cap

@Madriix Madriix changed the title How to solve a problem with kiwiirc's irc-framework How to solve a problem with "irc-framework" of kiwiirc Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant