Commit c243aba9 authored by JC Brand's avatar JC Brand

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

parent dd5c3c7a
...@@ -400,6 +400,16 @@ The "user" grouping ...@@ -400,6 +400,16 @@ The "user" grouping
This grouping collects API functions related to the current logged in user. 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 login
~~~~~ ~~~~~
......
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
}, },
}, },
'user': { 'user': {
'jid': function () {
return converse.connection.jid;
},
'login': function (credentials) { 'login': function (credentials) {
converse.initConnection(); converse.initConnection();
converse.logIn(credentials); converse.logIn(credentials);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment