You are reading a single comment by @rigrig and its replies. Click here to read the full conversation.
  • I made a draft PR.

    How it works now:

    how to handle each of:

    save message, go to app

    Bangle.on("message", (type,message) => {
          if (message.handled) return; // already handled
          require("messages").save(message);
          if (wantToLoadAppfor(message)) require("messages").openGUI(message);
    });
    

    do something, save message, don't go to app

    Bangle.on("message", (type,message) => {
          if (message.handled) return; // already handled
          doSomethingWith(message);
          require("messages").save(message);
          message.handled = true;
    });
    

    do something, don't save message, don't go to app

    Bangle.on("message", (type,message) => {
          if (message.handled) return; // already handled
          doSomethingWith(message);
          message.handled = true;
    });
    

    Note that the if (message.handled) return; // already handled is only meant to be used if the code does something like e.g. displaying the message, widgets just always show an icon for new messages.

    Some things I ran into:

    • Depending on GUI apps/widgets as "module" seems a bit of a mismatch (right now the sanitychecker complains it expects e.g. a messagewidget file to exist if an app provides a messagewidget module. We could work around that I guess, but it seems Wrong...)
    • What should we do about the settings? I guess split the menus out into e.g. "Message GUI", "Message Widget", "Message Behaviour" settings, but maybe we should still save them all in messages.settings.json? Even for custom apps, and just accept that it might pollute the file a bit?


    The messages app (and notify icon) was an easy way to get to music though...

    Yeah, probably best to leave it in, and custom music apps can catch the event before it leaves the default GUI.

About

Avatar for rigrig @rigrig started