Add router to make it easier to set up routing info

- Using the router, the dispatch is not done anymore by receiving from
  receive channel, but by registering callback functions in routers,
  with matchers.
- Make IQPayload a real interface to make it easier to match namespaces.
- The StreamManager Run command is now blocking, waiting for StreamManager
  to terminate.
This commit is contained in:
Mickael Remond
2019-06-13 17:22:39 +02:00
committed by Mickaël Rémond
parent f7b7482d2e
commit b05e68c844
8 changed files with 333 additions and 17 deletions

View File

@@ -102,12 +102,15 @@ type auth struct {
}
type BindBind struct {
IQPayload
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-bind bind"`
Resource string `xml:"resource,omitempty"`
Jid string `xml:"jid,omitempty"`
}
func (b *BindBind) Namespace() string {
return b.XMLName.Space
}
// Session is obsolete in RFC 6121.
// Added for compliance with RFC 3121.
// Remove when ejabberd purely conforms to RFC 6121.