Skip to content

Block shortcut to run itself #12

@GewoonYorick

Description

@GewoonYorick

Adding a shortcut with the same name and command to execute creates a loop which crashes thelounge.

We could just block all commands that have the same "to" as name.

Personally I run znc behind thelounge with the *alias module loaded, this allows to to run aliased the commands from different clients aswell. So it'd be nice if those could be registered in the plugin so they appear in the pop up menu when typing / (hence name and the to is the same)

the log:
/home/thelounge/.thelounge/packages/node_modules/thelounge-plugin-shortcuts/index.js:45
return shortcuts.some(function (o) {
^

RangeError: Maximum call stack size exceeded
at /home/thelounge/.thelounge/packages/node_modules/thelounge-plugin-shortcuts/index.js:45:36
at Array.some ()
at doesShortcutExist (/home/thelounge/.thelounge/packages/node_modules/thelounge-plugin-shortcuts/index.js:45:22) at Object.input (/home/thelounge/.thelounge/packages/node_modules/thelounge-plugin-shortcuts/index.js:81:13) at Client.inputLine (/home/thelounge/thelounge/src/client.js:376:11)
at PublicClient.runAsUser (/home/thelounge/thelounge/src/plugins/packages/publicClient.js:12:15)
at Object.input (/home/thelounge/.thelounge/packages/node_modules/thelounge-plugin-shortcuts/index.js:93:20) at Client.inputLine (/home/thelounge/thelounge/src/client.js:376:11)
at PublicClient.runAsUser (/home/thelounge/thelounge/src/plugins/packages/publicClient.js:12:15)
at Object.input (/home/thelounge/.thelounge/packages/node_modules/thelounge-plugin-shortcuts/index.js:93:20)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions