hannesm / jackline

minimalistic secure XMPP client in OCaml
BSD 2-Clause "Simplified" License
250 stars 20 forks source link

More tweaks for notification logic #134

Closed infinity0 closed 8 years ago

infinity0 commented 8 years ago

TL;DR is that the previous behaviour was mostly fine. one just has to look for notify_contact in arg2 rather than _notifications in arg1. Example trace running without any fd-gui:

disconnected disconnect
connected connect
connected_notifications notify_contact                  # message received on inactive contact
connected_notifications notify_contact
connected clear_all_notifications                       # visited all contacts
connected notify_contact clear_all_notifications        # message received on active contact
connected notify_contact clear_all_notifications        # and again
                                                        # now switching to a different contact
connected_notifications notify_contact                  # message received on previous contact, now inactive
connected_notifications notify_contact
connected clear_all_notifications                       # visited all contacts again

More generally, if fd-gui is not set then jackline should behave assuming the parent gui is always in focus - I initialise gui_has_focus to true and no other place sets it to false.

I also fixed a few other minor things, more details in the commit messages.

hannesm commented 8 years ago

thanks for the explanation, I merged https://github.com/hannesm/jackline/pull/134/commits/624ba7be16edca5eaacca0c93728b61c39951a03 and https://github.com/hannesm/jackline/pull/134/commits/76cdd5736f01456a98f42ad1ebc277bd9d5bbe43 into master... feel free to open another PR for a polished https://github.com/hannesm/jackline/pull/134/commits/bfa3877b5f62b15c7f9a50c7125e7d46a2f48ebd