Software / code / prosody-modules
Comparison
mod_push2/mod_push2.lua @ 6311:27bb0bc3f4b5
mod_push2: always push voip notifications
Even during grace period
| author | Stephen Paul Weber <singpolyma@singpolyma.net> |
|---|---|
| date | Tue, 24 Jun 2025 12:13:27 -0500 |
| parent | 6267:ff7d6ee9db20 |
| child | 6312:2488254c1bc2 |
comparison
equal
deleted
inserted
replaced
| 6310:30adcea825c3 | 6311:27bb0bc3f4b5 |
|---|---|
| 379 local to_user, to_host = jid.split(stanza.attr.to) | 379 local to_user, to_host = jid.split(stanza.attr.to) |
| 380 to_user = to_user or session.username | 380 to_user = to_user or session.username |
| 381 to_host = to_host or module.host | 381 to_host = to_host or module.host |
| 382 | 382 |
| 383 -- If another session has recent activity within configured grace period, don't send push | 383 -- If another session has recent activity within configured grace period, don't send push |
| 384 if does_match and match.grace and to_host == module.host and host_sessions[to_user] then | 384 if does_match and match.grace and not is_voip(stanza) and to_host == module.host and host_sessions[to_user] then |
| 385 local now = os_time() | 385 local now = os_time() |
| 386 for _, session in pairs(host_sessions[to_user].sessions) do | 386 for _, session in pairs(host_sessions[to_user].sessions) do |
| 387 if session.last_activity and session.push_registration_id ~= push_registration_id and (now - session.last_activity) < match.grace then | 387 if session.last_activity and session.push_registration_id ~= push_registration_id and (now - session.last_activity) < match.grace then |
| 388 does_match = false | 388 does_match = false |
| 389 end | 389 end |