~samwhited/xmpp

6026cbc20a8f0e1269108b97cb7d6853fa2975ce — Sam Whited 2 months ago 37f589e
xmpp: add In and Out methods to session

This patch deprecates the InSID and OutSID methods in favor of returning
the entire stream info.
In the future this will let us more easily access the stream language,
SID, namespace used, etc. and unlocks major changes throughout the rest
of the package including removing the S2S state bit among others.

Fixes #175

Signed-off-by: Sam Whited <sam@samwhited.com>
2 files changed, 22 insertions(+), 0 deletions(-)

M CHANGELOG.md
M session.go
M CHANGELOG.md => CHANGELOG.md +6 -0
@@ 50,6 50,7 @@ All notable changes to this project will be documented in this file.
  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


@@ 71,6 72,11 @@ All notable changes to this project will be documented in this file.
  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

M session.go => session.go +16 -0
@@ 817,15 817,31 @@ func (s *Session) State() SessionState {
}

// InSID returns the stream ID for the input stream.
//
// Deprecated: InSID exists for historical compatibility and will be removed in
// a future version off this library. Use In instead.
func (s *Session) InSID() string {
	return s.in.ID
}

// OutSID returns the stream ID for the output stream.
//
// Deprecated: OutSID exists for historical compatibility and will be removed in
// a future version off this library. Use Out instead.
func (s *Session) OutSID() string {
	return s.out.ID
}

// In returns information about the input stream.
func (s *Session) In() stream.Info {
	return s.in.Info
}

// Out returns information about the output stream.
func (s *Session) Out() stream.Info {
	return s.out.Info
}

// LocalAddr returns the Origin address for initiated connections, or the
// Location for received connections.
func (s *Session) LocalAddr() jid.JID {