Kim Alvefur
815ce25d10
util.stanza: Extract Application-Specific Condition from errors
...
API change
5 years ago
Kim Alvefur
a7c3fc20a0
spec.stanza spec: Split up util.error related tests
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
f0ac29acf0
util.stanza: Add method returning stanza with added indentation
...
Adds indentation and line breaks to stanzas, to make stanzas easier to
read for humans.
6 years ago
Kim Alvefur
4e34c40ece
util.stanza: Accept util.error object to error_reply
...
If we're moving towards util.error as the standard error container then
this makes sense.
This may allow for future extensibility without needing a lot of
optional arguments.
6 years ago
Kim Alvefur
be23b274f6
util.stanza: Support the 'by' attribute on errors
...
This is to be used when the entity generating the error is not the same
as the one the stanza was directed to, e.g. an intermediate server.
6 years ago
Kim Alvefur
54da2ab6f7
util.stanza: Check that argument to error_reply is NOT a stanza of type error
...
Replying to an error is Very Bad
6 years ago
Kim Alvefur
52b7181979
util.stanza: Check that argument to error_reply is a stanza
6 years ago
Kim Alvefur
11095184a5
util.stanza: Remove redundant check for attrs
...
A stanza can't not have attrs if created the correct way
6 years ago
Kim Alvefur
b340e5e462
util.stanza: Check that argument to reply is a stanza
6 years ago
Kim Alvefur
1bf2e5f5f4
util.stanza: Improve tests
7 years ago
Kim Alvefur
50f6335501
util.stanza: Validate input to clone() (with brief tests)
7 years ago
Matthew Wild
2219abbc3f
util.stanza tests: Remove unused variable #luacheck
7 years ago
Matthew Wild
27d8902b8e
util.stanza: Don't automatically generate ids for iq stanzas
...
Users of this API should provide their own id attribute that meets their
uniqueness requirements.
The current implementation leaks information (i.e. how many iq stanzas
have been sent by the server to other JIDs). Providing any strong
guarantees of randomness here would need to pull in additional
dependencies that we don't want in this simple library.
7 years ago
Matthew Wild
af5fac0a9c
util.stanza tests: Fix test name (copy/paste error?)
7 years ago
Matthew Wild
3b0271f560
util.stanza + tests: Bail out of loop if we are iterating too far, fixes #981
7 years ago
Matthew Wild
c17a785604
util.stanza tests: Add tests for maptags() method
7 years ago
Kim Alvefur
3322ba6449
util.stanza: Brief tests for :remove_children
8 years ago
Matthew Wild
7a83585658
util.stanza: tests: Add more invalid data types and update for :text(nil) and :text("")
8 years ago
Matthew Wild
65f4b853a0
util.stanza: Switch from asserts to if's, improve performance, errors and tests
8 years ago
Kim Alvefur
6c8d196c98
util.stanza: Test coverage of is_stanza()
8 years ago
Matthew Wild
6d7cd57d44
util.stanza: Add stricter validation for data passed to stanza builder API
8 years ago
Matthew Wild
b7fd84b6e5
util.stanza: Add tests ensuring support for unicode in tag/attr names
8 years ago
Matthew Wild
a65352b35f
util.stanza: Fix tests to call error_reply() correctly, and add tests to ensure it vaguely works
8 years ago
Waqas Hussain
67293fc09f
Port tests to the `busted` test runner
8 years ago
Matthew Wild
e1b559853f
util.stanza: Fix :top_tag() handling of namespaced attributes
7 years ago
Kim Alvefur
20429527b1
util.stanza: Require a type attribute for iq stanzas
7 years ago