filter:messaging.notify issue

NodeBB Development
  • Hi, I wonder if you can help me.

    I've recently created a plugin that is listening to the filter:messaging.notify hook, the plugin works correctly, however for some reason when people are messaging each other, the messages will not show unless you close the message and re-open it.

    If the plugin is deactivated, messages instantly show.

    I see that plugins used to make use of a callback, but I've looked at the code that that hook fires and it doesn't appear to need a callback.

    I did try adding the callback for testing and it says that callback is not a function.

    Am I missing a call or a hook I need to fire to make NodeBB complete the process of sending the message to the open message window?

  • That is a filter hook so you need to return the data from it.

    myPlugin.filterMessagingNotify = async (hookData) => {
       // do something with hookData
       return hookData;
    };
    
  • @baris said in filter:messaging.notify issue:

    That is a filter hook so you need to return the data from it.

    myPlugin.filterMessagingNotify = async (hookData) => {
       // do something with hookData
       return hookData;
    };
    

    That's brilliant @baris thanks for your help once again!


Suggested Topics


| | | |