Add SendIQ to StreamClient and Sender

This makes it possible to use SendIQ from PostConnect and route handlers.
This commit is contained in:
Wichert Akkerman
2019-10-31 20:08:39 +01:00
committed by Mickaël Rémond
parent a0e74051fd
commit eda5c23c54
2 changed files with 23 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
package xmpp
import (
"context"
"errors"
"sync"
"time"
@@ -26,6 +27,7 @@ type StreamClient interface {
Connect() error
Resume(state SMState) error
Send(packet stanza.Packet) error
SendIQ(ctx context.Context, iq stanza.IQ) (chan stanza.IQ, error)
SendRaw(packet string) error
Disconnect()
SetHandler(handler EventHandler)
@@ -35,6 +37,7 @@ type StreamClient interface {
// It is mostly use in callback to pass a limited subset of the stream client interface
type Sender interface {
Send(packet stanza.Packet) error
SendIQ(ctx context.Context, iq stanza.IQ) (chan stanza.IQ, error)
SendRaw(packet string) error
}