angularchatstrophestrophe.js

How to call strophejs-plugin-chatstates from service?


I have installed strophejs-plugin-chatstates to send composing state of user in one-to-one chat. There is a connection present in my code with local strophe

this.connection = new Strophe.Connection(`${EJABBERD_URL}/bosh`,
  { mechanisms: [] });

strophejs-plugin-mam, it is used as below

this.connection.mam.query(jid, options);

But I am getting error if I send composing state using

this.connection.chatstates.sendComposing(jid, type);

Error is:

ERROR TypeError: Cannot read property 'sendComposing' of undefined

Am I writing it wrong? Or How to connect chatstates with my service?


Solution

  • Will have to add that particular node_module's path in angular.json file to make connection.