protected override IQ GetDiscoItems(XmppStream stream, IQ iq, XmppHandlerContext context) { if (((DiscoItems)iq.Query).Node != null) return XmppStanzaError.ToServiceUnavailable(iq); var answer = new IQ(IqType.result); answer.Id = iq.Id; answer.From = Jid; answer.To = iq.From; var items = new DiscoItems(); answer.Query = items; if (realJid != null) { items.AddDiscoItem().Jid = realJid; } return answer; }
protected virtual IQ GetDiscoItems(XmppStream stream, IQ iq, XmppHandlerContext context) { if (((DiscoItems)iq.Query).Node != null) return XmppStanzaError.ToServiceUnavailable(iq); var answer = new IQ(IqType.result); answer.Id = iq.Id; answer.From = Jid; answer.To = iq.From; var items = new DiscoItems(); answer.Query = items; foreach (var service in ServiceManager.GetChildServices(Jid)) { if (service.DiscoItem != null) items.AddDiscoItem(service.DiscoItem); } return answer; }