~samwhited/xmpp

e35bb9964ec6a2be5fefbc4ca768de827751d90e — Sam Whited 4 years ago 95bcbd7
Revert "all: remove dependency on Go 1.10 xml.TokenReader"

This reverts commit ea52cd6cfef46a3ae2275c258704e5b3a9a988a2.
2 files changed, 2 insertions(+), 6 deletions(-)

M internal/stream.go
M session.go
M internal/stream.go => internal/stream.go +1 -2
@@ 12,7 12,6 @@ import (

	"golang.org/x/text/language"

	"mellium.im/xmlstream"
	"mellium.im/xmpp/internal/ns"
	"mellium.im/xmpp/jid"
	"mellium.im/xmpp/stream"


@@ 105,7 104,7 @@ func SendNewStream(rw io.ReadWriter, s2s bool, version Version, lang language.Ta
	return streamData, nil
}

func ExpectNewStream(ctx context.Context, d xmlstream.TokenReader, recv bool) (streamData StreamInfo, err error) {
func ExpectNewStream(ctx context.Context, d xml.TokenReader, recv bool) (streamData StreamInfo, err error) {
	var foundHeader bool

	for {

M session.go => session.go +1 -4
@@ 194,10 194,7 @@ func (s *Session) Conn() io.ReadWriter {
	return s.rw
}

// Token satisfies the xmlstream.TokenReader (or xml.TokenReader in Go 1.10)
// interface for Session.
//
// For more information see mellium.im/xmlstream
// Token satisfies the xml.TokenReader interface for Session.
func (s *Session) Token() (xml.Token, error) {
	return s.in.d.Token()
}