From e03db127cfbf5dbbaa679818ed6b3813118f0ca2 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Tue, 21 Jul 2015 11:35:39 +0200 Subject: [PATCH] Add a new configuration setting. `muc_history_max_stanzas` --- converse.js | 3 ++- docs/CHANGES.rst | 1 + docs/source/configuration.rst | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/converse.js b/converse.js index 7c396f51a..30f7007cc 100644 --- a/converse.js +++ b/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); diff --git a/docs/CHANGES.rst b/docs/CHANGES.rst index 8fceed668..65415ab0c 100644 --- a/docs/CHANGES.rst +++ b/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) ------------------ diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index 2fefdcec8..888c793d2 100644 --- a/docs/source/configuration.rst +++ b/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 `_ +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 `_, +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 ------------------