|
|
|
@ -38,7 +38,7 @@ func getIQ(id string, c chan xmpp.IQ, iqc chan xmpp.IQ) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func rcvStanzas(client *xmpp.Client, iqc chan xmpp.IQ, msgc chan xmpp.Chat, ctx context.Context) {
|
|
|
|
|
func rcvStanzas(client *xmpp.Client, iqc chan xmpp.IQ, msgc chan xmpp.Chat, ctx context.Context, cancel context.CancelFunc) {
|
|
|
|
|
for {
|
|
|
|
|
received, err := client.Recv()
|
|
|
|
|
// Don't print errors if the program is getting shut down,
|
|
|
|
@ -49,7 +49,7 @@ func rcvStanzas(client *xmpp.Client, iqc chan xmpp.IQ, msgc chan xmpp.Chat, ctx
|
|
|
|
|
return
|
|
|
|
|
default:
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Println(err)
|
|
|
|
|
closeAndExit(client, cancel, err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
switch v := received.(type) {
|
|
|
|
|