librelist archives

« back to archive

Registering in case account does not exist

Registering in case account does not exist

From:
vedant agarwala
Date:
2015-02-17 @ 17:12
Hello,

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?

Regards,
Vedant.

Re: [conversejs] Registering in case account does not exist

From:
Jc Brand
Date:
2015-02-18 @ 17:34
On Tue, Feb 17, 2015 at 10:42:58PM +0530, vedant agarwala wrote:
>    Hello,
> 
>    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:
https://gist.github.com/gbonvehi/376078bd6b702255a7e7

Alternatively, we should perhaps expose methods for registration in the API. If
you have any ideas there, please let me know.

JC