Wrongly passed data to the context parameter in hook

Causes `undefined` to be returned from `constructPresence` when `converse-caps` is not enabled
This commit is contained in:
JC Brand 2021-05-13 12:15:39 +02:00
parent 19b34231d4
commit c0c8fbac38
2 changed files with 2 additions and 2 deletions

View File

@ -15,6 +15,6 @@ converse.plugins.add('converse-caps', {
dependencies: ['converse-status'], dependencies: ['converse-status'],
initialize () { initialize () {
api.listen.on('constructedPresence', p => (p.root().cnode(createCapsNode()).up() && p)); api.listen.on('constructedPresence', (_, p) => (p.root().cnode(createCapsNode()).up() && p));
} }
}); });

View File

@ -64,7 +64,7 @@ const XMPPStatus = Model.extend({
idle_since.setSeconds(idle_since.getSeconds() - _converse.idle_seconds); idle_since.setSeconds(idle_since.getSeconds() - _converse.idle_seconds);
presence.c('idle', {xmlns: Strophe.NS.IDLE, since: idle_since.toISOString()}); presence.c('idle', {xmlns: Strophe.NS.IDLE, since: idle_since.toISOString()});
} }
presence = await _converse.api.hook('constructedPresence', presence); presence = await api.hook('constructedPresence', null, presence);
return presence; return presence;
} }
}); });