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

If I send JSON containing a colon, the PRIVMSG to the server seems to lack a vital colon #581

Open
CaiusJard opened this issue Sep 26, 2024 · 0 comments

Comments

@CaiusJard
Copy link

CaiusJard commented Sep 26, 2024

So I'm using this project to "say" blocks of json to the server, and I was having some issues with other clients, in-chan, seeing truncated messages. I tweaked the bot.js to perform a test with json:

image

Said hello to it:

image

When this particular message is sent by the bot it seems to lack the colon at the start, as reported by my ircd:

image

The code for my daemon seems to bin everything after the first colon hence the truncation..

I found this:

Client.prototype.send = function(command) {
    var args = Array.prototype.slice.call(arguments);

    // Note that the command arg is included in the args array as the first element

    if (args[args.length - 1].match(/\s/) || args[args.length - 1].match(/^:/) || args[args.length - 1] === '') {
        args[args.length - 1] = ':' + args[args.length - 1];
    }

    if (this.opt.debug)
        util.log('SEND: ' + args.join(' '));

    if (!this.conn.requestedDisconnect) {
        this.conn.write(args.join(' ') + '\r\n');
    }
};

it seems to mean:

If the message contains spaces, or if the message starts with a colon, or if there is no message, add a colon?

I note my json contains no spaces, nor does it start with a colon, nor is it empty..

Is this the bug? I also see problems if I write bot.say("hello:world")

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