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 add multiple messges into one Ping #155

Open
MaxRink opened this issue Apr 7, 2015 · 3 comments
Open

How to add multiple messges into one Ping #155

MaxRink opened this issue Apr 7, 2015 · 3 comments

Comments

@MaxRink
Copy link

MaxRink commented Apr 7, 2015

Is it possible to add multiple messages into one ping?

The Message Syntax is like this:

(21:23:41) qq: BROADCAST
(21:23:41) qq: text 2
(21:23:41) qq: text 3

@amyreese
Copy link
Owner

This is technically possible, but most likely not going to happen. There are a few complications:

  • how do you know ahead of time that you'll need/want to batch the first message with future messages
  • how do you know when you've received enough messages to send a batch
  • if you guess wrong above, how/when do you figure that out and send a notification for the "missed" message
  • assuming this is all configurable, how do you actually configure this is a reasonable way that will work for more than one user

If someone can answer those questions and put together a reasonable pull request, I'll gladly review it.

@dgw
Copy link
Collaborator

dgw commented Apr 21, 2015

My immediate thoughts:

  • Add a (configurable, optional) slight delay to notification processing.
  • Messages sent to the same context by the same nick as the one that triggered the delay start are added to the queue and the delay timer is reset.
  • When the delay expires, flush the queue into a single notification.

The delay handles the first two conditions, and its expiration handles condition three. A batch_delay (or whatever it's called) variable handles condition four reasonably well.

The first message has to contain the desired highlight keyword, but that's probably reasonable for users to configure if they want this behavior.

Thoughts?

@amyreese
Copy link
Owner

I think the difficulty stems from the inability to do asynchronous work within ZNC. Eg, if you get one message that would normally generate a notification, and you defer it for later to wait for batching, you have no way of saying "in X seconds, send a notification if I haven't gotten a message since then".

The closest thing to that would be waiting for the next message to come in before sending a previously-deferred notification, but you have no idea when that next message will actually arrive. It could be 2 seconds, it could be 2 hours...

If the async story changes in ZNC, then I think this is something we can revisit. But until then, this is likely to cause more confusion than anything.

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

No branches or pull requests

3 participants