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

Incompatibility with other scripts #17

Open
Sophist-UK opened this issue Jul 24, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@Sophist-UK
Copy link

commented Jul 24, 2018

I am responsible for maintaining another mIRC script, dlFilter, designed to filter out adverts and other people's triggers from file sharing channels.

nbs-irc is incompatible with this script because nbs-irc is called on every IRC message and then haltdefs and explicitly echos every message regardless of whether this is needed for specific nbs-irc functionality. dlFilter also does something similar, but only when it is needed to stop messages from being shown or to send them to a different window than mIRC's default, and this is what makes them incompatible.

When dlFilter runs first, nbs-irc does not respect that dlFilter has halted specific messages and still echos them - in this situation nbs-irc's ON events should use the "&" prefix so that they are NOT run if a previous script has halted them and should only echo them if $halted is false.

When dlFilter runs last and wants to stop a message from being displayed, it notes that the messages have been halted, but cannot stop them displaying because nbs-irc echos them directly.

I would like to recommend three changes for how nbs-irc processes messages:

  1. Make the ON events specific to the messages that you need to process to deliver specific functionality and not run on messages not needed for nbs-irc functioning. Split generic routines like ON NOTICE which then check message content into separate ON NOTICE routines for each type of content e.g. have a separate ON me:^*:notice:lag437289 *:?: rather than test with if ($nick == $me) && ($1 == lag437289) this inside a generic on ^*:notice:*:*: which runs on every channel and private notice;

  2. Only haltdef messages when necessary to hide them or redirect them to a different window. Before echoing these messages check $halted and only echo if $halted == $false; and

  3. Prefix your ON events with "&" unless you specifically need to process them (e.g. as responses to requests you have made) in order to respect haltdef of any scripts which run before. Note: This is equivalent to the existing code ìf ($halted) return` that is the first statement in many existing ON events.

I hope that by working on this together we can make our scripts compatible with one another.

@ElectronicWar

This comment has been minimized.

Copy link
Owner

commented Jul 24, 2018

Thank you very much for the detailed issue report.

Although this project is very far down on my priorities at the moment I'd like to at least provide basic compatibility with dlFilter in a timely manner for your users. I might need to poke you during development if it's OK.

@ElectronicWar ElectronicWar self-assigned this Jul 24, 2018

@Sophist-UK

This comment has been minimized.

Copy link
Author

commented Jul 24, 2018

Sure.

If I used nbs-irc myself I would submit a PR, but I don't.

But happy to provide advice.

@ElectronicWar

This comment has been minimized.

Copy link
Owner

commented Jul 24, 2018

Related issue: DukeLupus/dlFilter#44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.