~samwhited/xmpp

ea52cd6cfef46a3ae2275c258704e5b3a9a988a2 — Sam Whited 4 years ago d9d1ada
all: remove dependency on Go 1.10 xml.TokenReader
2 files changed, 6 insertions(+), 2 deletions(-)

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

	"golang.org/x/text/language"

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


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

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

	for {

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

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