Changeset

3968:bf5d91769f99

Merge commit
author tmolitor <thilo@eightysoft.de>
date Sun, 05 Apr 2020 23:39:08 +0200
parents 3967:0957ba6aeb99 (diff) 3965:2b10e51d85a6 (current diff)
children 3969:39931d727c22
files mod_smacks/mod_smacks.lua
diffstat 3 files changed, 19 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/mod_nooffline_noerror/mod_nooffline_noerror.lua	Fri Apr 03 12:26:56 2020 +0100
+++ b/mod_nooffline_noerror/mod_nooffline_noerror.lua	Sun Apr 05 23:39:08 2020 +0200
@@ -12,6 +12,7 @@
 -- ignore offline messages and don't return any error (the message will be already in MAM at this point)
 -- this is *only* triggered if mod_offline is *not* loaded and completely ignored otherwise
 module:hook("message/offline/handle", function(event)
-	event.origin.log("info", "Ignoring offline message (mod_offline seems to be *not* loaded)...");
+	local log = event.origin and event.origin.log or module._log
+	log("info", "Ignoring offline message (mod_offline seems to be *not* loaded)...");
 	return true;
 end, -100);
--- a/mod_smacks/README.markdown	Fri Apr 03 12:26:56 2020 +0100
+++ b/mod_smacks/README.markdown	Sun Apr 05 23:39:08 2020 +0200
@@ -27,12 +27,18 @@
 reconnects within this period, any stanzas in the queue that the client
 did not receive are re-sent.
 
-If the client fails to reconnect before the timeout then it is marked
-offline as normal, and any stanzas in the queue are returned to the
-sender as a "recipient-unavailable" error.
+If the client fails to reconnect before the timeout it will be marked as
+offline like prosody does on disconnect without mod_smacks.
+If the client is the last one for this jid, all message stanzas are added to
+the offline store and all other stanzas stanzas are returned with an
+"recipient-unavailable" error. If the client is not the last one with an
+open smacks session, *all* stanzas are returned with an "recipient-unavailable" error.
 
-If you don't want this behaviour on timeout you can use [mod_smacks_offline]
-or [mod_smacks_noerror] to customize the behaviour further.
+If you deliberately disabled [mod_offline], all message stanzas of the last client
+are also returned with an "recipient-unavailable" error, because the can not be
+added to the offline storage.
+If you don't want this behaviour you can use [mod_nooffline_noerror] to suppress the error.
+This is generally only advisable, if you are sure that all your clients are using MAM!
 
 This module also provides some events used by [mod_cloud_notify].
 These events are: "smacks-ack-delayed", "smacks-hibernation-start" and
@@ -49,10 +55,10 @@
 
   Option                              Default           Description
   ----------------------------------  ----------------- ------------------------------------------------------------------------------------------------------------------
-  `smacks_hibernation_time`           300 (5 minutes)   The number of seconds a disconnected session should stay alive for (to allow reconnect)
+  `smacks_hibernation_time`           600 (10 minutes)  The number of seconds a disconnected session should stay alive for (to allow reconnect)
   `smacks_enabled_s2s`                false             Enable Stream Management on server connections? *Experimental*
   `smacks_max_unacked_stanzas`        0                 How many stanzas to send before requesting acknowledgement
-  `smacks_max_ack_delay`              60 (1 minute)     The number of seconds an ack must be unanswered to trigger an "smacks-ack-delayed" event
+  `smacks_max_ack_delay`              30 (1/2 minute)   The number of seconds an ack must be unanswered to trigger an "smacks-ack-delayed" event
   `smacks_max_hibernated_sessions`    10                The number of allowed sessions in hibernated state (limited per user)
   `smacks_max_old_sessions`           10                The number of allowed sessions with timed out hibernation for which the h-value is still kept (limited per user)
 
@@ -80,6 +86,6 @@
 -   Monal (iOS)
 
 [7693724881b3]: //hg.prosody.im/prosody-modules/raw-file/7693724881b3/mod_smacks/mod_smacks.lua
-[mod_smacks_offline]: //modules.prosody.im/mod_smacks_offline
-[mod_smacks_noerror]: //modules.prosody.im/mod_smacks_noerror
+[mod_offline]: //modules.prosody.im/mod_offline
+[mod_nooffline_noerror]: //modules.prosody.im/mod_nooffline_noerror
 [mod_cloud_notify]: //modules.prosody.im/mod_cloud_notify
--- a/mod_smacks/mod_smacks.lua	Fri Apr 03 12:26:56 2020 +0100
+++ b/mod_smacks/mod_smacks.lua	Sun Apr 05 23:39:08 2020 +0200
@@ -34,11 +34,11 @@
 local sm2_attr = { xmlns = xmlns_sm2 };
 local sm3_attr = { xmlns = xmlns_sm3 };
 
-local resume_timeout = module:get_option_number("smacks_hibernation_time", 300);
+local resume_timeout = module:get_option_number("smacks_hibernation_time", 600);
 local s2s_smacks = module:get_option_boolean("smacks_enabled_s2s", false);
 local s2s_resend = module:get_option_boolean("smacks_s2s_resend", false);
 local max_unacked_stanzas = module:get_option_number("smacks_max_unacked_stanzas", 0);
-local delayed_ack_timeout = module:get_option_number("smacks_max_ack_delay", 60);
+local delayed_ack_timeout = module:get_option_number("smacks_max_ack_delay", 30);
 local max_hibernated_sessions = module:get_option_number("smacks_max_hibernated_sessions", 10);
 local max_old_sessions = module:get_option_number("smacks_max_old_sessions", 10);
 local core_process_stanza = prosody.core_process_stanza;