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/roster.go

28 lines
549 B
Go
Raw Normal View History

2017-12-16 23:20:46 +01:00
package extension
import (
"encoding/xml"
"github.com/genofire/yaja/database"
"github.com/genofire/yaja/messages"
"github.com/genofire/yaja/server/utils"
)
type Roster struct {
Extension
Database *database.State
}
func (r *Roster) Process(element *xml.StartElement, client *utils.Client) bool {
var msg messages.IQ
if err := client.In.DecodeElement(&msg, element); err != nil {
client.Log.Warn("is no iq: ", err)
return false
}
if msg.Type != messages.IQTypeGet {
client.Log.Warn("is no get iq")
return false
}
return true
}