-- SPDX-FileCopyrightText: 2026 Matthew Fennell -- -- SPDX-License-Identifier: AGPL-3.0-or-later -- This plugin delays IQs from any user named "user1" for 45 seconds. -- This is useful when testing Monal's MLPromises. By delaying the response for -- longer than the time an iOS app lives in the background, we can check what -- happens when a promise is handled by the notification service. function on_message(event) local username = event.stanza:find"{jabber:iq:register}query/username#" if (username == "user1") then module:log("info", "Sleeping to give time to swipe away Monal"); os.execute("sleep 45") module:log("info", "Done sleeping"); end end module:hook("iq/host", on_message, 9999);