Explorar el Código

Add a `logout` event.

updates #714
JC Brand hace 8 años
padre
commit
e63853ee92
Se han modificado 3 ficheros con 9 adiciones y 1 borrados
  1. 7 0
      docs/source/events.rst
  2. 1 0
      src/converse-core.js
  3. 1 1
      src/converse-muc.js

+ 7 - 0
docs/source/events.rst

@@ -118,6 +118,13 @@ Once converse.js has been initialized.
 
 
 See also `pluginsInitialized`_.
 See also `pluginsInitialized`_.
 
 
+logout
+~~~~~~
+
+The user has logged out.
+
+``converse.listen.on('logout', function (event) { ... });``
+
 messageSend
 messageSend
 ~~~~~~~~~~~
 ~~~~~~~~~~~
 
 

+ 1 - 0
src/converse-core.js

@@ -540,6 +540,7 @@
                 converse.connection.disconnect();
                 converse.connection.disconnect();
                 converse.connection.reset();
                 converse.connection.reset();
             }
             }
+            converse.emit('logout');
         };
         };
 
 
         this.saveWindowState = function (ev, hidden) {
         this.saveWindowState = function (ev, hidden) {

+ 1 - 1
src/converse-muc.js

@@ -430,7 +430,7 @@
                         type: 'groupchat',
                         type: 'groupchat',
                         id: msgid
                         id: msgid
                     }).c("body").t(text).up()
                     }).c("body").t(text).up()
-                    .c("x", {xmlns: "jabber:x:event"}).c("composing");
+                    .c("x", {xmlns: "jabber:x:event"}).c(converse.COMPOSING);
                     converse.connection.send(msg);
                     converse.connection.send(msg);
                     this.model.messages.create({
                     this.model.messages.create({
                         fullname: this.model.get('nick'),
                         fullname: this.model.get('nick'),