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:
|
||||
|
||||
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{
|
||||
Name: opts.Name,
|
||||
Category: opts.Category,
|
||||
|
@ -52,8 +52,36 @@ Here is for example how you would generate an IQ discovery result using Builder:
|
|||
|
||||
### 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
|
||||
|
||||
Here is the list of implemented presence extensions:
|
||||
|
||||
- `MucPresence`
|
||||
|
||||
### IQ
|
||||
|
||||
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:
|
||||
|
||||
- BindBind
|
||||
- Pubsub
|
||||
- `BindBind`
|
||||
- `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
|
||||
`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"`
|
||||
}
|
||||
|
||||
func (x *Err) Namespace() string {
|
||||
return x.XMLName.Space
|
||||
}
|
||||
|
||||
// UnmarshalXML implements custom parsing for XMPP errors
|
||||
func (x *Err) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
|
||||
x.XMLName = start.Name
|
||||
|
|
Loading…
Reference in a new issue