sum7
/
yaja
Archived
1
0
Fork 0
This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
yaja/server/extension/iq_ping.go

33 lines
613 B
Go

package extension
import (
"dev.sum7.eu/genofire/yaja/messages"
"dev.sum7.eu/genofire/yaja/server/utils"
)
type IQPing struct {
IQExtension
}
func (ex *IQPing) Spaces() []string { return []string{"urn:xmpp:ping"} }
func (ex *IQPing) Get(msg *messages.IQClient, client *utils.Client) bool {
log := client.Log.WithField("extension", "ping").WithField("id", msg.ID)
if msg.Ping == nil {
return false
}
// reply
client.Messages <- &messages.IQClient{
Type: messages.IQTypeResult,
To: client.JID,
From: messages.NewJID(client.JID.Domain),
ID: msg.ID,
}
log.Debug("send")
return true
}