Re: [conversejs] Registering in case account does not exist
- Jc Brand
- 2015-02-18 @ 17:34
On Tue, Feb 17, 2015 at 10:42:58PM +0530, vedant agarwala wrote:
> I have been hacking on converse.js and it's quite a treat. Hopefully I
> will be able to give back some of features soon.
> Anyway, I need help with a feature I'm implementing.
> I'm trying to register a user with same credentials if their login fails.
> The problem with this is that I am unable to call functions in
> RegisterPanel since obviously it is not accessible.
> How can I get about this problem?
You can write a plugin for converse.js. Plugins have access to private methods
that are not otherwise exposed.
I haven't yet written documentation on how to write plugins, I intend to do so
soon. Here's an example plugin from @gbonvehi:
Alternatively, we should perhaps expose methods for registration in the API. If
you have any ideas there, please let me know.