Kim Alvefur
020cd46f03
util.prosodyctl.cert: Fix for prompt functions having moved to util.human.io
5 years ago
Matthew Wild
48521ba153
util.cache: Add __name to metatable
5 years ago
Matthew Wild
f80e643a0e
util.dbuffer: Add __name to metatable
5 years ago
Matthew Wild
01c5bf5529
util.dbuffer: Optimize :sub() and :byte()
5 years ago
Matthew Wild
a095a0c533
util.debug: Fix locals being reported under wrong stack frame in some cases (+tests!!)
5 years ago
Kim Alvefur
5b33f834fa
util.paths: Optimize path joining with few arguments
...
A casual search suggests that the majority of paths.join() calls involve
only two arguments. This saves the creation of a table for up to 3
arguments.
Looks like 3x faster for 3 arguments or less, 5% slower when it uses the
array to concatenate.
5 years ago
Kim Alvefur
203b48b127
util.sasl.scram: Use util.strbitop for XOR step
6 years ago
Matthew Wild
58e33e3995
util.error: Pass through existing error objects passed to new()
5 years ago
Kim Alvefur
d3b3e21720
util.dbuffer: Expose length as :len() method, like strings
...
Ref #1598
5 years ago
Matthew Wild
c07d15cf71
util.startup: Handle missing nparams field from debug info (not present in 5.1)
5 years ago
Kim Alvefur
c5933e9ed7
util.startup: Include arguments in function string representation
...
Improves usability of the console when digging around the internals.
No specific rationale for the function<file:line>(args) format, it
looked best of the variants I tried.
5 years ago
Kim Alvefur
9302a14d80
util.startup: Retrieve less data for function string representation
...
debug.getinfo(f) collects more info than what is needed here.
5 years ago
Kim Alvefur
f7f0a20abf
util.startup: Save the path used by the installer to prosody.paths
...
Makes it easier for other parts of the code to use this for things, such
as determining whether a certain module is from this path or from
elsewhere.
5 years ago
Kim Alvefur
c91cc915b6
util.dependencies: Check for bitop library same way as net.websocket.frames ( fixes #1594 )
5 years ago
Kim Alvefur
4b4f32104f
util.startup: Fix startup failure if CFG_DATADIR is unset
...
As is normal when running from source
5 years ago
Kim Alvefur
defba34a6c
util.startup: Re-enable installer path setup
5 years ago
Kim Alvefur
e9c3e1dedc
util.startup: Put 'installer_plugin_path' under data directory by default
...
Fixes issue where it ends up creating this in $PWD, which might be
~prosody, ~you or /, depending on how it's invoked.
5 years ago
Kim Alvefur
ef24d8cd72
util.prosodyctl: Simplify luarocks invocation
5 years ago
Kim Alvefur
28aadca557
util.prosodyctl: Move hardcoded luarocks server into prosodyctl
...
To be replaced with config option in future commit
5 years ago
Kim Alvefur
b74859e35c
util.prosodyctl: Flip argument order
...
"verb subject" feels better than "subject verb", especially since the
subject (module) is optional.
5 years ago
Kim Alvefur
3c0445e1b2
util.prosodyctl: Construct luarocks command line with templates
...
More flexible and safer wrt escaping
5 years ago
Kim Alvefur
0113f59de0
util.pluginloader: Look for module libs in mod_plugin/lib.lua
...
Luarocks can't be told to install something as foo.lib.lua AFAIK, so
instead let's try mod_bar/foo.lua
5 years ago
Kim Alvefur
19549a6976
util.pluginloader: Look for top level mod_something.lua in luarocks-style tree
5 years ago
Kim Alvefur
b0616dd198
util.pluginloader: Extract Lua version once
...
It's not going to change while the module is loaded.
5 years ago
Kim Alvefur
f875b6f99c
util.xml: Fix float formatting of line and columns in error (on Lua 5.3+)
5 years ago
Waqas Hussain
80beeeb187
util.indexedbheap: Fix heap datastructure corruption in :reschedule(smaller_value)
5 years ago
Kim Alvefur
33070035bf
util.error: Drop registry initialization with namespace as key
...
Enough complexity with compact vs normal and with/without namespace
5 years ago
Kim Alvefur
9dbdb91c47
util.error: Expand compact registries into normal form internally
...
Also the exposed form on the table returned from init()
5 years ago
Kim Alvefur
5da983d8bd
util.error: Add a "compact mode" for registries
...
Inspired by the older registry in pubsub.lib.lua
5 years ago
Kim Alvefur
d101532cfc
util.error: Expose source and registry as fields on the registry object
...
For access, e.g. to identify and compare errors later
5 years ago
Kim Alvefur
04be6c2e83
util.error: Turns out <gone> wasn't alone, there's also <redirect>
5 years ago
Kim Alvefur
60a6ee0d30
util.error: Pass converted stanza errors throguh new()
...
In order to benefit from common processing
5 years ago
Kim Alvefur
487f96c2f1
util.serialization: Let freeze metamethod return a literal string
...
Enables custom serialization, such as creating a datatype that
serializes into a variable reference.
5 years ago
Kim Alvefur
a51d591246
util.error: Collect Application-Specific Conditions from stanza errors
5 years ago
Kim Alvefur
3c7cbd0e2c
util.error: Add special case handling of <gone> with an URI
5 years ago
Kim Alvefur
8627f2e4d5
util.error: Default error originator to stanza sender
...
The @by attribute is primarily useful for errors caused by intermediate
entities.
5 years ago
Kim Alvefur
0354452a9a
util.error: Extract error originator from stanza errors
5 years ago
Kim Alvefur
815ce25d10
util.stanza: Extract Application-Specific Condition from errors
...
API change
5 years ago
Kim Alvefur
1c53f533b0
util.stanza: Support Application-Specific Conditions in util.error
5 years ago
Kim Alvefur
8c0efc9e55
util.stanza: Get 'by' from context instead
...
Zash> <error by=?> should go where? extra.by? context? source?
Zash> In Prosody this would usually be module.host or a bare user/room JID
MattJ> Zash: context
MattJ> context.by, basically the opposite of context.actor
5 years ago
Kim Alvefur
3f9988468d
util.stanza: Support inclusion of <gone> URI from util.error object
5 years ago
Kim Alvefur
2f0b85ce29
util.stanza: Support getting 'by' from util.error object
5 years ago
Kim Alvefur
d9e80064b5
util.stanza: Reorder code to prepare for extracting 'by' from util.error
5 years ago
Kim Alvefur
ed5841e42b
util.error: Add well-known field 'extra'
...
A place for various extra fields and edge cases of the stanza error data
model, e.g. the URI field of <gone>
5 years ago
Matthew Wild
a34633771d
util.error: Simplify error creation flow
5 years ago
Matthew Wild
2595c39a8a
util.error: Switch coerce() to use new() and change 'native' to context field 'wrapped_error'
5 years ago
Matthew Wild
891a03885a
util.error: Have init() return an object to allow API extensibility via additional methods
5 years ago
Matthew Wild
9c709d29fd
util.error: Minor tweaks to error creation code to prepare for future changes
5 years ago
Matthew Wild
73e87f3901
util.error: Simplify error creation - remove ability to set context from templates, and remove default context
5 years ago
Matthew Wild
646bd1da3d
util.error: Add unique 'instance_id' to error objects
5 years ago