Fix router after #62 merge

This commit is contained in:
Mickael Remond
2019-06-22 11:24:14 +02:00
parent d9fdff0839
commit e9c704eff5
2 changed files with 11 additions and 12 deletions

View File

@@ -155,8 +155,7 @@ func (r *Route) Packet(name string) *Route {
type nsTypeMatcher []string
func (m nsTypeMatcher) Match(p Packet, match *RouteMatch) bool {
// TODO: Rework after merge of #62
var stanzaType string
var stanzaType StanzaType
switch packet := p.(type) {
case IQ:
stanzaType = packet.Type
@@ -172,7 +171,7 @@ func (m nsTypeMatcher) Match(p Packet, match *RouteMatch) bool {
default:
return false
}
return matchInArray(m, stanzaType)
return matchInArray(m, string(stanzaType))
}
// IQNamespaces adds an IQ matcher, expecting both an IQ and a