Skip to content

Implement MUC Self-Ping#2179

Open
jubalh wants to merge 14 commits into
masterfrom
feat/1491-muc-self-ping
Open

Implement MUC Self-Ping#2179
jubalh wants to merge 14 commits into
masterfrom
feat/1491-muc-self-ping

Conversation

@jubalh

@jubalh jubalh commented Jun 17, 2026

Copy link
Copy Markdown
Member

Fixes: #1491

This will autoenable MUC Self-Ping.
It will use an interval of 10 minutes and a timeout of 1 minute.

jubalh added 8 commits June 17, 2026 09:10
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>
@jubalh jubalh self-assigned this Jun 17, 2026
@jubalh jubalh added the feature label Jun 17, 2026
@jubalh

jubalh commented Jun 17, 2026

Copy link
Copy Markdown
Member Author

Help with testing would be appreciated.

Signed-off-by: Michael Vetter <jubalh@iodoru.org>
@jubalh jubalh added this to the next milestone Jun 17, 2026
jubalh added 5 commits June 17, 2026 23:08
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement XEP-0410 MUC Self-Ping

1 participant