Add jid method to converse API, to retrieve the user's JID.

This commit is contained in:
JC Brand 2016-05-10 08:06:54 +00:00
parent dd5c3c7a38
commit c243aba98f
2 changed files with 13 additions and 0 deletions

View File

@ -400,6 +400,16 @@ The "user" grouping
This grouping collects API functions related to the current logged in user.
jid
~~~
Return's the current user's full JID (Jabber ID).
.. code-block:: javascript
converse.user.jid()
// Returns for example jc@opkode.com/conversejs-351236
login
~~~~~

View File

@ -34,6 +34,9 @@
},
},
'user': {
'jid': function () {
return converse.connection.jid;
},
'login': function (credentials) {
converse.initConnection();
converse.logIn(credentials);