aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
Commit message (Collapse)AuthorAgeFilesLines
* mod_c2s: Add event just before closing as sessionKim Alvefur2021-12-011-0/+3
| | | | | | To allow modules to do things just before the session is closed. The '(pre-)resource-unbind' events are fired after the stream is closed, leaving no way to send something.
* mod_storage_sql: Return cached total where it makes senseKim Alvefur2021-11-301-4/+9
| | | | | This should skip the summary SQL query when not needed, ie when the cached value can be used directly.
* mod_storage_sql: Adjust handling of 'total' for multi-id queriesKim Alvefur2021-11-301-2/+3
| | | | | Otherwise a query for a set of ids may cause that value to be cached, despite only covering a subset.
* mod_storage_sql: Fix traceback on multi-user deletionKim Alvefur2021-11-301-2/+6
| | | | | | | jid.join(true, ...) fails. Since we don't know which users this affects, best to clear the whole cache.
* mod_mam,mod_muc_mam: Simplify deletion when multi-user-deletion is supportedKim Alvefur2021-11-302-13/+54
| | | | More code, but less of it needs to run and no extra tracking is needed.
* mod_storage_sql: Expose multi-user deletion capabilityKim Alvefur2021-11-301-0/+1
| | | | | archive_store:delete(true) deletes messages for all users, which would allow some simplification when this is supported.
* mod_admin_shell: Remove now redundant promise awaiting in dns:lookup()Kim Alvefur2021-11-271-6/+1
|
* mod_admin_shell: Remove now redundant promise awaiting in xmpp:ping()Kim Alvefur2021-11-271-6/+3
|
* mod_smacks: Remove left-over debug loggingKim Alvefur2021-11-271-1/+0
| | | | | Wrong level, missing argument, whatever it was meant to shed light on has been resolved and forgotten.
* mod_admin_shell: Fix indentationKim Alvefur2021-11-261-13/+13
| | | | It was all of for some reason
* mod_admin_shell: Wait for promisesKim Alvefur2021-11-261-0/+5
| | | | I've typed `>require"util.async".wait_for(...)` for the last time!
* mod_admin_shell: Reduce width of 'Status' columnKim Alvefur2021-11-261-3/+3
| | | | | 'unavailable' was the longest possibility, dropping it probably differentiates available from unavailable more, in less space.
* mod_admin_shell: Reduce width of 'Security' column (thanks Link Mauve)Kim Alvefur2021-11-261-3/+3
| | | | Tricky to represent "secure, but no details" in short enough space.
* mod_vcard_legacy: Also respect avatar:metadata access restrictionsEmmanuel Gil Peyrot2021-11-251-1/+1
| | | | | Zash notes this seems to have been lost in 1b657605ea29, probably by mistake.
* mod_admin_shell: Fix showing default HTTP path in module:infoKim Alvefur2021-11-251-1/+1
| | | | Thanks mod_http_openmetrics
* mod_http_openmetrics: Serve HTTP from global contextKim Alvefur2021-11-251-9/+7
| | | | | | | | | | | | Makes GET /metrics work regardless of the value of the Host header. This was not possible before 220468f7a103 which added the ability to have global HTTP modules, which was partly why the per-host part was kept while the module lived among the community modules. Another reason was to provide some semblance of security by obscurity by only loading the module on e.g. a 'localhost' VirtualHost or Component. The new IP limits obsoletes this.
* mod_smacks: Optimize scheduling of ack requestsKim Alvefur2021-11-241-1/+2
| | | | | | Taking advantage of the new callbacks added in dcf38ac6a38c and 9c450185bac1 avoids extra timers, extra syscalls and sending the `<r>` in its own TCP segment, improving efficiency.
* mod_smacks: Refactor ack requesting to avoid some timer roundtripsKim Alvefur2021-11-241-56/+62
| | | | | | | | | | The function was too large to comprehend! Breaking it up helps readability and reuse. The timer round rip is only to avoid ordering weirdness when sending from inside a stanza filter. No need when handling <r> and <a> CSI interactions both boiled down to sending an <r> immediately.
* mod_smacks: Fix timer lifetimes to follow session instead of moduleKim Alvefur2021-11-241-8/+12
| | | | | | | module:add_timer() creates a timer that stops working after the module is reloaded or unloaded, in order to prevent leaks. However, when the timers control vital session behavior, breakage occurs after reload. E.g. sessions would stop requesting acks and stop responding to acks.
* mod_smacks: Clean up compat code etcKim Alvefur2021-11-241-54/+39
| | | | | | | | Unstoppable stoppable timer compat not needed since 26f54b462601 ca 0.11.0 module:hook_stanza was renamed in 2012 No idea what was going on with the indentation and such
* mod_smacks: Import from prosody-modules @ eb63890ae8fcKim Alvefur2021-11-161-0/+690
|
* mod_external_services: Warn about missing recommended fieldsKim Alvefur2021-11-241-0/+4
| | | | | | | | These are RECOMMENDED in XEP-0215 so most likely a mistake if they are left out. Of the two REQUIRED fields, 'host' falls back to module.host and 'type' rejects the whole item.
* mod_admin_shell: Factor out simple function in module:info for reuseKim Alvefur2021-11-241-4/+6
| | | | Marginal improvement in readability
* mod_admin_shell: List collected metrics in module:infoKim Alvefur2021-11-241-0/+16
| | | | Lets you know what to look for with stats:show()
* mod_admin_shell: List net providers in module:infoKim Alvefur2021-11-231-0/+1
|
* mod_http_openmetrics: Imported from prosody-modules mod_prometheus @df2246b15075Matthew Wild2021-11-241-0/+62
| | | | | | | | | This version has several changes from the earlier mod_prometheus: - Conversion of metrics into the text-based OpenMetrics format is moved to util.openmetrics - Support for IP-based access control - Compatibility with earlier Prosody versions removed
* mod_csi_simple: Skip initiating flush in all but inactive stateKim Alvefur2021-11-201-1/+1
| | | | | | Both in the flushing and active states the right thing to do is skip directly to returning the data. Also in any unknown state, like if the filter is somehow left behind on module unload.
* mod_csi_simple: Early return on client activity while flushing bufferKim Alvefur2021-11-201-1/+1
| | | | | Cuts down on log and measurement noise. We only want to do these things here when initiating a flush.
* mod_csi_simple: Allow some straggler traffic after flushing bufferKim Alvefur2021-11-201-3/+20
| | | | | | | | | | Statistics from my server shows a high rate of very short buffer hold times, most of which are the result of replies to pings or other iq traffic, or mod_smacks acks and ack requests just after a flush was completed. This grace period should eliminate noise and quick flipping between flushing and inactive mode.
* mod_csi_simple: Skip flushing of empty bufferKim Alvefur2021-11-181-0/+2
| | | | Just adds noise
* mod_csi_simple: Fire event when flushing due to client activityKim Alvefur2021-11-181-0/+2
| | | | So that the same things happen as when triggered by an outgoing stanza
* mod_admin_shell: Return counts of shown vs total from new table viewsKim Alvefur2021-11-161-4/+17
| | | | Not exactly the way it was before, but close enough and useful.
* mod_csi_simple: Detach cleanly from sessions if unloaded while flushingKim Alvefur2021-11-161-1/+1
| | | | | | Since it changes the state to "flushing" while doing just that. Attempting to remove the filters from a session that does not have them should be a safe noop.
* MUC: Actually set the new affiliation data if it was previously emptyMatthew Wild2021-11-161-0/+1
|
* mod_csi_simple: Only act in inactive mode to prevent infinite recursionKim Alvefur2021-11-161-0/+4
| | | | | Definitely should not be firing an event that triggers like csi-flushing from which it may make sense to send things, which leads right back here
* mod_csi_simple: Unlock writes after event, to allow things to be queuedKim Alvefur2021-11-161-1/+1
| | | | | | E.g. mod_smacks could queue an <r>, which would be more likely to be included in the same write and TCP segment as the previously buffered data, reducing syscalls and network packets needing to be sent.
* MUC: Include old affiliation data in affiliation change eventMatthew Wild2021-11-161-0/+1
|
* MUC: Add room:set_affiliation_data()Matthew Wild2021-11-161-0/+22
|
* MUC: Set .previous_affiliation = "none" if nil, for consistency with ↵Matthew Wild2021-11-161-1/+1
| | | | | | .affiliation It appears nothing currently uses this field in prosody or prosody-modules
* MUC: Fix incorrect variable name (thanks luacheck)Matthew Wild2021-11-161-1/+1
|
* MUC: Switch to event.allowed signaling to block event, matching muc-pre-set-roleMatthew Wild2021-11-161-1/+3
| | | | ...and fixing the logic bug that broke everything in the previous commit.
* MUC: Add 'muc-pre-set-affiliation' event, allowing to block change or modify ↵Matthew Wild2021-11-161-10/+20
| | | | data
* MUC: Add option to include form in registration queryMatthew Wild2021-11-151-3/+11
| | | | | | | | | | | | | | | | | | | This was originally not done based on my interpretation of XEP-0045. Today's reading, however, revealed that it actually says the result > SHOULD contain **at least** a <username/> element (emphasis mine) I take this to mean that including a form **is** allowed (and I think this is sensible). Tigase already includes the form I believe. I've gated the new behaviour behind a (default off) option, because it hasn't been tested for compatibility with clients. My primary desire for it is in Snikket, where the clients will be tested to ensure compatibility with this. I don't anticipate that (m)any clients would break, so maybe after 0.12 we can experiment with enabling it by default and eventually remove the option.
* mod_admin_shell: Handle absence of connection in security column (thanks ↵Kim Alvefur2021-11-151-1/+1
| | | | | | arcseconds) I surmise this can happen in a disconnected/smacks hibernation state.
* mod_pubsub: Fix traceback in disco of non-existent node (thanks Martin)Kim Alvefur2021-11-131-2/+6
| | | | | | | In this case `ret` is a table not containing the node, which makes pubsub_error_reply() try to get an error template with that `ret` table as index, which returns a `nil` then passed to table.unpack, which in turn throws the error.
* mod_c2s: Disconnect user sessions on a role change eventMatthew Wild2021-11-121-18/+16
| | | | | The overlapping logic for deletion and password changed has been merged into a single function.
* util.human.io: Pass nil to cell mapper to signal missing valueKim Alvefur2021-11-121-15/+13
| | | | | Seems more like conventional Lua than passing an empty string to signal lack of value.
* mod_admin_shell: Respect metatables in output serializationKim Alvefur2021-11-121-1/+7
| | | | | Makes it so that returning e.g. util.cache :table() produces useful output, which otherwise would look like empty tables.
* mod_admin_shell: Specify a width for cert columnKim Alvefur2021-11-101-0/+1
| | | | Avoids ellipsis
* mod_admin_shell: Indicate bi-directional s2s connectionsKim Alvefur2021-11-101-1/+2
|