mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-21 10:02:00 -08:00
Clean up & documentation
This commit is contained in:
parent
e3c0747cbb
commit
9bb4f32769
@ -18,7 +18,7 @@ struct that you can build by hand.
|
|||||||
|
|
||||||
Here is for example how you would generate an IQ discovery result:
|
Here is for example how you would generate an IQ discovery result:
|
||||||
|
|
||||||
iqResp := stanza.NewIQ(stanza.Attrs{Type: "result", From: iq.To, To: iq.From, Id: iq.Id, Lang: "en"})
|
iqResp := stanza.NewIQ(stanza.Attrs{Type: "result", From: iq.To, To: iq.From, Id: iq.Id})
|
||||||
identity := stanza.Identity{
|
identity := stanza.Identity{
|
||||||
Name: opts.Name,
|
Name: opts.Name,
|
||||||
Category: opts.Category,
|
Category: opts.Category,
|
||||||
@ -52,8 +52,36 @@ Here is for example how you would generate an IQ discovery result using Builder:
|
|||||||
|
|
||||||
### Message
|
### Message
|
||||||
|
|
||||||
|
Here is the list of implemented message extensions:
|
||||||
|
|
||||||
|
- `Delegation`
|
||||||
|
|
||||||
|
- `Markable`
|
||||||
|
- `MarkAcknowledged`
|
||||||
|
- `MarkDisplayed`
|
||||||
|
- `MarkReceived`
|
||||||
|
|
||||||
|
- `StateActive`
|
||||||
|
- `StateComposing`
|
||||||
|
- `StateGone`
|
||||||
|
- `StateInactive`
|
||||||
|
- `StatePaused`
|
||||||
|
|
||||||
|
- `HTML`
|
||||||
|
|
||||||
|
- `OOB`
|
||||||
|
|
||||||
|
- `ReceiptReceived`
|
||||||
|
- `ReceiptRequest`
|
||||||
|
|
||||||
|
- `Mood`
|
||||||
|
|
||||||
### Presence
|
### Presence
|
||||||
|
|
||||||
|
Here is the list of implemented presence extensions:
|
||||||
|
|
||||||
|
- `MucPresence`
|
||||||
|
|
||||||
### IQ
|
### IQ
|
||||||
|
|
||||||
IQ (Information Queries) contain a payload associated with the request and possibly an error. The main difference with
|
IQ (Information Queries) contain a payload associated with the request and possibly an error. The main difference with
|
||||||
@ -62,8 +90,15 @@ having multiple payloads.
|
|||||||
|
|
||||||
Here is the list of structs implementing IQPayloads:
|
Here is the list of structs implementing IQPayloads:
|
||||||
|
|
||||||
- BindBind
|
- `BindBind`
|
||||||
- Pubsub
|
- `ControlSet`
|
||||||
|
- `ControlSetResponse`
|
||||||
|
- `Delegation`
|
||||||
|
- `DiscoInfo`
|
||||||
|
- `DiscoItems`
|
||||||
|
- `Pubsub`
|
||||||
|
- `Version`
|
||||||
|
- `Node`
|
||||||
|
|
||||||
Finally, when the payload of the parsed stanza is unknown, the parser will provide the unknown payload as a generic
|
Finally, when the payload of the parsed stanza is unknown, the parser will provide the unknown payload as a generic
|
||||||
`Node` element. You can also use the Node struct to add custom information on stanza generation. However, in both cases,
|
`Node` element. You can also use the Node struct to add custom information on stanza generation. However, in both cases,
|
||||||
|
@ -19,10 +19,6 @@ type Err struct {
|
|||||||
Text string `xml:"urn:ietf:params:xml:ns:xmpp-stanzas text,omitempty"`
|
Text string `xml:"urn:ietf:params:xml:ns:xmpp-stanzas text,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Err) Namespace() string {
|
|
||||||
return x.XMLName.Space
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalXML implements custom parsing for XMPP errors
|
// UnmarshalXML implements custom parsing for XMPP errors
|
||||||
func (x *Err) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
|
func (x *Err) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
|
||||||
x.XMLName = start.Name
|
x.XMLName = start.Name
|
||||||
|
Loading…
Reference in New Issue
Block a user