murgo / IrssiNotifier

notifies android phones from irc private messages
Apache License 2.0
169 stars 63 forks source link

Support for non-channel/server hilights #178

Open mrc0mmand opened 8 years ago

mrc0mmand commented 8 years ago

Hello!

Would it be possible to add a support for hilights which don't belong to any channel/server? Some plugins just have a window where they print their output, but even when a message has MSGLEVEL_HILIGHT and MSGLEVEL_MSGS flags, it doesn't make it to notification server (these messages have empty $lastMsg variable because they don't emit message {public,privmsg,dcc,etc.} signals).

Thank you.

murgo commented 8 years ago

Does highlights apply to those messages anyhow?

mrc0mmand commented 8 years ago

As I said - hilights for these messages meet the same criteria as the 'regular' (channel) hilights (they have same level - MSGLEVEL_MSGS|MSGLEVEL_HILIGHT). The only problem is that they don't emit any message * signal (these signals can't be emitted by messages without a valid server object), thus the $lastMsg variable here is empty and the message won't get pushed into the notification queue.

murgo commented 8 years ago

Hopefully fixed by #165, needs some testing

mrc0mmand commented 8 years ago

Thanks for the info! Unfortunately, now irssinotifier.pl has a strange behavior when a non-channel hilight occurs. Instead of that hilight it sends (probably) the last message from a channel pool to the push queue. So instead of a non-channel hilight I see some random (from my point of view) message in my IrssiNotifier app (or push notification).

murgo commented 8 years ago

I thought that might happen, but hasn't happened for me so far. Do you have any idea how to reproduce it?

Zannick commented 8 years ago

If it's only tripping the print_text signal then we need to realize that somehow by inspecting $dest? Alternately, turn what is print_text now into a helper function that each signal handler calls, including a new print_text handler (for non-server hilights), and instead of saving global variables, we just pass the msg, nick, dest, etc content to the other function. I just didn't want to overhaul it that much in my last pull request.

I don't get double messages from having hilightwin.pl running, so I'm sorry I didn't notice this.

mrc0mmand commented 8 years ago

Here's a simple plugin which reproduces aforementioned issue. Just set irssinotifier_screen_detached_only and irssinotifier_away_only options to OFF and load the script. You should receive a push message every 2 seconds containing a last message from your channel pool (instead of 'test hilight' from '&@hilight_test' window).

murgo commented 8 years ago

You seem to be pretty handy with Perl scripting, maybe you could fix it yourself and send a pull request? :)

If not, I'll take a look at this some day...

On Sat, 26 Mar 2016 21:50 Frantisek Sumsal, notifications@github.com wrote:

Here's a simple plugin https://gist.github.com/mrc0mmand/4425e70c991cf670d43d, which reproduces aforementioned issue. Just set irssinotifier_screen_detached_only and irssinotifier_away_only options to OFF and load the script. You should receive a push message every 2 seconds containing a last message from your channel pool.

— You are receiving this because you commented.

Reply to this email directly or view it on GitHub https://github.com/murgo/IrssiNotifier/issues/178#issuecomment-201914090

mrc0mmand commented 8 years ago

I can definitely look into it, but it won't be in the nearest future. Nevertheless, thank you both for all your effort so far, patching will be much easier now, thanks to the information you provided.