Messages with "Disable auto-open" option

Posted on
  • So, I'm still dreaming of an easy privacy funtion that notifies me that there are new messages, but does NOT show them. That can e.g. be useful if you are in a meeting or in other situations where everybody can have a peek on the watch.
    So I looked into the "Messages" and it looks like an easy deal. In theory we just have to add

      // don't auto-open messages if noAutOpn is true
      if(noAutOpn) {
          loadMessages = false;
    	  if (!quiet) Bangle.buzz(); // Buzz , if not in quiet mode to notify that some message arrived
      } 
    

    In line 72 of lib.js and

        /*LANG*/'Disable auto-open, but buzz if not quiet': {
          value: !!settings().noAutOpn,
          onchange: v => updateSetting("noAutOpn", v)
        },
    

    In the settings.js.

    But I am hesitating to open a PR because if I upload the settings.js, the console shows

    Messages settings error: Error: Error: Module buzz_menu not found

    when oening the settings - even with the original settings.js. So I cannot test it.

    Any ideas? Or if all that makes sense, @Gordon could you just add that to Messages as descibed above?

  • What you're suggesting there sounds fine. The library error is because the IDE isn't aware it needs to load the Bangle.js-specific libs - there's some info at https://github.com/espruino/BangleApps/b­lob/master/modules/README.md - it's easy enough to add them to the search path.

    Or... you can have your own forked app loader, save the files in there, and then if you upload from the app loader it should work fine.

    However I don't think Bangle.buzz() is needed here. When WIDGETS.messages.update is called (which will show the icons on the screen) that should buzz all on its own, and if you leave it to buzz itself, the type of buzz is configurable (and different for calls) so I think that's preferable.

  • Awesome. Could you just do the change on occasion? Or, I could just shoot a PR blindly :) Not sure if I get the concept of the Modules right :)

  • Ok, just added in messages 0.50 to the development app loader

  • Perfect. Thanks a lot!

  • Tried it out and it does suppress new messages, but the buzz is actually missing.
    Maybe the custom buzz was not applied to that part of the code in a proper way...

  • PS: See line 79:

          // we will buzz when we enter the messages app
    
  • // we will buzz when we enter the messages app

    But loadMessages is false. Look at the code right after:

        if (!quiet && (!global.WIDGETS || !WIDGETS.messages)) return Bangle.buzz(); // no widgets - just buzz once to let someone know
        if (global.WIDGETS && WIDGETS.messages) WIDGETS.messages.update(messages);
    

    So assuming you're not in quiet mode , if you have no widgets then it'll buzz, but if you have the messages widget then WIDGETS.messages.update is called and that buzzes when the widget is drawn.

    So... are you in quiet mode? Or maybe you have a clock face that deliberately hides the widgets?

  • No, quiet mode is diabled. Messages app shows "no message". "Disable auto-open" is set. My watchface is showing the widgets properly.

    In Gadgetbridge debug I hit "send" and there is no buzz or widget icon. However, the Messages app is showing the debug message if opened manually.

  • That's very odd - just tested here again and it works great for me.

    If you open the Web IDE and connect to the Bangle, then paste this on the left-hand side:

    GB({"t":"notify","id":1575479849,"src":"­Hangouts","title":"A Name","body":"message contents"})
    

    Do you see any error messages printed to the console?

  • I get

    =undefined
    

    Whether or not the option is enabled. But with the Web IDE the notification buzz works as expected!

    SO: Gadgetbridge Debug Messages seem to be the problem here. Incoming call works but the messages do not trigger a buzz. However testing with my real email application I use DOES work. So I'm good for now :) Thanks for the help!
    Though it is really odd that GB debug messages do not trigger the buzz :|

  • Interesting - yes, it's very odd the gadgetbridge debug doesn't buzz...

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Messages with "Disable auto-open" option

Posted by Avatar for Hank @Hank

Actions