[WIP] Library XEP-0045 Multi-User Chat (Base for History + Password)
This commit is contained in:
parent
d8c6f942bf
commit
0ad62245e8
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/xml"
|
||||
|
||||
"dev.sum7.eu/genofire/yaja/xmpp/base"
|
||||
"dev.sum7.eu/genofire/yaja/xmpp/x/muc"
|
||||
)
|
||||
|
||||
// PresenceClient implements RFC 6120 - A.5 Client Namespace (a part)
|
||||
|
@ -21,6 +22,8 @@ type PresenceClient struct {
|
|||
|
||||
Error *ErrorClient
|
||||
|
||||
MUC *xmuc.Base // XEP-0045: Multi-User Chat (see x/muc/base.go)
|
||||
|
||||
Delay *Delay `xml:"delay"` // which XEP ?
|
||||
|
||||
// which XEP ?
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package xmuc
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Base implements XEP-0045: Multi-User Chat - 19.1
|
||||
type Base struct {
|
||||
XMLName xml.Name `xml:"http://jabber.org/protocol/muc x"`
|
||||
History *History `xml:"history,omitempty"`
|
||||
Password string `xml:"password,omitempty"`
|
||||
}
|
||||
|
||||
// History implements XEP-0045: Multi-User Chat - 19.1
|
||||
type History struct {
|
||||
MaxChars *int `xml:"maxchars,attr,omitempty"`
|
||||
MaxStanzas *int `xml:"maxstanzas,attr,omitempty"`
|
||||
Seconds *int `xml:"seconds,attr,omitempty"`
|
||||
Since *time.Time `xml:"since,attr,omitempty"`
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package xmuc
|
||||
|
||||
const (
|
||||
// NSMUC implements XEP-0045: Multi-User Chat - 19.1 muc
|
||||
NSMUC = "http://jabber.org/protocol/muc"
|
||||
|
||||
// NSMUCUser implements XEP-0045: Multi-User Chat - 19.2 muc#user
|
||||
NSMUCUser = "http://jabber.org/protocol/muc#user"
|
||||
|
||||
// NSMUCAdmin implements XEP-0045: Multi-User Chat - 19.3 muc#admin
|
||||
NSMUCAdmin = "http://jabber.org/protocol/muc#admin"
|
||||
|
||||
// NSMUCOwner implements XEP-0045: Multi-User Chat - 19.4 muc#owner
|
||||
NSMUCOwner = "http://jabber.org/protocol/muc#user"
|
||||
)
|
|
@ -0,0 +1,7 @@
|
|||
package xmuc
|
||||
|
||||
// just to validate, there is no functions in here
|
||||
func init() {
|
||||
a := 1
|
||||
a++
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package xmuc
|
||||
|
||||
import "testing"
|
||||
|
||||
func Test(t *testing.T) {}
|
Reference in New Issue