Implement MUC Self-Ping#2179
Open
jubalh wants to merge 14 commits into
Open
Conversation
Introduce PREF_GROUP_CONNECTION for controlling the MUC selfping behavior: * muc.ping.interval (default 600s): Inactivity time before pinging. * muc.ping.timeout (default 60s): Timeout to wait for a reply. See-also:: #1491 Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Track two key timestamps needed for XEP-0410 activity aware selfpings: * last_activity: Time when normal room activity was last seen. * ping_sent_time: Monotonic time when a self-ping was sent, or 0 if none is in flight. See-also: https://xmpp.org/extensions/xep-0410.html See-also: #1491 Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Update the MUC last_activity timestamp on relevant incoming stanzas. This ensures we only selfping rooms that have actually gone idle. See-also: https://xmpp.org/extensions/xep-0410.html See-also: #1491 Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Periodically verify whether the client is still joined. We check if the MUC has been idle for 10 minutes, every 10 seconds. If we later switch to GMainloop or use more threading we might want to change this code. See-also: https://xmpp.org/extensions/xep-0410.html See-also: #1491 See-also: #225 Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Parse incoming IQ response and distinguish success from error stanzas. On disconnect errors (not-acceptable, not-allowed, item-not-found), print a warning to the MUC window and silently trigger presence_join_room() to rejoin the stale chat room. See-also: https://xmpp.org/extensions/xep-0410.html See-also: #1491 Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Enforce that the MUC selfping timeout is less than the ping interval. Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Add `/mucping set` and `/mucping timeout` commands. See-also: #1491 Signed-off-by: Michael Vetter <jubalh@iodoru.org>
* Parsing validation: Rejection of non integer inputs * Range validation: Rejection of negative integer values. * Boundary constraints: Rejection of overlapping configurations, verifying that `interval <= timeout` and `timeout >= interval` are caught and reported as console errors. Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Member
Author
|
Help with testing would be appreciated. |
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Ref: 2490f5b Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
And use self-pings instead of selfpings. Like in the XEP. Also document the relation between timeout and interval. Signed-off-by: Michael Vetter <jubalh@iodoru.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #1491
This will autoenable MUC Self-Ping.
It will use an interval of 10 minutes and a timeout of 1 minute.