Explorar el Código

Add a new configuration setting. `muc_history_max_stanzas`

JC Brand hace 10 años
padre
commit
e03db127cf
Se han modificado 3 ficheros con 20 adiciones y 1 borrados
  1. 2 1
      converse.js
  2. 1 0
      docs/CHANGES.rst
  3. 17 0
      docs/source/configuration.rst

+ 2 - 1
converse.js

@@ -324,6 +324,7 @@
             keepalive: false,
             message_archiving: 'never', // Supported values are 'always', 'never', 'roster' (See https://xmpp.org/extensions/xep-0313.html#prefs )
             message_carbons: false, // Support for XEP-280
+            muc_history_max_stanzas: undefined, // Takes an integer, limits the amount of messages to fetch from chat room's history
             no_trimming: false, // Set to true for phantomjs tests (where browser apparently has no width)
             ping_interval: 180, //in seconds
             play_sounds: false,
@@ -2774,7 +2775,7 @@
                 this.occupantsview.chatroomview = this;
                 this.render();
                 this.occupantsview.model.fetch({add:true});
-                this.join(null);
+                this.join(null, {'maxstanzas': converse.muc_history_max_stanzas});
                 converse.emit('chatRoomOpened', this);
 
                 this.$el.insertAfter(converse.chatboxviews.get("controlbox").$el);

+ 1 - 0
docs/CHANGES.rst

@@ -7,6 +7,7 @@ Changelog
 * #439 auto_login and keepalive not working [jcbrand]
 * #440 null added as resource to contact [jcbrand]
 * Add new event serviceDiscovered [jcbrand]
+* Add a new configuration setting `muc_history_max_stanzas`. [jcbrand]
 
 0.9.4 (2015-07-04)
 ------------------

+ 17 - 0
docs/source/configuration.rst

@@ -361,6 +361,23 @@ Message carbons is the XEP (Jabber protocol extension) specifically drafted to
 solve this problem, while `forward_messages`_ uses
 `stanza forwarding <http://www.xmpp.org/extensions/xep-0297.html>`_
 
+muc_history_max_stanzas
+-----------------------
+
+* Default:  ``undefined``
+
+This option allows you to specify the maximum amount of messages to be shown in a
+chat room when you enter it. By default, the amount specified in the room
+configuration or determined by the server will be returned.
+
+Please note, this option is not related to
+`XEP-0313 Message Archive Management <https://xmpp.org/extensions/xep-0313.html>`_,
+which also allows you to show archived chat room messages, but follows a
+different approach.
+
+If you're using MAM for archiving chat room messages, you might want to set
+this option to zero.
+
 expose_rid_and_sid
 ------------------