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:
parent
19b34231d4
commit
c0c8fbac38
@ -15,6 +15,6 @@ converse.plugins.add('converse-caps', {
|
||||
dependencies: ['converse-status'],
|
||||
|
||||
initialize () {
|
||||
api.listen.on('constructedPresence', p => (p.root().cnode(createCapsNode()).up() && p));
|
||||
api.listen.on('constructedPresence', (_, p) => (p.root().cnode(createCapsNode()).up() && p));
|
||||
}
|
||||
});
|
||||
|
@ -64,7 +64,7 @@ const XMPPStatus = Model.extend({
|
||||
idle_since.setSeconds(idle_since.getSeconds() - _converse.idle_seconds);
|
||||
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;
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user