User menu messages glyph in header with new message indicator?

Hello Discourse wizards,

I’d like to do some or all of the following, if possible, within a theme (I don’t have think I have the chops to do understand how to make a plugin yet):

  1. insert the messages glyph from the user menu into the header, complete with its popup of recent messages.
  2. give this header messages glyph a new-message indicator (and remove it from the user avatar)
  3. remove the messages glyph from the user menu

I know that I can put a messages link in the header like so

<script type="text/discourse-plugin" version="0.8">
  const { iconNode } = require("discourse-common/lib/icon-library");
  api.decorateWidget('header-icons:before', helper => {
      return helper.h('li', [
          helper.h('a.icon', {
              href:'/my/messages',
              title: 'Messages'
          }, iconNode('envelope')),
      ]);
  });
</script>

But it lacks the popup.

I found the following code in the user menu js:

 if (this.siteSettings.enable_personal_messages || this.currentUser.staff) {
      glyphs.push(this.messagesGlyph());
    }

But I don’t know if I can apply it within a theme, or how.

Any help would be greatly appreciated!

1 Like

This would be very handy for our intranet, too - anyone?

1 Like