~samwhited/xmpp

v0.20.0 2 months ago

# v0.20.0 — 2021-09-26

## Security

- all: update the default TLS config to disable TLS < 1.2

## Breaking

- disco: the `Feature`, `Identity`, and `Item` types have been moved to the
  `info` and `items` packages
- mux: make namespace checking stricter by adding argument to `New`
- roster: rename `version` attribute to `ver`
- roster: the `Push` callback now takes the roster version
- roster: `FetchIQ` now takes a `roster.IQ` instead of a `stanza.IQ` so that the
  version can be set
- styling: decoding tokens now uses an iterator pattern
- stanza: added stanza namespace argument to `Is`, `AddID`, and `AddOriginID`
- xmpp: the `WebSocket` option on `StreamConfig` has been removed in favor of
  `websocket.Negotiator`
- xmpp: the `IterIQ` and `IterIQElement` methods on `Session` now return the
  start element token associated with the IQ payload
- xmpp: `Negotiator` now takes a stream config function instead of a
  `StreamConfig` struct

## Added

- blocklist: new package implementing [XEP-0191: Blocking Command]
- carbons: new package implementing [XEP-0280: Message Carbons]
- commands: new package implementing [XEP-0050: Ad-Hoc Commands]
- history: implement [XEP-0313: Message Archive Management]
- form: add `Len` and `Raw` methods to form data
- muc: new package implementing [XEP-0045: Multi-User Chat] and [XEP-0249: Direct MUC Invitations]
- mux: `mux.ServeMux` now implements `info.FeatureIter`, `info.IdentityIter`,
  `form.Iter`, and `items.Iter`
- roster: the roster `Iter` now returns the roster version being iterated over
  from the `Version` method
- roster: if a `stanza.Error` is returned from the `Push` handler it is now sent
  in response to the original roster push.
- stanza: implement [XEP-0203: Delayed Delivery]
- stanza: more general `UnmarshalError` function that doesn't focus on IQs
- stanza: add `Error` method to `Presence` and `Message`
- stanza: errors now return text if present instead of condition when converting
  to a string
- websocket: add `Negotiator` to replace the `WebSocket` option on the stream
  config
- disco: new `disco.Handler` option to configure a `mux.ServeMux` to respond to
  disco#info requests
- disco/info: new package containing the former `disco.Feature` and
  `disco.Identity` types
- xmpp: add `In()` and `Out()` methods to `Session` for fetching stream info

## Fixed

- form: calling `Set` after unmarshaling into an uninitialized form no longer
  panics
- form: unmarshaling into an existing form now resets the stored values to
  prevent data leaks across forms
- paging: when unmarshaling sets, index is an attribute, not a child element
- roster: the roster version is now always included, even if empty, to signal
  that we support roster versioning
- roster: the handler now responds with an IQ result if the roster `Push`
  handler does not return an error
- stanza: unmarshaling error IQs now works even if the error is not the first
  child in the payload
- styling: pre-block start tokens with no newline had nonsensical formatting
- xmpp: empty IQ iters no longer return EOF when there is no payload
- xmpp: `UnmarshalIQ` and `UnmarshalIQElement` no longer return an XML error
  on responses with no payload

## Deprecated

- xmpp: the `InSID` and `OutSID` methods on `Session`

[XEP-0045: Multi-User Chat]: https://xmpp.org/extensions/xep-0045.html
[XEP-0050: Ad-Hoc Commands]: https://xmpp.org/extensions/xep-0050.html
[XEP-0191: Blocking Command]: https://xmpp.org/extensions/xep-0191.html
[XEP-0203: Delayed Delivery]: https://xmpp.org/extensions/xep-0203.html
[XEP-0249: Direct MUC Invitations]: https://xmpp.org/extensions/xep-0249.html
[XEP-0280: Message Carbons]: https://xmpp.org/extensions/xep-0280.html
[XEP-0313: Message Archive Management]: https://xmpp.org/extensions/xep-0313.html