aboutsummaryrefslogtreecommitdiffstats
path: root/util/stanza.lua
Commit message (Collapse)AuthorAgeFilesLines
* Merge 0.11->trunkKim Alvefur2021-01-081-2/+2
|\
| * util.stanza: Move misplaced argument to correct placeKim Alvefur2020-12-241-2/+2
| | | | | | | | | | valid_utf8() takes only one argument, so the false was probably meant to be valid_xml_cdata(text, attribute=false)
* | Merge 0.11->trunkKim Alvefur2020-11-111-1/+9
|\|
| * util.stanza: Reject ASCII control characters (fixes #1606)Kim Alvefur2020-11-111-1/+9
| |
* | util.stanza: Extract Application-Specific Condition from errorsKim Alvefur2020-09-261-6/+8
| | | | | | | | API change
* | util.stanza: Support Application-Specific Conditions in util.errorKim Alvefur2020-09-261-0/+5
| |
* | util.stanza: Get 'by' from context insteadKim Alvefur2020-09-261-1/+1
| | | | | | | | | | | | | | 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
* | util.stanza: Support inclusion of <gone> URI from util.error objectKim Alvefur2020-09-261-2/+8
| |
* | util.stanza: Support getting 'by' from util.error objectKim Alvefur2020-09-261-0/+3
| |
* | util.stanza: Reorder code to prepare for extracting 'by' from util.errorKim Alvefur2020-09-261-3/+3
| |
* | util.stanza: Add method returning stanza with added indentationKim Alvefur2020-04-121-0/+30
| | | | | | | | | | Adds indentation and line breaks to stanzas, to make stanzas easier to read for humans.
* | util.stanza: Accept util.error object to error_replyKim Alvefur2019-12-141-0/+3
| | | | | | | | | | | | | | | | 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.
* | util.stanza: Support the 'by' attribute on errorsKim Alvefur2019-11-251-2/+5
| | | | | | | | | | 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.
* | util.stanza: Check that argument to error_reply is NOT a stanza of type errorKim Alvefur2019-11-251-0/+2
| | | | | | | | Replying to an error is Very Bad
* | util.stanza: Check that argument to error_reply is a stanzaKim Alvefur2019-11-251-0/+3
| |
* | util.stanza: Remove redundant check for attrsKim Alvefur2019-11-251-1/+1
| | | | | | | | A stanza can't not have attrs if created the correct way
* | util.stanza: Check that argument to reply is a stanzaKim Alvefur2019-11-251-0/+3
| |
* | util.stanza: Use :text_tag internally everywhereKim Alvefur2019-08-021-3/+3
| | | | | | | | May allow future changes in a single place.
* | util.stanza: Fix :top_tag() handling of namespaced attributesMatthew Wild2019-03-251-32/+30
| |
* | util.stanza: Require a type attribute for iq stanzasKim Alvefur2018-12-281-1/+7
|/
* util.stanza: Deserialize stanza without mutating input (fixes #711)Kim Alvefur2018-12-011-27/+17
|
* util.stanza: Validate input to clone() (with brief tests)Kim Alvefur2018-11-171-2/+9
|
* util.stanza: Set preserialize as freeze metamethodKim Alvefur2018-10-121-0/+2
|
* util.stanza: Don't automatically generate ids for iq stanzasMatthew Wild2018-09-131-9/+4
| | | | | | | | | | 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.
* util.stanza + tests: Bail out of loop if we are iterating too far, fixes #981Matthew Wild2018-08-191-0/+6
|
* Merge 0.10->trunkKim Alvefur2018-07-081-0/+10
|\
| * util.stanza: Add method for removing all children with a specific name, xmlnsKim Alvefur2018-07-081-0/+10
| |
* | util.stanza: Remove redundant check from :text now done in :add_direct_childKim Alvefur2018-06-081-1/+0
| |
* | util.stanza: Verify that other objects added as children are valid stringsKim Alvefur2018-06-081-1/+4
| |
* | util.stanza: Verify that child tags added are really stanzas (closes #1165)Kim Alvefur2018-06-081-1/+1
| |
* | util.stanza: Add :text_tag(), a shortcut for adding nodes with textKim Alvefur2018-03-211-0/+4
| |
* | util.stanza: Allow :text(nil) and :text("") as harmless nopsMatthew Wild2018-03-211-3/+5
| |
* | util.stanza: Switch from asserts to if's, improve performance, errors and testsMatthew Wild2018-03-181-18/+32
| |
* | util.stanza: Add stricter validation for data passed to stanza builder APIMatthew Wild2018-03-161-0/+29
| |
* | vairious: Add annotation when an empty environment is set [luacheck]Kim Alvefur2018-02-281-0/+1
| |
* | util.stanza: Change __type to __name as this is used by Lua 5.3 in some ↵Kim Alvefur2018-02-161-1/+1
| | | | | | | | error reporting functions
* | util: Various minor changes to please [luacheck]Kim Alvefur2017-11-101-1/+7
| |
* | Merge 0.10->trunkKim Alvefur2016-12-021-0/+6
|\|
| * util.stanza: Add an is_stanza() function to check if an object is a stanzaKim Alvefur2016-11-281-0/+6
| |
* | Merge 0.10->trunkMatthew Wild2016-03-091-21/+20
|\|
| * util.stanza: Some code cleanup [luacheck]Matthew Wild2016-03-091-21/+20
| |
* | util.stanza, util.xml, util.xmppstream: Add support for tracking defined ↵Matthew Wild2015-12-081-5/+10
|/ | | | namespaces and their prefix (stanza.namespaces), knowing/preserving prefix names is required for some applications (thanks daurnimator)
* util.stanza: Export xml_escape (missed during removal of module() calls)Kim Alvefur2015-09-031-0/+1
|
* util.*: Remove use of module() function, make all module functions local and ↵Kim Alvefur2015-02-211-36/+38
| | | | return them in a table at the end
* Merge 0.9->0.10Kim Alvefur2014-10-261-13/+2
|\
| * Backout changeset 6e67c73f730c: not a major fix and it breaks interop with ↵0.9.7Matthew Wild2014-10-241-13/+2
| | | | | | | | at least Isode M-Link, and possibly standards, while it's not clear it actually fixes the original problem either.
* | Merge 0.9->0.10Waqas Hussain2014-10-081-2/+13
|\|
| * util.stanza: Escape newlines and tabs (\r\n\t) when serializing stanzas. ↵Waqas Hussain2014-10-081-2/+13
| | | | | | | | \r\n transforms into \n otherwise, and \r\n\t in attributes transforms into spaces.
* | Remove all trailing whitespaceFlorian Zeitz2013-08-091-8/+8
|/
* util.stanza: Use correct index when replacing the tag in .tags (thanks ↵Matthew Wild2013-04-051-1/+1
| | | | daurnimator)